Commit 7615ec07 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

mmdevapi: Fix reference leak in tests.

Reported by Dan Kegel
parent ef0a0d8b
......@@ -82,14 +82,18 @@ static void test_collection(IMMDeviceEnumerator *mme, IMMDeviceCollection *col)
ok(hr == E_INVALIDARG, "Asking for too high device returned 0x%08x\n", hr);
ok(dev == NULL, "Returned non-null device\n");
if (!numdev) return;
hr = IMMDeviceCollection_Item(col, 0, NULL);
ok(hr == E_POINTER, "Query with null pointer returned 0x%08x\n", hr);
hr = IMMDeviceCollection_Item(col, 0, &dev);
ok(hr == S_OK, "Valid Item returned 0x%08x\n", hr);
ok(dev != NULL, "Device is null!\n");
if (dev) IUnknown_Release(dev);
if (numdev)
{
hr = IMMDeviceCollection_Item(col, 0, NULL);
ok(hr == E_POINTER, "Query with null pointer returned 0x%08x\n", hr);
hr = IMMDeviceCollection_Item(col, 0, &dev);
ok(hr == S_OK, "Valid Item returned 0x%08x\n", hr);
ok(dev != NULL, "Device is null!\n");
if (dev)
IUnknown_Release(dev);
}
IUnknown_Release(col);
}
/* Only do parameter tests here, the actual MMDevice testing should be a separate test */
......
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