* add ctype-related tests that expose the cause of #6599

* fix warnings

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38704 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe 2010-09-18 14:31:13 +00:00
parent 86bec4a995
commit 611e1071a7
1 changed files with 11 additions and 4 deletions

View File

@ -691,7 +691,14 @@ test_ctype(const char* locale, const unsigned short int classInfos[],
int problemCount = 0;
for (int i = -1; i < 256; ++i) {
unsigned short classInfo = determineFullClassInfo(i);
char iAsChar = (char)i;
unsigned short classInfoFromChar = determineFullClassInfo(iAsChar);
if (classInfo != classInfoFromChar) {
printf("\tPROBLEM: ctype((int)%d)=%x, but ctype((char)%d)=%x\n", i,
classInfo, i, classInfoFromChar);
problemCount++;
}
if (classInfo != classInfos[i + 1]) {
printf("\tPROBLEM: ctype(%d) = %x (expected %x)\n", i, classInfo,
classInfos[i + 1]);
@ -1890,7 +1897,7 @@ test_sprintf()
{ "%f", -123, "-123.000000" },
{ "%.2f", 123456.789, "123456.79" },
{ "%'.2f", 123456.789, "123456.79" },
{ NULL, NULL }
{ NULL, 0.0, NULL }
};
test_sprintf("POSIX", sprintf_posix);
@ -1903,7 +1910,7 @@ test_sprintf()
{ "%f", -123, "-123,000000" },
{ "%.2f", 123456.789, "123456,79" },
{ "%'.2f", 123456.789, "123.456,79" },
{ NULL, NULL }
{ NULL, 0.0, NULL }
};
test_sprintf("de_DE.UTF-8", sprintf_de);
@ -1916,7 +1923,7 @@ test_sprintf()
{ "%f", -123, "-123.000000" },
{ "%.2f", 123456.789, "123456.79" },
{ "%'.2f", 123456.789, "1,23,456.79" },
{ NULL, NULL }
{ NULL, 0.0, NULL }
};
test_sprintf("gu_IN", sprintf_gu);
@ -1929,7 +1936,7 @@ test_sprintf()
{ "%f", -123, "-123,000000" },
{ "%.2f", 123456.789, "123456,79" },
{ "%'.2f", 123456.789, "123 456,79" },
{ NULL, NULL }
{ NULL, 0.0, NULL }
};
test_sprintf("nb_NO", sprintf_nb);
}