Author: akhaldi Date: Sat Mar 14 10:03:10 2015 New Revision: 66677
URL: http://svn.reactos.org/svn/reactos?rev=66677&view=rev Log: [NTDLL_WINETEST] Fix test failures on systems with broken RtlDecompressBuffer(). By Sebastian Lackner.
Modified: trunk/rostests/winetests/ntdll/rtl.c
Modified: trunk/rostests/winetests/ntdll/rtl.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/rtl.c?rev=... ============================================================================== --- trunk/rostests/winetests/ntdll/rtl.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ntdll/rtl.c [iso-8859-1] Sat Mar 14 10:03:10 2015 @@ -1798,9 +1798,7 @@ }
#define DECOMPRESS_BROKEN_TRUNCATED 1 -#define DECOMPRESS_BROKEN_FRAGMENT0 2 -#define DECOMPRESS_BROKEN_FRAGMENT1 4 -#define DECOMPRESS_BROKEN_FRAGMENT4095 8 +#define DECOMPRESS_BROKEN_FRAGMENT 2
static void test_RtlDecompressBuffer(void) { @@ -1824,9 +1822,7 @@ STATUS_SUCCESS, "Wine", 4, - DECOMPRESS_BROKEN_FRAGMENT4095 | - DECOMPRESS_BROKEN_FRAGMENT1 | - DECOMPRESS_BROKEN_FRAGMENT0 + DECOMPRESS_BROKEN_FRAGMENT }, /* 8 byte uncompressed chunk */ { @@ -1835,9 +1831,7 @@ STATUS_SUCCESS, "WineWine", 8, - DECOMPRESS_BROKEN_FRAGMENT4095 | - DECOMPRESS_BROKEN_FRAGMENT1 | - DECOMPRESS_BROKEN_FRAGMENT0 + DECOMPRESS_BROKEN_FRAGMENT }, /* 4 byte compressed chunk */ { @@ -1897,9 +1891,7 @@ STATUS_SUCCESS, "Wine", 4, - DECOMPRESS_BROKEN_FRAGMENT4095 | - DECOMPRESS_BROKEN_FRAGMENT1 | - DECOMPRESS_BROKEN_FRAGMENT0 + DECOMPRESS_BROKEN_FRAGMENT }, /* compressed chunk using backwards reference with 4 bit offset, 12 bit length */ { @@ -1930,9 +1922,7 @@ STATUS_SUCCESS, "Wine", 4, - DECOMPRESS_BROKEN_FRAGMENT4095 | - DECOMPRESS_BROKEN_FRAGMENT1 | - DECOMPRESS_BROKEN_FRAGMENT0 + DECOMPRESS_BROKEN_FRAGMENT }, /* compressed chunk with invalid magic */ { @@ -2057,7 +2047,8 @@ memset(buf, 0x11, sizeof(buf)); status = pRtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, sizeof(buf), test_lznt[i].compressed, test_lznt[i].compressed_size, &final_size); - ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status); + ok(status == test_lznt[i].status || broken(status == STATUS_BAD_COMPRESSION_BUFFER && + (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08x\n", i, status); if (!status) { ok(final_size == test_lznt[i].uncompressed_size, @@ -2073,7 +2064,8 @@ memset(buf, 0x11, sizeof(buf)); status = pRtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1 | COMPRESSION_ENGINE_MAXIMUM, buf, sizeof(buf), test_lznt[i].compressed, test_lznt[i].compressed_size, &final_size); - ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status); + ok(status == test_lznt[i].status || broken(status == STATUS_BAD_COMPRESSION_BUFFER && + (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08x\n", i, status); if (!status) { ok(final_size == test_lznt[i].uncompressed_size, @@ -2145,7 +2137,7 @@ status = pRtlDecompressFragment(COMPRESSION_FORMAT_LZNT1, buf, sizeof(buf), test_lznt[i].compressed, test_lznt[i].compressed_size, 0, &final_size, workspace); ok(status == test_lznt[i].status || broken(status == STATUS_BAD_COMPRESSION_BUFFER && - (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT0)), "%d: got wrong status 0x%08x\n", i, status); + (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08x\n", i, status); if (!status) { ok(final_size == test_lznt[i].uncompressed_size, @@ -2162,7 +2154,7 @@ status = pRtlDecompressFragment(COMPRESSION_FORMAT_LZNT1, buf, sizeof(buf), test_lznt[i].compressed, test_lznt[i].compressed_size, 1, &final_size, workspace); ok(status == test_lznt[i].status || broken(status == STATUS_BAD_COMPRESSION_BUFFER && - (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT1)), "%d: got wrong status 0x%08x\n", i, status); + (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08x\n", i, status); if (!status) { if (test_lznt[i].uncompressed_size == 0) @@ -2191,7 +2183,7 @@ status = pRtlDecompressFragment(COMPRESSION_FORMAT_LZNT1, buf, sizeof(buf), test_lznt[i].compressed, test_lznt[i].compressed_size, 4095, &final_size, workspace); ok(status == test_lznt[i].status || broken(status == STATUS_BAD_COMPRESSION_BUFFER && - (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT4095)), "%d: got wrong status 0x%08x\n", i, status); + (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08x\n", i, status); if (!status) { todo_wine @@ -2226,7 +2218,8 @@ memset(buf, 0x11, sizeof(buf)); status = pRtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, sizeof(buf), test_multiple_chunks, sizeof(test_multiple_chunks), &final_size); - ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status); + ok(status == STATUS_SUCCESS || broken(status == STATUS_BAD_COMPRESSION_BUFFER), + "got wrong status 0x%08x\n", status); if (!status) { ok(final_size == 4100, "got wrong final_size %d\n", final_size); @@ -2240,7 +2233,8 @@ memset(buf, 0x11, sizeof(buf)); status = pRtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, 4097, test_multiple_chunks, sizeof(test_multiple_chunks), &final_size); - ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status); + ok(status == STATUS_SUCCESS || broken(status == STATUS_BAD_COMPRESSION_BUFFER), + "got wrong status 0x%08x\n", status); if (!status) { ok(final_size == 4097, "got wrong final_size %d\n", final_size); @@ -2254,7 +2248,8 @@ memset(buf, 0x11, sizeof(buf)); status = pRtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, 4096, test_multiple_chunks, sizeof(test_multiple_chunks), &final_size); - ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status); + ok(status == STATUS_SUCCESS || broken(status == STATUS_BAD_COMPRESSION_BUFFER), + "got wrong status 0x%08x\n", status); if (!status) { ok(final_size == 4, "got wrong final_size %d\n", final_size);