bits: Test CoCreateInstance of a BackgroundCopyManager (20/26)

Roy Shea roy at cs.hmc.edu
Mon Nov 19 18:23:19 CST 2007


This patch addes a basic test creating a BITS object.  This test uses a good
deal of infrastructure including svchost and qmgrprxy.  Running the tests
requires first registering ole32, qmgr, and qmgrprxy with regsvr32.
---
 dlls/qmgr/tests/Makefile.in |   17 +++++++++++++++
 dlls/qmgr/tests/qmgr.c      |   48 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100644 dlls/qmgr/tests/Makefile.in
 create mode 100644 dlls/qmgr/tests/qmgr.c

diff --git a/dlls/qmgr/tests/Makefile.in b/dlls/qmgr/tests/Makefile.in
new file mode 100644
index 0000000..cbb0401
--- /dev/null
+++ b/dlls/qmgr/tests/Makefile.in
@@ -0,0 +1,17 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+TESTDLL   = qmgr.dll
+IMPORTS   = ole32 kernel32
+MODCFLAGS = @BUILTINFLAG@
+EXTRAINCL = -I$(SRCDIR)/..
+
+CTESTS = \
+	qmgr.c
+
+IDL_I_SRCS = ../qmgr_local.idl
+
+ at MAKE_TEST_RULES@
+
+ at DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/dlls/qmgr/tests/qmgr.c b/dlls/qmgr/tests/qmgr.c
new file mode 100644
index 0000000..e60fab9
--- /dev/null
+++ b/dlls/qmgr/tests/qmgr.c
@@ -0,0 +1,48 @@
+/*
+ * Unit test suite for bits functions
+ *
+ * Copyright 2007 Google (Roy Shea)
+ *
+ * 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
+ */
+
+#include <stdio.h>
+
+#include "wine/test.h"
+#include "bits.h"
+
+static void test_CreateInstance(void)
+{
+    HRESULT hres;
+    IBackgroundCopyManager* manager = NULL;
+
+    hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL,
+            CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager,
+            (void **) &manager);
+    ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
+    if(hres != S_OK)
+    {
+        skip("Unable to create bits instance.\n");
+        return;
+    }
+
+}
+
+START_TEST(qmgr)
+{
+    CoInitialize(NULL);
+    test_CreateInstance();
+    CoUninitialize();
+}
-- 
1.5.3.1




More information about the wine-patches mailing list