Christian Costa : dmsynth: Add basic tests.
Alexandre Julliard
julliard at winehq.org
Fri Apr 6 14:43:27 CDT 2012
Module: wine
Branch: master
Commit: d2d5d0e0d75b1b6b0ebc16aad410e120a8e99527
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d2d5d0e0d75b1b6b0ebc16aad410e120a8e99527
Author: Christian Costa <titan.costa at gmail.com>
Date: Fri Apr 6 13:39:02 2012 +0200
dmsynth: Add basic tests.
---
configure | 1 +
configure.ac | 1 +
dlls/dmsynth/tests/Makefile.in | 7 ++++
dlls/dmsynth/tests/dmsynth.c | 60 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 69 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
index f40e012..3e6e777 100755
--- a/configure
+++ b/configure
@@ -15024,6 +15024,7 @@ wine_fn_config_test dlls/dmloader/tests dmloader_test
wine_fn_config_dll dmscript enable_dmscript
wine_fn_config_dll dmstyle enable_dmstyle
wine_fn_config_dll dmsynth enable_dmsynth
+wine_fn_config_test dlls/dmsynth/tests dmsynth_test
wine_fn_config_dll dmusic enable_dmusic
wine_fn_config_test dlls/dmusic/tests dmusic_test
wine_fn_config_dll dmusic32 enable_dmusic32 implib
diff --git a/configure.ac b/configure.ac
index 7540676..667d725 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2530,6 +2530,7 @@ WINE_CONFIG_TEST(dlls/dmloader/tests)
WINE_CONFIG_DLL(dmscript)
WINE_CONFIG_DLL(dmstyle)
WINE_CONFIG_DLL(dmsynth)
+WINE_CONFIG_TEST(dlls/dmsynth/tests)
WINE_CONFIG_DLL(dmusic)
WINE_CONFIG_TEST(dlls/dmusic/tests)
WINE_CONFIG_DLL(dmusic32,,[implib])
diff --git a/dlls/dmsynth/tests/Makefile.in b/dlls/dmsynth/tests/Makefile.in
new file mode 100644
index 0000000..a319918
--- /dev/null
+++ b/dlls/dmsynth/tests/Makefile.in
@@ -0,0 +1,7 @@
+TESTDLL = dmsynth.dll
+IMPORTS = oleaut32 ole32 uuid
+
+C_SRCS = \
+ dmsynth.c
+
+ at MAKE_TEST_RULES@
diff --git a/dlls/dmsynth/tests/dmsynth.c b/dlls/dmsynth/tests/dmsynth.c
new file mode 100644
index 0000000..af2b7cb
--- /dev/null
+++ b/dlls/dmsynth/tests/dmsynth.c
@@ -0,0 +1,60 @@
+/*
+ * Unit tests for dmsynth functions
+ *
+ * Copyright (C) 2012 Christian Costa
+ *
+ * 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 <stdio.h>
+
+#include "wine/test.h"
+#include "uuids.h"
+#include "ole2.h"
+#include "initguid.h"
+#include "dmusics.h"
+#include "dmusici.h"
+
+static void test_dmsynth(void)
+{
+ IDirectMusicSynth *dmsynth = NULL;
+ IDirectMusicSynthSink *dmsynth_sink = NULL;
+ HRESULT hr;
+
+ hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth, (LPVOID*)&dmsynth);
+ if (hr != S_OK)
+ {
+ skip("Cannot create DirectMusicSync object (%x)\n", hr);
+ return;
+ }
+
+ hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynthSink, (LPVOID*)&dmsynth_sink);
+ todo_wine ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
+
+ if (dmsynth_sink)
+ IDirectMusicSynthSink_Release(dmsynth_sink);
+ IDirectMusicSynth_Release(dmsynth);
+}
+
+START_TEST(dmsynth)
+{
+ CoInitializeEx(NULL, COINIT_MULTITHREADED);
+
+ test_dmsynth();
+
+ CoUninitialize();
+}
More information about the wine-cvs
mailing list