Michael Stefaniuc : avifil32/tests: Add some basic COM tests for AVIEditStream.

Alexandre Julliard julliard at winehq.org
Fri Jul 15 09:07:06 CDT 2016


Module: wine
Branch: master
Commit: 06744904dddce9a9875aaeb91a04448481631a4b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=06744904dddce9a9875aaeb91a04448481631a4b

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Thu Jul 14 10:25:00 2016 +0200

avifil32/tests: Add some basic COM tests for AVIEditStream.

Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/avifil32/tests/api.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/dlls/avifil32/tests/api.c b/dlls/avifil32/tests/api.c
index 137062ad8..b3d822d 100644
--- a/dlls/avifil32/tests/api.c
+++ b/dlls/avifil32/tests/api.c
@@ -705,6 +705,35 @@ static void test_COM_wavfile(void)
     while (IAVIFile_Release(avif));
 }
 
+static void test_COM_editstream(void)
+{
+    IAVIEditStream *edit;
+    IAVIStream *stream;
+    IUnknown *unk;
+    ULONG refcount;
+    HRESULT hr;
+
+    /* Same refcount for all AVIEditStream interfaces */
+    hr = CreateEditableStream(&stream, NULL);
+    ok(hr == S_OK, "AVIEditStream create failed: %08x, expected S_OK\n", hr);
+    refcount = IAVIStream_AddRef(stream);
+    ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
+
+    hr = IAVIStream_QueryInterface(stream, &IID_IAVIEditStream, (void**)&edit);
+    ok(hr == S_OK, "QueryInterface for IID_IAVIEditStream failed: %08x\n", hr);
+    refcount = IAVIEditStream_AddRef(edit);
+    ok(refcount == 4, "refcount == %u, expected 4\n", refcount);
+    refcount = IAVIEditStream_Release(edit);
+
+    hr = IAVIEditStream_QueryInterface(edit, &IID_IUnknown, (void**)&unk);
+    ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
+    refcount = IUnknown_AddRef(unk);
+    ok(refcount == 5, "refcount == %u, expected 5\n", refcount);
+    IUnknown_Release(unk);
+
+    while (IAVIEditStream_Release(edit));
+}
+
 START_TEST(api)
 {
 
@@ -717,6 +746,7 @@ START_TEST(api)
     test_ash1_corruption2();
     test_COM();
     test_COM_wavfile();
+    test_COM_editstream();
     AVIFileExit();
 
 }




More information about the wine-cvs mailing list