[DXDIAGN_WINETEST] Sync with Wine Staging 4.18. CORE-16441

This commit is contained in:
Amine Khaldi 2019-10-26 13:06:11 +01:00
parent d6c879a0e0
commit e5765ed9cb

View file

@ -163,7 +163,7 @@ static void test_EnumChildContainerNames(void)
ok(hr == E_INVALIDARG, ok(hr == E_INVALIDARG,
"Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr); "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr);
hr = IDxDiagContainer_EnumChildContainerNames(pddc, 0, NULL, sizeof(container)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumChildContainerNames(pddc, 0, NULL, ARRAY_SIZE(container));
ok(hr == E_INVALIDARG, ok(hr == E_INVALIDARG,
"Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr); "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr);
@ -183,7 +183,7 @@ static void test_EnumChildContainerNames(void)
"Expected the container buffer to be untouched, got %s\n", wine_dbgstr_w(container)); "Expected the container buffer to be untouched, got %s\n", wine_dbgstr_w(container));
memcpy(container, testW, sizeof(testW)); memcpy(container, testW, sizeof(testW));
hr = IDxDiagContainer_EnumChildContainerNames(pddc, ~0, container, sizeof(container)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumChildContainerNames(pddc, ~0, container, ARRAY_SIZE(container));
ok(hr == E_INVALIDARG, ok(hr == E_INVALIDARG,
"Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr); "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr);
ok(!memcmp(container, zerotestW, sizeof(zerotestW)), ok(!memcmp(container, zerotestW, sizeof(zerotestW)),
@ -226,7 +226,7 @@ static void test_EnumChildContainerNames(void)
"Expected the container buffer string to be empty, got %s\n", wine_dbgstr_w(container)); "Expected the container buffer string to be empty, got %s\n", wine_dbgstr_w(container));
/* Get the container name to compare against. */ /* Get the container name to compare against. */
hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, temp, sizeof(temp)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, temp, ARRAY_SIZE(temp));
ok(hr == S_OK, ok(hr == S_OK,
"Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr); "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
@ -298,7 +298,7 @@ static void test_GetChildContainer(void)
ok(child == NULL, "Expected output pointer to be NULL, got %p\n", child); ok(child == NULL, "Expected output pointer to be NULL, got %p\n", child);
/* Get the name of a suitable child container. */ /* Get the name of a suitable child container. */
hr = IDxDiagContainer_EnumChildContainerNames(pddc, 0, container, sizeof(container)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumChildContainerNames(pddc, 0, container, ARRAY_SIZE(container));
ok(hr == S_OK, ok(hr == S_OK,
"Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr); "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
if (FAILED(hr)) if (FAILED(hr))
@ -372,7 +372,7 @@ static void test_dot_parsing(void)
{ {
IDxDiagContainer *child; IDxDiagContainer *child;
hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, containerbufW, sizeof(containerbufW)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, containerbufW, ARRAY_SIZE(containerbufW));
ok(hr == S_OK, "Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x\n", hr); ok(hr == S_OK, "Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
if (FAILED(hr)) if (FAILED(hr))
{ {
@ -385,7 +385,7 @@ static void test_dot_parsing(void)
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
hr = IDxDiagContainer_EnumChildContainerNames(child, 0, childbufW, sizeof(childbufW)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumChildContainerNames(child, 0, childbufW, ARRAY_SIZE(childbufW));
ok(hr == S_OK || hr == E_INVALIDARG, ok(hr == S_OK || hr == E_INVALIDARG,
"Expected IDxDiagContainer::EnumChildContainerNames to return S_OK or E_INVALIDARG, got 0x%08x\n", hr); "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK or E_INVALIDARG, got 0x%08x\n", hr);
IDxDiagContainer_Release(child); IDxDiagContainer_Release(child);
@ -404,7 +404,7 @@ static void test_dot_parsing(void)
trace("Testing IDxDiagContainer::GetChildContainer dot parsing with container %s and child container %s.\n", trace("Testing IDxDiagContainer::GetChildContainer dot parsing with container %s and child container %s.\n",
wine_dbgstr_w(containerbufW), wine_dbgstr_w(childbufW)); wine_dbgstr_w(containerbufW), wine_dbgstr_w(childbufW));
for (i = 0; i < sizeof(test_strings)/sizeof(test_strings[0]); i++) for (i = 0; i < ARRAY_SIZE(test_strings); i++)
{ {
IDxDiagContainer *child; IDxDiagContainer *child;
char containerbufA[256]; char containerbufA[256];
@ -415,7 +415,7 @@ static void test_dot_parsing(void)
WideCharToMultiByte(CP_ACP, 0, containerbufW, -1, containerbufA, sizeof(containerbufA), NULL, NULL); WideCharToMultiByte(CP_ACP, 0, containerbufW, -1, containerbufA, sizeof(containerbufA), NULL, NULL);
WideCharToMultiByte(CP_ACP, 0, childbufW, -1, childbufA, sizeof(childbufA), NULL, NULL); WideCharToMultiByte(CP_ACP, 0, childbufW, -1, childbufA, sizeof(childbufA), NULL, NULL);
sprintf(dotbufferA, test_strings[i].format, containerbufA, childbufA); sprintf(dotbufferA, test_strings[i].format, containerbufA, childbufA);
MultiByteToWideChar(CP_ACP, 0, dotbufferA, -1, dotbufferW, sizeof(dotbufferW)/sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, dotbufferA, -1, dotbufferW, ARRAY_SIZE(dotbufferW));
trace("Trying container name %s\n", wine_dbgstr_w(dotbufferW)); trace("Trying container name %s\n", wine_dbgstr_w(dotbufferW));
hr = IDxDiagContainer_GetChildContainer(pddc, dotbufferW, &child); hr = IDxDiagContainer_GetChildContainer(pddc, dotbufferW, &child);
@ -456,7 +456,7 @@ static void test_EnumPropNames(void)
for (index = 0; index < count; index++) for (index = 0; index < count; index++)
{ {
hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, container, sizeof(container)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, container, ARRAY_SIZE(container));
ok(hr == S_OK, "Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x\n", hr); ok(hr == S_OK, "Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
if (FAILED(hr)) if (FAILED(hr))
{ {
@ -498,7 +498,7 @@ static void test_EnumPropNames(void)
"Expected the property buffer to be unchanged, got %s\n", wine_dbgstr_w(property)); "Expected the property buffer to be unchanged, got %s\n", wine_dbgstr_w(property));
memcpy(property, testW, sizeof(testW)); memcpy(property, testW, sizeof(testW));
hr = IDxDiagContainer_EnumPropNames(child, ~0, property, sizeof(property)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumPropNames(child, ~0, property, ARRAY_SIZE(property));
ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG, got 0x%08x\n", hr); ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG, got 0x%08x\n", hr);
ok(!memcmp(property, testW, sizeof(testW)), ok(!memcmp(property, testW, sizeof(testW)),
"Expected the property buffer to be unchanged, got %s\n", wine_dbgstr_w(property)); "Expected the property buffer to be unchanged, got %s\n", wine_dbgstr_w(property));
@ -531,7 +531,7 @@ static void test_EnumPropNames(void)
ok(property[0] == '\0', ok(property[0] == '\0',
"Expected the property buffer string to be empty, got %s\n", wine_dbgstr_w(property)); "Expected the property buffer string to be empty, got %s\n", wine_dbgstr_w(property));
hr = IDxDiagContainer_EnumPropNames(child, index, temp, sizeof(temp)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumPropNames(child, index, temp, ARRAY_SIZE(temp));
ok(hr == S_OK, ok(hr == S_OK,
"Expected IDxDiagContainer::EnumPropNames to return S_OK, got 0x%08x\n", hr); "Expected IDxDiagContainer::EnumPropNames to return S_OK, got 0x%08x\n", hr);
@ -601,7 +601,7 @@ static void test_GetProp(void)
for (index = 0; index < count; index++) for (index = 0; index < count; index++)
{ {
hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, container, sizeof(container)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, container, ARRAY_SIZE(container));
ok(hr == S_OK, "Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x\n", hr); ok(hr == S_OK, "Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
if (FAILED(hr)) if (FAILED(hr))
{ {
@ -614,7 +614,7 @@ static void test_GetProp(void)
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
hr = IDxDiagContainer_EnumPropNames(child, 0, property, sizeof(property)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumPropNames(child, 0, property, ARRAY_SIZE(property));
ok(hr == S_OK || hr == E_INVALIDARG, ok(hr == S_OK || hr == E_INVALIDARG,
"Expected IDxDiagContainer::EnumPropNames to return S_OK or E_INVALIDARG, got 0x%08x\n", hr); "Expected IDxDiagContainer::EnumPropNames to return S_OK or E_INVALIDARG, got 0x%08x\n", hr);
@ -750,10 +750,10 @@ static void test_root_children(void)
goto cleanup; goto cleanup;
} }
ok(count == sizeof(root_children)/sizeof(root_children[0]), ok(count == ARRAY_SIZE(root_children),
"Got unexpected count %u for the number of child containers\n", count); "Got unexpected count %u for the number of child containers\n", count);
if (count != sizeof(root_children)/sizeof(root_children[0])) if (count != ARRAY_SIZE(root_children))
{ {
skip("Received unexpected number of child containers\n"); skip("Received unexpected number of child containers\n");
goto cleanup; goto cleanup;
@ -763,7 +763,7 @@ static void test_root_children(void)
{ {
WCHAR container[256]; WCHAR container[256];
hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, container, sizeof(container)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, container, ARRAY_SIZE(container));
if (hr == E_INVALIDARG) if (hr == E_INVALIDARG)
{ {
ok(index == count, ok(index == count,
@ -920,7 +920,7 @@ static void test_DxDiag_SystemInfo(void)
if (hr == S_OK) if (hr == S_OK)
{ {
trace("Testing container DxDiag_SystemInfo\n"); trace("Testing container DxDiag_SystemInfo\n");
test_container_properties(container, property_tests, sizeof(property_tests)/sizeof(property_tests[0])); test_container_properties(container, property_tests, ARRAY_SIZE(property_tests));
container2 = NULL; container2 = NULL;
hr = IDxDiagContainer_GetChildContainer(container, empty, &container2); hr = IDxDiagContainer_GetChildContainer(container, empty, &container2);
@ -1019,7 +1019,7 @@ static void test_DxDiag_DisplayDevices(void)
WCHAR child_container[256]; WCHAR child_container[256];
IDxDiagContainer *child; IDxDiagContainer *child;
hr = IDxDiagContainer_EnumChildContainerNames(display_cont, i, child_container, sizeof(child_container)/sizeof(WCHAR)); hr = IDxDiagContainer_EnumChildContainerNames(display_cont, i, child_container, ARRAY_SIZE(child_container));
ok(hr == S_OK, "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr); ok(hr == S_OK, "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
hr = IDxDiagContainer_GetChildContainer(display_cont, child_container, &child); hr = IDxDiagContainer_GetChildContainer(display_cont, child_container, &child);
@ -1028,7 +1028,7 @@ static void test_DxDiag_DisplayDevices(void)
if (hr == S_OK) if (hr == S_OK)
{ {
trace("Testing container %s\n", wine_dbgstr_w(child_container)); trace("Testing container %s\n", wine_dbgstr_w(child_container));
test_container_properties(child, property_tests, sizeof(property_tests)/sizeof(property_tests[0])); test_container_properties(child, property_tests, ARRAY_SIZE(property_tests));
} }
IDxDiagContainer_Release(child); IDxDiagContainer_Release(child);
} }