Commit ee899dc5 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

ntdll/tests: Add tests for RtlGetCompressionWorkSpaceSize.

parent 275424e9
......@@ -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();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment