NT 4.0 doesn't support MAP_EXPAND_LIGATURES so skip test if it returns

ERROR_INVALID_FLAGS.
This commit is contained in:
Robert Reif 2004-05-30 03:11:24 +00:00 committed by Alexandre Julliard
parent 08183bdbfd
commit 4751ff2b44
1 changed files with 33 additions and 27 deletions

View File

@ -1468,20 +1468,23 @@ static void test_FoldStringA(void)
/* MAP_EXPAND_LIGATURES */ /* MAP_EXPAND_LIGATURES */
SetLastError(0); SetLastError(0);
ret = pFoldStringA(MAP_EXPAND_LIGATURES, ligatures_src, -1, dst, 256); ret = pFoldStringA(MAP_EXPAND_LIGATURES, ligatures_src, -1, dst, 256);
EXPECT_LEN(sizeof(ligatures_dst)); EXPECT_VALID; /* NT 4.0 doesnt support MAP_EXPAND_LIGATURES */
ok(strcmp(dst, ligatures_dst) == 0, if (ret != ERROR_INVALID_FLAGS) {
"MAP_EXPAND_LIGATURES: Expected '%s', got '%s'\n", ligatures_dst, dst); EXPECT_LEN(sizeof(ligatures_dst)); EXPECT_VALID;
for (i = 1; i < 256; i++) ok(strcmp(dst, ligatures_dst) == 0,
{ "MAP_EXPAND_LIGATURES: Expected '%s', got '%s'\n", ligatures_dst, dst);
if (!strchr(ligatures_src, i)) for (i = 1; i < 256; i++)
{ {
src[0] = i; if (!strchr(ligatures_src, i))
src[1] = '\0'; {
SetLastError(0); src[0] = i;
ret = pFoldStringA(MAP_EXPAND_LIGATURES, src, -1, dst, 256); src[1] = '\0';
EXPECT_LEN(2); EXPECT_VALID; SetLastError(0);
ok(dst[0] == src[0], ret = pFoldStringA(MAP_EXPAND_LIGATURES, src, -1, dst, 256);
"MAP_EXPAND_LIGATURES: Expected '%s', got '%s'\n", src, dst); EXPECT_LEN(2); EXPECT_VALID;
ok(dst[0] == src[0],
"MAP_EXPAND_LIGATURES: Expected '%s', got '%s'\n", src, dst);
}
} }
} }
@ -1852,21 +1855,24 @@ static void test_FoldStringW(void)
/* MAP_EXPAND_LIGATURES */ /* MAP_EXPAND_LIGATURES */
SetLastError(0); SetLastError(0);
ret = pFoldStringW(MAP_EXPAND_LIGATURES, ligatures_src, -1, dst, 256); ret = pFoldStringW(MAP_EXPAND_LIGATURES, ligatures_src, -1, dst, 256);
EXPECT_LEN(sizeof(ligatures_dst)/sizeof(ligatures_dst[0])); EXPECT_VALID; /* NT 4.0 doesnt support MAP_EXPAND_LIGATURES */
ok(!memcmp(dst, ligatures_dst, sizeof(ligatures_dst)), if (ret != ERROR_INVALID_FLAGS) {
"MAP_EXPAND_LIGATURES: Expanded incorrectly\n"); EXPECT_LEN(sizeof(ligatures_dst)/sizeof(ligatures_dst[0])); EXPECT_VALID;
for (i = 1; i <= 0xffff; i++) ok(!memcmp(dst, ligatures_dst, sizeof(ligatures_dst)),
{ "MAP_EXPAND_LIGATURES: Expanded incorrectly\n");
if (!strchrW(ligatures_src, i)) for (i = 1; i <= 0xffff; i++)
{ {
src[0] = i; if (!strchrW(ligatures_src, i))
src[1] = '\0'; {
SetLastError(0); src[0] = i;
ret = pFoldStringW(MAP_EXPAND_LIGATURES, src, -1, dst, 256); src[1] = '\0';
EXPECT_LEN(2); EXPECT_VALID; SetLastError(0);
ok(dst[0] == src[0], ret = pFoldStringW(MAP_EXPAND_LIGATURES, src, -1, dst, 256);
"MAP_EXPAND_LIGATURES: 0x%02x : Expected 0x%02x, got 0x%02x\n", EXPECT_LEN(2); EXPECT_VALID;
i, src[0], dst[0]); ok(dst[0] == src[0],
"MAP_EXPAND_LIGATURES: 0x%02x : Expected 0x%02x, got 0x%02x\n",
i, src[0], dst[0]);
}
} }
} }