bits: Added framework for testing the BackgroundCopyJob interface (25/27)

Roy Shea roy at cs.hmc.edu
Fri Nov 16 18:21:14 CST 2007


---
 dlls/qmgr/tests/Makefile.in |    3 +-
 dlls/qmgr/tests/job.c       |   73 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 1 deletions(-)
 create mode 100644 dlls/qmgr/tests/job.c

diff --git a/dlls/qmgr/tests/Makefile.in b/dlls/qmgr/tests/Makefile.in
index 4c15af7..dccea8c 100644
--- a/dlls/qmgr/tests/Makefile.in
+++ b/dlls/qmgr/tests/Makefile.in
@@ -8,7 +8,8 @@ MODCFLAGS = @BUILTINFLAG@
 EXTRAINCL = -I$(SRCDIR)/..
 
 CTESTS = \
-	qmgr.c
+	qmgr.c \
+	job.c
 
 IDL_I_SRCS = ../qmgr_local.idl
 
diff --git a/dlls/qmgr/tests/job.c b/dlls/qmgr/tests/job.c
new file mode 100644
index 0000000..29f043c
--- /dev/null
+++ b/dlls/qmgr/tests/job.c
@@ -0,0 +1,73 @@
+/*
+ * Unit test suite for Background Copy Job Interface
+ *
+ * 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>
+
+#define COBJMACROS
+
+#include "wine/test.h"
+#include "bits.h"
+
+/* Globals used by many tests */
+static const WCHAR test_displayName[] = {'T', 'e', 's', 't', 0};
+static IBackgroundCopyManager* test_manager;
+static IBackgroundCopyJob* test_job;
+static GUID test_jobId;
+
+/* Generic test setup */
+static BOOL setup(void)
+{
+    HRESULT hres;
+
+    test_manager = NULL;
+    test_job = NULL;
+    memset(&test_jobId, 0, sizeof(GUID));
+
+    hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL,
+            CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager,
+            (void **) &test_manager);
+    if(hres != S_OK)
+    {
+        return FALSE;
+    }
+    hres = IBackgroundCopyManager_CreateJob(test_manager, test_displayName,
+            BG_JOB_TYPE_DOWNLOAD, &test_jobId, &test_job);
+    if(hres != S_OK)
+    {
+        IBackgroundCopyManager_Release(test_job);
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
+/* Generic test cleanup */
+static void teardown(void)
+{
+    IBackgroundCopyManager_Release(test_job);
+}
+
+START_TEST(job)
+{
+    CoInitialize(NULL);
+    CoUninitialize();
+}
+
+
-- 
1.5.3.1




More information about the wine-patches mailing list