ntdll/tests: Add tests for RtlGetCompressionWorkSpaceSize.

This commit is contained in:
Sebastian Lackner 2015-07-09 03:05:45 +02:00 committed by Alexandre Julliard
parent 275424e939
commit ee899dc55e
1 changed files with 47 additions and 0 deletions

View File

@ -1685,6 +1685,52 @@ static void test_RtlCompressBuffer(void)
HeapFree(GetProcessHeap(), 0, workspace);
}
static void test_RtlGetCompressionWorkSpaceSize(void)
{
ULONG compress_workspace, decompress_workspace;
NTSTATUS status;
if (!pRtlGetCompressionWorkSpaceSize)
{
win_skip("RtlGetCompressionWorkSpaceSize is not available\n");
return;
}
/* test invalid format / engine */
status = pRtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_NONE, &compress_workspace,
&decompress_workspace);
todo_wine
ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
status = pRtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_DEFAULT, &compress_workspace,
&decompress_workspace);
todo_wine
ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
status = pRtlGetCompressionWorkSpaceSize(0xFF, &compress_workspace, &decompress_workspace);
todo_wine
ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08x\n", status);
/* test LZNT1 with normal and maximum compression */
compress_workspace = decompress_workspace = 0xdeadbeef;
status = pRtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_LZNT1, &compress_workspace,
&decompress_workspace);
todo_wine
ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
ok(compress_workspace != 0, "got wrong compress_workspace %u\n", compress_workspace);
todo_wine
ok(decompress_workspace == 0x1000, "got wrong decompress_workspace %u\n", decompress_workspace);
compress_workspace = decompress_workspace = 0xdeadbeef;
status = pRtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_LZNT1 | COMPRESSION_ENGINE_MAXIMUM,
&compress_workspace, &decompress_workspace);
todo_wine
ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
ok(compress_workspace != 0, "got wrong compress_workspace %u\n", compress_workspace);
todo_wine
ok(decompress_workspace == 0x1000, "got wrong decompress_workspace %u\n", decompress_workspace);
}
START_TEST(rtl)
{
InitFunctionPtrs();
@ -1712,4 +1758,5 @@ START_TEST(rtl)
test_LdrAddRefDll();
test_LdrLockLoaderLock();
test_RtlCompressBuffer();
test_RtlGetCompressionWorkSpaceSize();
}