Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/tests/Makefile.in | 1 + dlls/qedit/tests/mediadet.c | 12 ----- dlls/qedit/tests/samplegrabber.c | 87 ++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 12 deletions(-) create mode 100644 dlls/qedit/tests/samplegrabber.c
diff --git a/dlls/qedit/tests/Makefile.in b/dlls/qedit/tests/Makefile.in index 07dd4b0bb7..052336d64d 100644 --- a/dlls/qedit/tests/Makefile.in +++ b/dlls/qedit/tests/Makefile.in @@ -3,6 +3,7 @@ IMPORTS = oleaut32 ole32
C_SRCS = \ mediadet.c \ + samplegrabber.c \ timeline.c
RC_SRCS = qedit.rc diff --git a/dlls/qedit/tests/mediadet.c b/dlls/qedit/tests/mediadet.c index 6bc20e574e..5c567e26d4 100644 --- a/dlls/qedit/tests/mediadet.c +++ b/dlls/qedit/tests/mediadet.c @@ -612,18 +612,6 @@ static void test_samplegrabber(void) IMemInputPin_Release(inpin); IPin_Release(pin);
- /* Interfaces that native does not support */ - hr = ISampleGrabber_QueryInterface(sg, &IID_IMediaPosition, (void**)&unk); - todo_wine ok(hr == E_NOINTERFACE, "QueryInterface for IID_IMediaPosition failed: %08x\n", hr); - hr = ISampleGrabber_QueryInterface(sg, &IID_IMediaSeeking, (void**)&unk); - todo_wine ok(hr == E_NOINTERFACE, "QueryInterface for IID_IMediaSeeking failed: %08x\n", hr); - hr = ISampleGrabber_QueryInterface(sg, &IID_IMemInputPin, (void**)&unk); - ok(hr == E_NOINTERFACE, "QueryInterface for IID_IMemInputPin failed: %08x\n", hr); - hr = ISampleGrabber_QueryInterface(sg, &IID_IQualityControl, (void**)&unk); - ok(hr == E_NOINTERFACE, "QueryInterface for IID_IQualityControl failed: %08x\n", hr); - hr = ISampleGrabber_QueryInterface(sg, &IID_ISeekingPassThru, (void**)&unk); - ok(hr == E_NOINTERFACE, "QueryInterface for IID_ISeekingPassThru failed: %08x\n", hr); - while (ISampleGrabber_Release(sg)); }
diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c new file mode 100644 index 0000000000..d6fa4051d5 --- /dev/null +++ b/dlls/qedit/tests/samplegrabber.c @@ -0,0 +1,87 @@ +/* + * Sample grabber filter unit tests + * + * Copyright 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS +#include "dshow.h" +#include "qedit.h" +#include "wine/test.h" + +static IBaseFilter *create_sample_grabber(void) +{ + IBaseFilter *filter = NULL; + HRESULT hr = CoCreateInstance(&CLSID_SampleGrabber, 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_sample_grabber(); + ULONG ref; + + check_interface(filter, &IID_IBaseFilter, TRUE); + check_interface(filter, &IID_IMediaFilter, TRUE); + check_interface(filter, &IID_IPersist, TRUE); + check_interface(filter, &IID_ISampleGrabber, 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); + todo_wine check_interface(filter, &IID_IMediaPosition, FALSE); + todo_wine check_interface(filter, &IID_IMediaSeeking, FALSE); + check_interface(filter, &IID_IMemInputPin, 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_ISeekingPassThru, FALSE); + check_interface(filter, &IID_IVideoWindow, FALSE); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got unexpected refcount %d.\n", ref); +} + +START_TEST(samplegrabber) +{ + CoInitialize(NULL); + + test_interfaces(); + + CoUninitialize(); +}
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/samplegrabber.c | 4 +--- dlls/qedit/tests/samplegrabber.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c index cd35740595..c5b18db893 100644 --- a/dlls/qedit/samplegrabber.c +++ b/dlls/qedit/samplegrabber.c @@ -296,8 +296,6 @@ static HRESULT WINAPI SampleGrabber_QueryInterface(IUnknown *iface, REFIID riid, *ppv = &This->filter.IBaseFilter_iface; else if (IsEqualIID(riid, &IID_ISampleGrabber)) *ppv = &This->ISampleGrabber_iface; - else if (IsEqualIID(riid, &IID_IMediaPosition)) - return IUnknown_QueryInterface(This->seekthru_unk, riid, ppv); else if (IsEqualIID(riid, &IID_IMediaSeeking)) return IUnknown_QueryInterface(This->seekthru_unk, riid, ppv); else @@ -832,7 +830,7 @@ SampleGrabber_IPin_QueryInterface(IPin *iface, REFIID riid, void **ppv) else if (IsEqualIID(riid, &IID_IMediaSeeking)) return IUnknown_QueryInterface(&This->sg->IUnknown_inner, riid, ppv); else if (IsEqualIID(riid, &IID_IMediaPosition)) - return IUnknown_QueryInterface(&This->sg->IUnknown_inner, riid, ppv); + return IUnknown_QueryInterface(This->sg->seekthru_unk, riid, ppv); else { WARN("(%p, %s,%p): not found\n", This, debugstr_guid(riid), ppv); return E_NOINTERFACE; diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c index d6fa4051d5..ee1950c537 100644 --- a/dlls/qedit/tests/samplegrabber.c +++ b/dlls/qedit/tests/samplegrabber.c @@ -62,7 +62,7 @@ static void test_interfaces(void) check_interface(filter, &IID_IBasicAudio, FALSE); check_interface(filter, &IID_IBasicVideo, FALSE); check_interface(filter, &IID_IKsPropertySet, FALSE); - todo_wine check_interface(filter, &IID_IMediaPosition, FALSE); + check_interface(filter, &IID_IMediaPosition, FALSE); todo_wine check_interface(filter, &IID_IMediaSeeking, FALSE); check_interface(filter, &IID_IMemInputPin, FALSE); check_interface(filter, &IID_IPersistPropertyBag, FALSE);
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=50932
Your paranoid android.
=== w2008s64 (32 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 01a8:samplegrabber: unhandled exception c0000005 at 004036F2
=== w2008s64 (64 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 0460:samplegrabber: unhandled exception c0000005 at 0000000000403180
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/samplegrabber.c | 4 +--- dlls/qedit/tests/samplegrabber.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c index c5b18db893..c788fb20fb 100644 --- a/dlls/qedit/samplegrabber.c +++ b/dlls/qedit/samplegrabber.c @@ -296,8 +296,6 @@ static HRESULT WINAPI SampleGrabber_QueryInterface(IUnknown *iface, REFIID riid, *ppv = &This->filter.IBaseFilter_iface; else if (IsEqualIID(riid, &IID_ISampleGrabber)) *ppv = &This->ISampleGrabber_iface; - else if (IsEqualIID(riid, &IID_IMediaSeeking)) - return IUnknown_QueryInterface(This->seekthru_unk, riid, ppv); else WARN("(%p, %s,%p): not found\n", This, debugstr_guid(riid), ppv);
@@ -828,7 +826,7 @@ SampleGrabber_IPin_QueryInterface(IPin *iface, REFIID riid, void **ppv) else if (IsEqualIID(riid, &IID_IMemInputPin)) *ppv = &This->sg->IMemInputPin_iface; else if (IsEqualIID(riid, &IID_IMediaSeeking)) - return IUnknown_QueryInterface(&This->sg->IUnknown_inner, riid, ppv); + return IUnknown_QueryInterface(This->sg->seekthru_unk, riid, ppv); else if (IsEqualIID(riid, &IID_IMediaPosition)) return IUnknown_QueryInterface(This->sg->seekthru_unk, riid, ppv); else { diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c index ee1950c537..3611f53883 100644 --- a/dlls/qedit/tests/samplegrabber.c +++ b/dlls/qedit/tests/samplegrabber.c @@ -63,7 +63,7 @@ static void test_interfaces(void) check_interface(filter, &IID_IBasicVideo, FALSE); check_interface(filter, &IID_IKsPropertySet, FALSE); check_interface(filter, &IID_IMediaPosition, FALSE); - todo_wine check_interface(filter, &IID_IMediaSeeking, FALSE); + check_interface(filter, &IID_IMediaSeeking, FALSE); check_interface(filter, &IID_IMemInputPin, FALSE); check_interface(filter, &IID_IPersistPropertyBag, FALSE); check_interface(filter, &IID_IPin, FALSE);
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=50933
Your paranoid android.
=== w2008s64 (32 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 01a8:samplegrabber: unhandled exception c0000005 at 004036F2
=== w2008s64 (64 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 052c:samplegrabber: unhandled exception c0000005 at 0000000000403180
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/tests/mediadet.c | 27 --------------------------- dlls/qedit/tests/samplegrabber.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 27 deletions(-)
diff --git a/dlls/qedit/tests/mediadet.c b/dlls/qedit/tests/mediadet.c index 5c567e26d4..fd6004ecdb 100644 --- a/dlls/qedit/tests/mediadet.c +++ b/dlls/qedit/tests/mediadet.c @@ -526,9 +526,6 @@ static void test_samplegrabber(void) struct unk_impl unk_obj = {{&unk_vtbl}, 19, NULL}; ISampleGrabber *sg; IBaseFilter *bf; - IMediaFilter *mf; - IPersist *persist; - IUnknown *unk; IPin *pin; IMemInputPin *inpin; IEnumPins *pins; @@ -556,36 +553,12 @@ static void test_samplegrabber(void) (void**)&sg); ok(hr == E_NOINTERFACE, "SampleGrabber create failed: %08x, expected E_NOINTERFACE\n", hr);
- /* Same refcount for all SampleGrabber interfaces */ hr = CoCreateInstance(&CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, &IID_ISampleGrabber, (void**)&sg); ok(hr == S_OK, "SampleGrabber create failed: %08x, expected S_OK\n", hr); - refcount = ISampleGrabber_AddRef(sg); - ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
hr = ISampleGrabber_QueryInterface(sg, &IID_IBaseFilter, (void**)&bf); ok(hr == S_OK, "QueryInterface for IID_IBaseFilter failed: %08x\n", hr); - refcount = IBaseFilter_AddRef(bf); - ok(refcount == 4, "refcount == %u, expected 4\n", refcount); - refcount = IBaseFilter_Release(bf); - - hr = ISampleGrabber_QueryInterface(sg, &IID_IMediaFilter, (void**)&mf); - ok(hr == S_OK, "QueryInterface for IID_IMediaFilter failed: %08x\n", hr); - refcount = IMediaFilter_AddRef(mf); - ok(refcount == 5, "refcount == %u, expected 5\n", refcount); - refcount = IMediaFilter_Release(mf); - - hr = ISampleGrabber_QueryInterface(sg, &IID_IPersist, (void**)&persist); - ok(hr == S_OK, "QueryInterface for IID_IPersist failed: %08x\n", hr); - refcount = IPersist_AddRef(persist); - ok(refcount == 6, "refcount == %u, expected 6\n", refcount); - refcount = IPersist_Release(persist); - - hr = ISampleGrabber_QueryInterface(sg, &IID_IUnknown, (void**)&unk); - ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr); - refcount = IUnknown_AddRef(unk); - ok(refcount == 7, "refcount == %u, expected 7\n", refcount); - refcount = IUnknown_Release(unk);
hr = ISampleGrabber_SetCallback(sg, &my_sg_cb, 0); ok(hr == S_OK, "SetCallback failed: %08x\n", hr); diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c index 3611f53883..ed774c4141 100644 --- a/dlls/qedit/tests/samplegrabber.c +++ b/dlls/qedit/tests/samplegrabber.c @@ -32,19 +32,35 @@ static IBaseFilter *create_sample_grabber(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) { IUnknown *iface = iface_ptr; HRESULT hr, expected_hr; + ULONG ref, expect_ref; IUnknown *unk;
expected_hr = supported ? S_OK : E_NOINTERFACE;
+ expect_ref = get_refcount(iface); + 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)) + { + ref = get_refcount(iface); + ok_(__FILE__, line)(ref == expect_ref + 1, "Expected %u references, got %u.\n", expect_ref + 1, ref); + ref = get_refcount(unk); + ok_(__FILE__, line)(ref == expect_ref + 1, "Expected %u references, got %u.\n", expect_ref + 1, ref); IUnknown_Release(unk); + } }
static void test_interfaces(void)
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=50934
Your paranoid android.
=== w2008s64 (32 bit report) ===
qedit: mediadet.c:148: Test failed: CoCreateInstance failed: 80040154 01a8:mediadet: unhandled exception c0000005 at 00401A8C
=== w2008s64 (64 bit report) ===
qedit: mediadet.c:148: Test failed: CoCreateInstance failed: 80040154 052c:mediadet: unhandled exception c0000005 at 0000000000401A83
=== w2008s64 (32 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 01a8:samplegrabber: unhandled exception c0000005 at 00403471
=== w2008s64 (64 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 0460:samplegrabber: unhandled exception c0000005 at 0000000000402F2A
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/tests/samplegrabber.c | 122 +++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+)
diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c index ed774c4141..b171932174 100644 --- a/dlls/qedit/tests/samplegrabber.c +++ b/dlls/qedit/tests/samplegrabber.c @@ -93,11 +93,133 @@ static void test_interfaces(void) ok(!ref, "Got unexpected refcount %d.\n", ref); }
+static void test_enum_pins(void) +{ + IBaseFilter *filter = create_sample_grabber(); + IEnumPins *enum1, *enum2; + ULONG count, ref; + IPin *pins[3]; + 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_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_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, "Got count %u.\n", count); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 3, pins, &count); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + ok(count == 2, "Got count %u.\n", count); + IPin_Release(pins[0]); + IPin_Release(pins[1]); + + 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, 3); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Skip(enum1, 2); + 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); +} + START_TEST(samplegrabber) { CoInitialize(NULL);
test_interfaces(); + test_enum_pins();
CoUninitialize(); }
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=50935
Your paranoid android.
=== w2008s64 (32 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 052c:samplegrabber: unhandled exception c0000005 at 00403471
=== w2008s64 (64 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 0460:samplegrabber: unhandled exception c0000005 at 0000000000402F2A
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/tests/samplegrabber.c | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c index b171932174..094ef317c0 100644 --- a/dlls/qedit/tests/samplegrabber.c +++ b/dlls/qedit/tests/samplegrabber.c @@ -23,6 +23,11 @@ #include "qedit.h" #include "wine/test.h"
+static const WCHAR sink_id[] = {'I','n',0}; +static const WCHAR source_id[] = {'O','u','t',0}; +static const WCHAR sink_name[] = {'I','n','p','u','t',0}; +static const WCHAR source_name[] = {'O','u','t','p','u','t',0}; + static IBaseFilter *create_sample_grabber(void) { IBaseFilter *filter = NULL; @@ -214,12 +219,50 @@ static void test_enum_pins(void) ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_find_pin(void) +{ + IBaseFilter *filter = create_sample_grabber(); + IEnumPins *enum_pins; + IPin *pin, *pin2; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_FindPin(filter, sink_name, &pin); + ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr); + hr = IBaseFilter_FindPin(filter, source_name, &pin); + ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr); + + 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, source_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); +} + START_TEST(samplegrabber) { CoInitialize(NULL);
test_interfaces(); test_enum_pins(); + test_find_pin();
CoUninitialize(); }
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=50936
Your paranoid android.
=== w2008s64 (32 bit report) ===
qedit: samplegrabber.c:36: Test failed: Got hr 0x80040154. 052c:samplegrabber: unhandled exception c0000005 at 00403471
=== w2008s64 (64 bit report) ===
qedit: samplegrabber.c:36: Test failed: Got hr 0x80040154. 0460:samplegrabber: unhandled exception c0000005 at 0000000000402F2A
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/tests/samplegrabber.c | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+)
diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c index 094ef317c0..5e4ee6e75b 100644 --- a/dlls/qedit/tests/samplegrabber.c +++ b/dlls/qedit/tests/samplegrabber.c @@ -256,6 +256,69 @@ static void test_find_pin(void) ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_pin_info(void) +{ + IBaseFilter *filter = create_sample_grabber(); + 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); + + 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); + todo_wine ok(!lstrcmpW(info.achName, sink_name), "Got name %s.\n", wine_dbgstr_w(info.achName)); + 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); + todo_wine ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr); + + IPin_Release(pin); + + hr = IBaseFilter_FindPin(filter, source_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); + todo_wine ok(!lstrcmpW(info.achName, source_name), "Got name %s.\n", wine_dbgstr_w(info.achName)); + 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, source_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); +} + START_TEST(samplegrabber) { CoInitialize(NULL); @@ -263,6 +326,7 @@ START_TEST(samplegrabber) test_interfaces(); test_enum_pins(); test_find_pin(); + test_pin_info();
CoUninitialize(); }
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=50937
Your paranoid android.
=== w2008s64 (32 bit report) ===
qedit: samplegrabber.c:36: Test failed: Got hr 0x80040154. 052c:samplegrabber: unhandled exception c0000005 at 00403471
=== w2008s64 (64 bit report) ===
qedit: samplegrabber.c:36: Test failed: Got hr 0x80040154. 052c:samplegrabber: unhandled exception c0000005 at 0000000000402F2A
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=50931
Your paranoid android.
=== w2008s64 (32 bit report) ===
qedit: mediadet.c:148: Test failed: CoCreateInstance failed: 80040154 0bc0:mediadet: unhandled exception c0000005 at 00401A8F
=== w2008s64 (64 bit report) ===
qedit: mediadet.c:148: Test failed: CoCreateInstance failed: 80040154 052c:mediadet: unhandled exception c0000005 at 0000000000401A89
=== w2008s64 (32 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 01a8:samplegrabber: unhandled exception c0000005 at 004036F2
=== w2008s64 (64 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 0460:samplegrabber: unhandled exception c0000005 at 0000000000403180
On 4/14/19 1:08 AM, Marvin wrote:
=== w2008s64 (32 bit report) ===
qedit: mediadet.c:148: Test failed: CoCreateInstance failed: 80040154 0bc0:mediadet: unhandled exception c0000005 at 00401A8F
=== w2008s64 (64 bit report) ===
qedit: mediadet.c:148: Test failed: CoCreateInstance failed: 80040154 052c:mediadet: unhandled exception c0000005 at 0000000000401A89
=== w2008s64 (32 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 01a8:samplegrabber: unhandled exception c0000005 at 004036F2
=== w2008s64 (64 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 0460:samplegrabber: unhandled exception c0000005 at 0000000000403180
This is a little confusing. w2008s64 doesn't ship qedit, and winetest accordingly doesn't run it. Shouldn't the TestBot also skip it?
On Sun, 14 Apr 2019, Zebediah Figura wrote: [...]
=== w2008s64 (64 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 0460:samplegrabber: unhandled exception c0000005 at 0000000000403180
This is a little confusing. w2008s64 doesn't ship qedit, and winetest accordingly doesn't run it. Shouldn't the TestBot also skip it?
That's because WineTest uses the executable's filename to guess which dll is being tested and check whether it is present.
But that does not work for the TestBot since the user can upload executables with arbitrary names. So the TestBot's TestLauncher (which replaces WineTest.exe) grabs the list of dlls that the executable links with and checks whether they are present.
But qedit_test.exe does not link with qedit.dll since it's all COM. So all looks fine and TestLauncher runs the test.
On 4/15/19 11:30 PM, Francois Gouget wrote:
On Sun, 14 Apr 2019, Zebediah Figura wrote: [...]
=== w2008s64 (64 bit report) ===
qedit: samplegrabber.c:31: Test failed: Got hr 0x80040154. 0460:samplegrabber: unhandled exception c0000005 at 0000000000403180
This is a little confusing. w2008s64 doesn't ship qedit, and winetest accordingly doesn't run it. Shouldn't the TestBot also skip it?
That's because WineTest uses the executable's filename to guess which dll is being tested and check whether it is present.
But that does not work for the TestBot since the user can upload executables with arbitrary names. So the TestBot's TestLauncher (which replaces WineTest.exe) grabs the list of dlls that the executable links with and checks whether they are present.
But qedit_test.exe does not link with qedit.dll since it's all COM. So all looks fine and TestLauncher runs the test.
I see. What do you recommend as the solution to this problem?
On Mon, 15 Apr 2019, Zebediah Figura wrote: [...]
This is a little confusing. w2008s64 doesn't ship qedit, and winetest accordingly doesn't run it. Shouldn't the TestBot also skip it?
That's because WineTest uses the executable's filename to guess which dll is being tested and check whether it is present.
But that does not work for the TestBot since the user can upload executables with arbitrary names. So the TestBot's TestLauncher (which replaces WineTest.exe) grabs the list of dlls that the executable links with and checks whether they are present.
But qedit_test.exe does not link with qedit.dll since it's all COM. So all looks fine and TestLauncher runs the test.
I see. What do you recommend as the solution to this problem?
Here are some options:
1. Modify TestLauncher.exe to do things like WineTest.exe and if the filename looks like xxx_test.exe, refuse to run it if xxx.dll cannot be loaded. But then we run the risk of not being able to run my_test.exe.
2. Do the above only if TestLauncher is given a specific argument which would only be used for executables compiled by the TestBot from a patch, meaning when we know that xxx really is a dll name.
The problem with 1 and 2 is that we are going to run into the same problem as WineTest.exe, which is that it sometimes fails to run tests that it should have been running because it fails to load the tested dll.
Bug 43052 - WineTest does not run the vcomp tests https://bugs.winehq.org/show_bug.cgi?id=45032
Which was initially a TestLauncher issue: Bug 31609 - TestLauncher says a required DLL is missing, but the test runs fine without TestLauncher https://bugs.winehq.org/show_bug.cgi?id=31609#c6
3. Detect if the qedit functionality is present and win_skip() if not. I don't know the best way to check if the qedit functionality is present. Check a landmark QueryInterface() result? Manually check the registry? COM being quite widespread it feels like we should probably have a standard way of doing this type of check.
But I'm certainly not excluding other approaches.
On 4/16/19 11:17 PM, Francois Gouget wrote:
- Detect if the qedit functionality is present and win_skip() if not. I don't know the best way to check if the qedit functionality is present. Check a landmark QueryInterface() result? Manually check the registry? COM being quite widespread it feels like we should probably have a standard way of doing this type of check.
But I'm certainly not excluding other approaches.
Yeah, this case would probably be easiest; we can just bail on CO_E_CLASSNOTREG. I was just wondering if you had anything different in mind.
On 4/17/19 6:20 AM, Zebediah Figura wrote:
On 4/16/19 11:17 PM, Francois Gouget wrote:
- Detect if the qedit functionality is present and win_skip() if not.
I don't know the best way to check if the qedit functionality is present. Check a landmark QueryInterface() result? Manually check the registry? COM being quite widespread it feels like we should probably have a standard way of doing this type of check.
But I'm certainly not excluding other approaches.
Yeah, this case would probably be easiest; we can just bail on CO_E_CLASSNOTREG. I was just wondering if you had anything different in mind.
That's what is done in some of the DirectMusic dlls too. E.g missing_dmsynth() in dlls/dmsynth/tests/dmsynth.c .
bye michael