Module: wine
Branch: master
Commit: 9e8eb72210e7245718e5e15d3ed19d0696e9bcfe
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9e8eb72210e7245718e5e15d3…
Author: Anton Baskanov <baskanov(a)gmail.com>
Date: Wed Oct 28 23:02:54 2015 +0600
quartz/tests: Test that MPEG-1 Stream Splitter implements IAMStreamSelect.
Signed-off-by: Anton Baskanov <baskanov(a)gmail.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/quartz/tests/Makefile.in | 1 +
dlls/quartz/tests/mpegsplit.c | 58 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+)
diff --git a/dlls/quartz/tests/Makefile.in b/dlls/quartz/tests/Makefile.in
index 05bfda9..572b729 100644
--- a/dlls/quartz/tests/Makefile.in
+++ b/dlls/quartz/tests/Makefile.in
@@ -8,6 +8,7 @@ C_SRCS = \
filtermapper.c \
memallocator.c \
misc.c \
+ mpegsplit.c \
referenceclock.c \
videorenderer.c
diff --git a/dlls/quartz/tests/mpegsplit.c b/dlls/quartz/tests/mpegsplit.c
new file mode 100644
index 0000000..591e527
--- /dev/null
+++ b/dlls/quartz/tests/mpegsplit.c
@@ -0,0 +1,58 @@
+/*
+ * Unit tests for the MPEG-1 stream splitter functions
+ *
+ * Copyright 2015 Anton Baskanov
+ *
+ * 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 "wine/test.h"
+#include "dshow.h"
+
+static IUnknown *create_mpeg_splitter(void)
+{
+ IUnknown *mpeg_splitter = NULL;
+ HRESULT result = CoCreateInstance(&CLSID_MPEG1Splitter, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IUnknown, (void **)&mpeg_splitter);
+ ok(S_OK == result, "got 0x%08x\n", result);
+ return mpeg_splitter;
+}
+
+static void test_query_interface(void)
+{
+ IUnknown *mpeg_splitter = create_mpeg_splitter();
+
+ IAMStreamSelect *stream_select = NULL;
+ HRESULT result = IUnknown_QueryInterface(
+ mpeg_splitter, &IID_IAMStreamSelect, (void **)&stream_select);
+ ok(S_OK == result, "got 0x%08x\n", result);
+ if (S_OK == result)
+ {
+ IAMStreamSelect_Release(stream_select);
+ }
+
+ IUnknown_Release(mpeg_splitter);
+}
+
+START_TEST(mpegsplit)
+{
+ CoInitialize(NULL);
+
+ test_query_interface();
+
+ CoUninitialize();
+}