Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/tests/smartteefilter.c | 42 ++++++++++---------------------- 1 file changed, 13 insertions(+), 29 deletions(-)
diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index f62a88fb79..0c79ea7056 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -1,5 +1,5 @@ /* - * SmartTeeFilter tests + * Smart tee filter unit tests * * Copyright 2015 Damjan Jovanovic * @@ -18,18 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <stdarg.h> - -#include "windef.h" -#include "winbase.h" -#include "winuser.h" #define COBJMACROS -#include <dshow.h> -#include <guiddef.h> -#include <devguid.h> -#include <stdio.h> - -#include "wine/strmbase.h" +#include "dshow.h" #include "wine/test.h"
static HANDLE event; @@ -2022,25 +2012,19 @@ end:
START_TEST(smartteefilter) { - if (SUCCEEDED(CoInitialize(NULL))) - { - event = CreateEventW(NULL, FALSE, FALSE, NULL); - if (event) { - test_smart_tee_filter_aggregation(); - test_smart_tee_filter(); + CoInitialize(NULL);
- test_audio_smart_tee_filter_auto_insertion(test_audio_preview); - test_audio_smart_tee_filter_auto_insertion(test_audio_capture); + event = CreateEventW(NULL, FALSE, FALSE, NULL);
- test_video_smart_tee_filter_auto_insertion(test_video_preview); - test_video_smart_tee_filter_auto_insertion(test_video_capture); + test_smart_tee_filter_aggregation(); + test_smart_tee_filter();
- CloseHandle(event); - } else - skip("CreateEvent failed, error=%u\n", GetLastError()); + test_audio_smart_tee_filter_auto_insertion(test_audio_preview); + test_audio_smart_tee_filter_auto_insertion(test_audio_capture);
- CoUninitialize(); - } - else - skip("CoInitialize failed\n"); + test_video_smart_tee_filter_auto_insertion(test_video_preview); + test_video_smart_tee_filter_auto_insertion(test_video_capture); + + CloseHandle(event); + CoUninitialize(); }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/tests/smartteefilter.c | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+)
diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index 0c79ea7056..5bcb82d154 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -24,6 +24,57 @@
static HANDLE event;
+static IBaseFilter *create_smart_tee(void) +{ + IBaseFilter *filter = NULL; + HRESULT hr = CoCreateInstance(&CLSID_SmartTee, NULL, CLSCTX_INPROC_SERVER, + &IID_IBaseFilter, (void **)&filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + return filter; +} + +#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c) +static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported) +{ + IUnknown *iface = iface_ptr; + HRESULT hr, expected_hr; + IUnknown *unk; + + expected_hr = supported ? S_OK : E_NOINTERFACE; + + hr = IUnknown_QueryInterface(iface, iid, (void **)&unk); + ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr); + if (SUCCEEDED(hr)) + IUnknown_Release(unk); +} + +static void test_interfaces(void) +{ + IBaseFilter *filter = create_smart_tee(); + ULONG ref; + + check_interface(filter, &IID_IBaseFilter, TRUE); + check_interface(filter, &IID_IMediaFilter, TRUE); + check_interface(filter, &IID_IPersist, TRUE); + check_interface(filter, &IID_IUnknown, TRUE); + + check_interface(filter, &IID_IAMFilterMiscFlags, FALSE); + check_interface(filter, &IID_IBasicAudio, FALSE); + check_interface(filter, &IID_IBasicVideo, FALSE); + check_interface(filter, &IID_IKsPropertySet, FALSE); + check_interface(filter, &IID_IMediaPosition, FALSE); + check_interface(filter, &IID_IMediaSeeking, FALSE); + check_interface(filter, &IID_IPersistPropertyBag, FALSE); + check_interface(filter, &IID_IPin, FALSE); + check_interface(filter, &IID_IQualityControl, FALSE); + check_interface(filter, &IID_IQualProp, FALSE); + check_interface(filter, &IID_IReferenceClock, FALSE); + check_interface(filter, &IID_IVideoWindow, FALSE); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got unexpected refcount %d.\n", ref); +} + typedef struct { IBaseFilter IBaseFilter_iface; LONG ref; @@ -2016,6 +2067,8 @@ START_TEST(smartteefilter)
event = CreateEventW(NULL, FALSE, FALSE, NULL);
+ test_interfaces(); + test_smart_tee_filter_aggregation(); test_smart_tee_filter();
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/tests/smartteefilter.c | 148 +++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+)
diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index 5bcb82d154..cdd09f06d3 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -33,6 +33,13 @@ static IBaseFilter *create_smart_tee(void) return filter; }
+static ULONG get_refcount(void *iface) +{ + IUnknown *unknown = iface; + IUnknown_AddRef(unknown); + return IUnknown_Release(unknown); +} + #define check_interface(a, b, c) check_interface_(__LINE__, a, b, c) static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported) { @@ -75,6 +82,146 @@ static void test_interfaces(void) ok(!ref, "Got unexpected refcount %d.\n", ref); }
+static void test_enum_pins(void) +{ + IBaseFilter *filter = create_smart_tee(); + IEnumPins *enum1, *enum2; + ULONG count, ref; + IPin *pins[4]; + HRESULT hr; + + ref = get_refcount(filter); + ok(ref == 1, "Got unexpected refcount %d.\n", ref); + + hr = IBaseFilter_EnumPins(filter, NULL); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + hr = IBaseFilter_EnumPins(filter, &enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %d.\n", ref); + + hr = IEnumPins_Next(enum1, 1, NULL, NULL); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = get_refcount(filter); + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(pins[0]); + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %d.\n", ref); + IPin_Release(pins[0]); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %d.\n", ref); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = get_refcount(filter); + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(pins[0]); + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %d.\n", ref); + IPin_Release(pins[0]); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %d.\n", ref); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = get_refcount(filter); + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(pins[0]); + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %d.\n", ref); + IPin_Release(pins[0]); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %d.\n", ref); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 1, "Got count %u.\n", count); + IPin_Release(pins[0]); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 1, "Got count %u.\n", count); + IPin_Release(pins[0]); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 1, "Got count %u.\n", count); + IPin_Release(pins[0]); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + ok(!count, "Got count %u.\n", count); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 2, pins, NULL); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 2, pins, &count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 2, "Got count %u.\n", count); + IPin_Release(pins[0]); + IPin_Release(pins[1]); + + hr = IEnumPins_Next(enum1, 2, pins, &count); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + ok(count == 1, "Got count %u.\n", count); + IPin_Release(pins[0]); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 4, pins, &count); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + ok(count == 3, "Got count %u.\n", count); + IPin_Release(pins[0]); + IPin_Release(pins[1]); + IPin_Release(pins[2]); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Clone(enum1, &enum2); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Skip(enum1, 4); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Skip(enum1, 3); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Skip(enum1, 1); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum2, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IPin_Release(pins[0]); + + IEnumPins_Release(enum2); + IEnumPins_Release(enum1); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + typedef struct { IBaseFilter IBaseFilter_iface; LONG ref; @@ -2068,6 +2215,7 @@ START_TEST(smartteefilter) event = CreateEventW(NULL, FALSE, FALSE, NULL);
test_interfaces(); + test_enum_pins();
test_smart_tee_filter_aggregation(); test_smart_tee_filter();
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/tests/smartteefilter.c | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index cdd09f06d3..f931d0b65b 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -22,6 +22,10 @@ #include "dshow.h" #include "wine/test.h"
+static const WCHAR sink_id[] = {'I','n','p','u','t',0}; +static const WCHAR capture_id[] = {'C','a','p','t','u','r','e',0}; +static const WCHAR preview_id[] = {'P','r','e','v','i','e','w',0}; + static HANDLE event;
static IBaseFilter *create_smart_tee(void) @@ -222,6 +226,46 @@ static void test_enum_pins(void) ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_find_pin(void) +{ + IBaseFilter *filter = create_smart_tee(); + IEnumPins *enum_pins; + IPin *pin, *pin2; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_EnumPins(filter, &enum_pins); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_FindPin(filter, sink_id, &pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(pin2 == pin, "Expected pin %p, got %p.\n", pin, pin2); + IPin_Release(pin2); + IPin_Release(pin); + + hr = IBaseFilter_FindPin(filter, capture_id, &pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(pin2 == pin, "Expected pin %p, got %p.\n", pin, pin2); + IPin_Release(pin2); + IPin_Release(pin); + + hr = IBaseFilter_FindPin(filter, preview_id, &pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(pin2 == pin, "Expected pin %p, got %p.\n", pin, pin2); + IPin_Release(pin2); + IPin_Release(pin); + + IEnumPins_Release(enum_pins); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + typedef struct { IBaseFilter IBaseFilter_iface; LONG ref; @@ -2216,6 +2260,7 @@ START_TEST(smartteefilter)
test_interfaces(); test_enum_pins(); + test_find_pin();
test_smart_tee_filter_aggregation(); test_smart_tee_filter();
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=50892
Your paranoid android.
=== debian9 (32 bit WoW report) ===
qcap: smartteefilter: Timeout
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/tests/smartteefilter.c | 143 ++++++++++++++++++++++--------- 1 file changed, 104 insertions(+), 39 deletions(-)
diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index f931d0b65b..79d296d655 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -266,6 +266,109 @@ static void test_find_pin(void) ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_pin_info(void) +{ + IBaseFilter *filter = create_smart_tee(); + PIN_DIRECTION dir; + PIN_INFO info; + ULONG count; + HRESULT hr; + WCHAR *id; + ULONG ref; + IPin *pin; + + hr = IBaseFilter_FindPin(filter, sink_id, &pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(pin); + ok(ref == 2, "Got unexpected refcount %d.\n", ref); + + hr = IPin_QueryPinInfo(pin, &info); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter); + ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir); + ok(!lstrcmpW(info.achName, sink_id), "Got name %s.\n", wine_dbgstr_w(info.achName)); + ref = get_refcount(filter); + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(pin); + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + IBaseFilter_Release(info.pFilter); + + hr = IPin_QueryDirection(pin, &dir); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(dir == PINDIR_INPUT, "Got direction %d.\n", dir); + + hr = IPin_QueryId(pin, &id); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(!lstrcmpW(id, sink_id), "Got id %s.\n", wine_dbgstr_w(id)); + CoTaskMemFree(id); + + hr = IPin_QueryInternalConnections(pin, NULL, &count); + ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr); + + IPin_Release(pin); + + hr = IBaseFilter_FindPin(filter, capture_id, &pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IPin_QueryPinInfo(pin, &info); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter); + ok(info.dir == PINDIR_OUTPUT, "Got direction %d.\n", info.dir); + ok(!lstrcmpW(info.achName, capture_id), "Got name %s.\n", wine_dbgstr_w(info.achName)); + ref = get_refcount(filter); + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(pin); + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + IBaseFilter_Release(info.pFilter); + + hr = IPin_QueryDirection(pin, &dir); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(dir == PINDIR_OUTPUT, "Got direction %d.\n", dir); + + hr = IPin_QueryId(pin, &id); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(!lstrcmpW(id, capture_id), "Got id %s.\n", wine_dbgstr_w(id)); + CoTaskMemFree(id); + + hr = IPin_QueryInternalConnections(pin, NULL, &count); + ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr); + + IPin_Release(pin); + + hr = IBaseFilter_FindPin(filter, preview_id, &pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IPin_QueryPinInfo(pin, &info); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter); + ok(info.dir == PINDIR_OUTPUT, "Got direction %d.\n", info.dir); + ok(!lstrcmpW(info.achName, preview_id), "Got name %s.\n", wine_dbgstr_w(info.achName)); + ref = get_refcount(filter); + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(pin); + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + IBaseFilter_Release(info.pFilter); + + hr = IPin_QueryDirection(pin, &dir); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(dir == PINDIR_OUTPUT, "Got direction %d.\n", dir); + + hr = IPin_QueryId(pin, &id); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(!lstrcmpW(id, preview_id), "Got id %s.\n", wine_dbgstr_w(id)); + CoTaskMemFree(id); + + hr = IPin_QueryInternalConnections(pin, NULL, &count); + ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr); + + IPin_Release(pin); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + typedef struct { IBaseFilter IBaseFilter_iface; LONG ref; @@ -1885,7 +1988,6 @@ static void test_smart_tee_filter(void) int pinNumber = 0; IMemInputPin *memInputPin = NULL; IEnumMediaTypes *enumMediaTypes = NULL; - ULONG nPin = 0;
hr = CoCreateInstance(&CLSID_SmartTee, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (void**)&smartTeeFilter); @@ -1908,55 +2010,24 @@ static void test_smart_tee_filter(void)
while (IEnumPins_Next(enumPins, 1, &pin, NULL) == S_OK) { - LPWSTR id = NULL; - PIN_INFO pinInfo; - memset(&pinInfo, 0, sizeof(pinInfo)); - hr = IPin_QueryPinInfo(pin, &pinInfo); - ok(SUCCEEDED(hr), "QueryPinInfo failed, hr=0x%08x\n", hr); - if (FAILED(hr)) - goto endwhile; - - ok(pinInfo.pFilter == smartTeeFilter, "pin's filter isn't the filter owning the pin\n"); if (pinNumber == 0) { - static const WCHAR wszInput[] = {'I','n','p','u','t',0}; - ok(pinInfo.dir == PINDIR_INPUT, "pin 0 isn't an input pin\n"); - ok(!lstrcmpW(pinInfo.achName, wszInput), "pin 0 is called %s, not 'Input'\n", wine_dbgstr_w(pinInfo.achName)); - hr = IPin_QueryId(pin, &id); - ok(SUCCEEDED(hr), "IPin_QueryId() failed with 0x%08x\n", hr); - ok(!lstrcmpW(id, wszInput), "pin 0's id is %s, not 'Input'\n", wine_dbgstr_w(id)); inputPin = pin; IPin_AddRef(inputPin); } else if (pinNumber == 1) { - static const WCHAR wszCapture[] = {'C','a','p','t','u','r','e',0}; - ok(pinInfo.dir == PINDIR_OUTPUT, "pin 1 isn't an output pin\n"); - ok(!lstrcmpW(pinInfo.achName, wszCapture), "pin 1 is called %s, not 'Capture'\n", wine_dbgstr_w(pinInfo.achName)); - hr = IPin_QueryId(pin, &id); - ok(SUCCEEDED(hr), "IPin_QueryId() failed with 0x%08x\n", hr); - ok(!lstrcmpW(id, wszCapture), "pin 1's id is %s, not 'Capture'\n", wine_dbgstr_w(id)); capturePin = pin; IPin_AddRef(capturePin); } else if (pinNumber == 2) { - static const WCHAR wszPreview[] = {'P','r','e','v','i','e','w',0}; - ok(pinInfo.dir == PINDIR_OUTPUT, "pin 2 isn't an output pin\n"); - ok(!lstrcmpW(pinInfo.achName, wszPreview), "pin 2 is called %s, not 'Preview'\n", wine_dbgstr_w(pinInfo.achName)); - hr = IPin_QueryId(pin, &id); - ok(SUCCEEDED(hr), "IPin_QueryId() failed with 0x%08x\n", hr); - ok(!lstrcmpW(id, wszPreview), "pin 2's id is %s, not 'Preview'\n", wine_dbgstr_w(id)); previewPin = pin; IPin_AddRef(previewPin); } else ok(0, "pin %d isn't supposed to exist\n", pinNumber);
- endwhile: - if (pinInfo.pFilter) - IBaseFilter_Release(pinInfo.pFilter); - CoTaskMemFree(id); IPin_Release(pin); pinNumber++; } @@ -2010,13 +2081,6 @@ static void test_smart_tee_filter(void) hr = IPin_EnumMediaTypes(previewPin, &enumMediaTypes); ok(hr == VFW_E_NOT_CONNECTED, "IPin_EnumMediaTypes() failed, hr=0x%08x\n", hr);
- hr = IPin_QueryInternalConnections(inputPin, NULL, &nPin); - ok(hr == E_NOTIMPL, "IPin_QueryInternalConnections() returned hr=0x%08x\n", hr); - hr = IPin_QueryInternalConnections(capturePin, NULL, &nPin); - ok(hr == E_NOTIMPL, "IPin_QueryInternalConnections() returned hr=0x%08x\n", hr); - hr = IPin_QueryInternalConnections(previewPin, NULL, &nPin); - ok(hr == E_NOTIMPL, "IPin_QueryInternalConnections() returned hr=0x%08x\n", hr); - test_smart_tee_filter_in_graph(smartTeeFilter, inputPin, capturePin, previewPin);
end: @@ -2261,6 +2325,7 @@ START_TEST(smartteefilter) test_interfaces(); test_enum_pins(); test_find_pin(); + test_pin_info();
test_smart_tee_filter_aggregation(); test_smart_tee_filter();
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/tests/smartteefilter.c | 88 ++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 39 deletions(-)
diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index 79d296d655..b3b05840aa 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -63,6 +63,7 @@ static void test_interfaces(void) { IBaseFilter *filter = create_smart_tee(); ULONG ref; + IPin *pin;
check_interface(filter, &IID_IBaseFilter, TRUE); check_interface(filter, &IID_IMediaFilter, TRUE); @@ -82,6 +83,54 @@ static void test_interfaces(void) check_interface(filter, &IID_IReferenceClock, FALSE); check_interface(filter, &IID_IVideoWindow, FALSE);
+ IBaseFilter_FindPin(filter, sink_id, &pin); + + check_interface(pin, &IID_IMemInputPin, TRUE); + check_interface(pin, &IID_IPin, TRUE); + todo_wine check_interface(pin, &IID_IQualityControl, TRUE); + check_interface(pin, &IID_IUnknown, TRUE); + + check_interface(pin, &IID_IAMStreamConfig, FALSE); + check_interface(pin, &IID_IAMStreamControl, FALSE); + check_interface(pin, &IID_IKsPropertySet, FALSE); + check_interface(pin, &IID_IMediaPosition, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(pin, &IID_IPropertyBag, FALSE); + + IPin_Release(pin); + + IBaseFilter_FindPin(filter, capture_id, &pin); + + todo_wine check_interface(pin, &IID_IAMStreamControl, TRUE); + check_interface(pin, &IID_IPin, TRUE); + todo_wine check_interface(pin, &IID_IQualityControl, TRUE); + check_interface(pin, &IID_IUnknown, TRUE); + + check_interface(pin, &IID_IAMStreamConfig, FALSE); + check_interface(pin, &IID_IAsyncReader, FALSE); + check_interface(pin, &IID_IKsPropertySet, FALSE); + check_interface(pin, &IID_IMediaPosition, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(pin, &IID_IPropertyBag, FALSE); + + IPin_Release(pin); + + IBaseFilter_FindPin(filter, preview_id, &pin); + + todo_wine check_interface(pin, &IID_IAMStreamControl, TRUE); + check_interface(pin, &IID_IPin, TRUE); + todo_wine check_interface(pin, &IID_IQualityControl, TRUE); + check_interface(pin, &IID_IUnknown, TRUE); + + check_interface(pin, &IID_IAMStreamConfig, FALSE); + check_interface(pin, &IID_IAsyncReader, FALSE); + check_interface(pin, &IID_IKsPropertySet, FALSE); + check_interface(pin, &IID_IMediaPosition, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(pin, &IID_IPropertyBag, FALSE); + + IPin_Release(pin); + ref = IBaseFilter_Release(filter); ok(!ref, "Got unexpected refcount %d.\n", ref); } @@ -1842,21 +1891,6 @@ static SourceFilter* create_audio_SourceFilter(void) return This; }
-static BOOL has_interface(IUnknown *unknown, REFIID uuid) -{ - HRESULT hr; - IUnknown *iface = NULL; - - hr = IUnknown_QueryInterface(unknown, uuid, (void**)&iface); - if (SUCCEEDED(hr)) - { - IUnknown_Release(iface); - return TRUE; - } - else - return FALSE; -} - static void test_smart_tee_filter_in_graph(IBaseFilter *smartTeeFilter, IPin *inputPin, IPin *capturePin, IPin *previewPin) { @@ -2036,30 +2070,6 @@ static void test_smart_tee_filter(void) if (!(inputPin && capturePin && previewPin)) goto end;
- ok(has_interface((IUnknown*)inputPin, &IID_IUnknown), "IUnknown should exist on the input pin\n"); - ok(has_interface((IUnknown*)inputPin, &IID_IMemInputPin), "IMemInputPin should exist the input pin\n"); - ok(!has_interface((IUnknown*)inputPin, &IID_IKsPropertySet), "IKsPropertySet shouldn't exist on the input pin\n"); - ok(!has_interface((IUnknown*)inputPin, &IID_IAMStreamConfig), "IAMStreamConfig shouldn't exist on the input pin\n"); - ok(!has_interface((IUnknown*)inputPin, &IID_IAMStreamControl), "IAMStreamControl shouldn't exist on the input pin\n"); - ok(!has_interface((IUnknown*)inputPin, &IID_IPropertyBag), "IPropertyBag shouldn't exist on the input pin\n"); - todo_wine ok(has_interface((IUnknown*)inputPin, &IID_IQualityControl), "IQualityControl should exist on the input pin\n"); - - ok(has_interface((IUnknown*)capturePin, &IID_IUnknown), "IUnknown should exist on the capture pin\n"); - ok(!has_interface((IUnknown*)capturePin, &IID_IAsyncReader), "IAsyncReader shouldn't exist on the capture pin\n"); - ok(!has_interface((IUnknown*)capturePin, &IID_IKsPropertySet), "IKsPropertySet shouldn't exist on the capture pin\n"); - ok(!has_interface((IUnknown*)capturePin, &IID_IAMStreamConfig), "IAMStreamConfig shouldn't exist on the capture pin\n"); - todo_wine ok(has_interface((IUnknown*)capturePin, &IID_IAMStreamControl), "IAMStreamControl should exist on the capture pin\n"); - ok(!has_interface((IUnknown*)capturePin, &IID_IPropertyBag), "IPropertyBag shouldn't exist on the capture pin\n"); - todo_wine ok(has_interface((IUnknown*)capturePin, &IID_IQualityControl), "IQualityControl should exist on the capture pin\n"); - - ok(has_interface((IUnknown*)previewPin, &IID_IUnknown), "IUnknown should exist on the preview pin\n"); - ok(!has_interface((IUnknown*)previewPin, &IID_IAsyncReader), "IAsyncReader shouldn't exist on the preview pin\n"); - ok(!has_interface((IUnknown*)previewPin, &IID_IKsPropertySet), "IKsPropertySet shouldn't exist on the preview pin\n"); - ok(!has_interface((IUnknown*)previewPin, &IID_IAMStreamConfig), "IAMStreamConfig shouldn't exist on the preview pin\n"); - todo_wine ok(has_interface((IUnknown*)capturePin, &IID_IAMStreamControl), "IAMStreamControl should exist on the preview pin\n"); - ok(!has_interface((IUnknown*)previewPin, &IID_IPropertyBag), "IPropertyBag shouldn't exist on the preview pin\n"); - todo_wine ok(has_interface((IUnknown*)previewPin, &IID_IQualityControl), "IQualityControl should exist on the preview pin\n"); - hr = IPin_QueryInterface(inputPin, &IID_IMemInputPin, (void**)&memInputPin); ok(SUCCEEDED(hr), "couldn't get mem input pin, hr=0x%08x\n", hr); if (FAILED(hr))