4 static char TestString[] = "01234567890123456789"; // two times the same string
5 static char Found[256];
13 len = strlen(TestString)/2; // test only one half of the string, to find last appearance
15 /* Search for all characters in the string, including the terminator */
16 for (i = 0; i < len; ++i)
18 /* Search for this char */
19 p = strrchr (TestString, TestString[i]);
20 ASSERT_AreEqual(i+len, p-TestString, "%u", "Unexpected location of character '%c' found!" COMMA TestString[i]);
22 /* Mark the char as checked */
23 Found[TestString[i]] = 1;
26 /* Search for all other characters and make sure they aren't found */
27 for (i = 0; i < 256; ++i)
31 p = strrchr (TestString, i);
32 ASSERT_IsFalse(p, "Unexpected location of character '%c' found!" COMMA TestString[i]);