1 // temporarily disable optimizations altogether until a fine grain control
2 // is implemented on Makefile level only disabling the compiler option -Os
8 #define EstimatedStringSize 384 // test correct page passing (>256)
10 static char EstimatedString[EstimatedStringSize+1]; // +1 room for terminating null
11 static char* EmptyTestChars=""; // empty test case...
12 static char* TestChars="1234567890"; // we like to find numbers
18 for (i=0; i < EstimatedStringSize; ++i)
19 EstimatedString[i] = (i%10)+'0'; // put 0123... into the string to be estimated
21 ASSERT_AreEqual(strlen(EstimatedString), strspn(EstimatedString, TestChars), "%u", "Unxpected position returned for all participant case!");
23 EstimatedString[EstimatedStringSize/2] = 'X';
24 ASSERT_AreEqual(EstimatedStringSize/2, strspn(EstimatedString, TestChars), "%u", "Unxpected position returned for breaking case!");
26 ASSERT_AreEqual(0, strspn(EstimatedString, EmptyTestChars), "%u", "Unxpected position returned for empty test case!");