dpvoice-GetCompressionTypes: Fix warnings in tests on x86_64.

This commit is contained in:
Sebastian Lackner 2015-01-24 08:37:35 +01:00
parent 7a84e26713
commit be82b0f592

View File

@ -1,4 +1,4 @@
From 083ee79fc88df1d26160cf23411e05e6a3615ac0 Mon Sep 17 00:00:00 2001
From 2ffd5a6a1a61b8a3f9a6747a5cb23676d3092c3d Mon Sep 17 00:00:00 2001
From: Alex Henrie <alexhenrie24@gmail.com>
Date: Fri, 16 Jan 2015 00:44:23 -0700
Subject: dpvoice/tests: Add GetCompressionTypes tests.
@ -8,7 +8,7 @@ Subject: dpvoice/tests: Add GetCompressionTypes tests.
1 file changed, 188 insertions(+), 2 deletions(-)
diff --git a/dlls/dpvoice/tests/voice.c b/dlls/dpvoice/tests/voice.c
index 8048280..e42fb7b 100644
index 8048280..8d1d879 100644
--- a/dlls/dpvoice/tests/voice.c
+++ b/dlls/dpvoice/tests/voice.c
@@ -343,6 +343,179 @@ static void create_voicetest(void)
@ -97,10 +97,10 @@ index 8048280..e42fb7b 100644
+ data_size = 0;
+ ret = GetCompressionTypes(iface, NULL, &data_size, &num_elements, 0);
+ ok(ret == DVERR_BUFFERTOOSMALL,
+ "%s: expected ret=%x got ret=%x\n", name, DVERR_BUFFERTOOSMALL, ret);
+ "%s: expected ret=%x, got ret=%x\n", name, DVERR_BUFFERTOOSMALL, ret);
+ ok(data_size > sizeof(DVCOMPRESSIONINFO) && data_size < sizeof(data) - 1,
+ "%s: expected data_size between %u and %u got data_size=%u\n",
+ name, sizeof(DVCOMPRESSIONINFO), sizeof(data) - 1, data_size);
+ "%s: expected data_size between %u and %u, got data_size=%u\n",
+ name, (DWORD)sizeof(DVCOMPRESSIONINFO), (DWORD)sizeof(data) - 1, data_size);
+ tests[sizeof(tests) / sizeof(tests[0]) - 3].data_size = data_size - 1;
+ tests[sizeof(tests) / sizeof(tests[0]) - 2].data_size = data_size;
+ tests[sizeof(tests) / sizeof(tests[0]) - 1].data_size = data_size + 1;
@ -127,20 +127,20 @@ index 8048280..e42fb7b 100644
+ if(ret == DV_OK || ret == DVERR_BUFFERTOOSMALL || tests[i].test_flags == NULL_DATA)
+ {
+ ok(data_size > sizeof(DVCOMPRESSIONINFO) && data_size < sizeof(data) - 1,
+ "%s: tests[%u]: expected data_size between %u and %u got data_size=%u\n",
+ name, i, sizeof(DVCOMPRESSIONINFO), sizeof(data) - 1, data_size);
+ "%s: tests[%u]: expected data_size between %u and %u, got data_size=%u\n",
+ name, i, (DWORD)sizeof(DVCOMPRESSIONINFO), (DWORD)sizeof(data) - 1, data_size);
+ if(!(tests[i].test_flags & SHARED_VARIABLE))
+ ok(num_elements > 0 && num_elements < data_size / sizeof(DVCOMPRESSIONINFO) + 1,
+ "%s: tests[%u]: expected num_elements between 0 and %u got num_elements=%u\n",
+ name, i, data_size / sizeof(DVCOMPRESSIONINFO) + 1, num_elements);
+ "%s: tests[%u]: expected num_elements between 0 and %u, got num_elements=%u\n",
+ name, i, data_size / (DWORD)sizeof(DVCOMPRESSIONINFO) + 1, num_elements);
+ }
+ else
+ {
+ ok(data_size == tests[i].data_size,
+ "%s: tests[%u]: expected data_size=%u got data_size=%u\n",
+ "%s: tests[%u]: expected data_size=%u, got data_size=%u\n",
+ name, i, tests[i].data_size, data_size);
+ ok(num_elements == tests[i].num_elements,
+ "%s: tests[%u]: expected num_elements=%u got num_elements=%u\n",
+ "%s: tests[%u]: expected num_elements=%u, got num_elements=%u\n",
+ name, i, tests[i].num_elements, num_elements);
+ }
+
@ -153,36 +153,36 @@ index 8048280..e42fb7b 100644
+ if(memcmp(&data[j].guidType, &DPVCTGUID_NONE, sizeof(GUID)) == 0)
+ {
+ ok(data[j].dwMaxBitsPerSecond == 64000,
+ "%s: tests[%u]: data[%u]: expected dwMaxBitsPerSecond=64000 got dwMaxBitsPerSecond=%u\n",
+ "%s: tests[%u]: data[%u]: expected dwMaxBitsPerSecond=64000, got dwMaxBitsPerSecond=%u\n",
+ name, i, j, data[j].dwMaxBitsPerSecond);
+ found_pcm = TRUE;
+ }
+ ok(data[j].dwSize == 80,
+ "%s: tests[%u]: data[%u]: expected dwSize=80 got dwSize=%u\n",
+ "%s: tests[%u]: data[%u]: expected dwSize=80, got dwSize=%u\n",
+ name, i, j, data[j].dwSize);
+ ok(data[j].lpszName == string_loc,
+ "%s: tests[%u]: data[%u]: expected lpszName=%p got lpszName=%p\n",
+ "%s: tests[%u]: data[%u]: expected lpszName=%p, got lpszName=%p\n",
+ name, i, j, string_loc, data[j].lpszName);
+ ok(!data[j].lpszDescription,
+ "%s: tests[%u]: data[%u]: expected lpszDescription=NULL got lpszDescription=%s\n",
+ "%s: tests[%u]: data[%u]: expected lpszDescription=NULL, got lpszDescription=%s\n",
+ name, i, j, wine_dbgstr_w(data[j].lpszDescription));
+ ok(!data[j].dwFlags,
+ "%s: tests[%u]: data[%u]: expected dwFlags=0 got dwFlags=%u\n",
+ "%s: tests[%u]: data[%u]: expected dwFlags=0, got dwFlags=%u\n",
+ name, i, j, data[j].dwFlags);
+ string_loc += lstrlenW(data[j].lpszName) + 1;
+ }
+ ok((char *)string_loc == (char *)data + data_size,
+ "%s: tests[%u]: expected string_loc=%p got string_loc=%p\n",
+ "%s: tests[%u]: expected string_loc=%p, got string_loc=%p\n",
+ name, i, (char *)data + data_size, string_loc);
+ ok(*(char *)string_loc == 0x23,
+ "%s: tests[%u]: expected *(char*)string_loc=0x23 got *(char *)string_loc=0x%x\n",
+ "%s: tests[%u]: expected *(char*)string_loc=0x23, got *(char *)string_loc=0x%x\n",
+ name, i, *(char *)string_loc);
+ ok(found_pcm, "%s: tests[%u]: MS-PCM codec not found\n", name, i);
+ }
+ else
+ {
+ ok(*(char *)data == 0x23,
+ "%s: tests[%u]: expected *(char*)data=0x23 got *(char *)data=0x%x\n",
+ "%s: tests[%u]: expected *(char*)data=0x23, got *(char *)data=0x%x\n",
+ name, i, *(char *)data);
+ }
+ }