dmusic: Assign to structs instead of using memcpy.
[wine.git] / dlls / qmgr / tests / qmgr.c
blobe36ff36a481b5c7989bbf8aa5e2a73c34b46d290
1 /*
2 * Unit test suite for bits functions
4 * Copyright 2007 Google (Roy Shea)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdio.h>
23 #define COBJMACROS
25 #include "wine/test.h"
26 #include "initguid.h"
27 #include "bits.h"
29 static void
30 test_CreateInstance(void)
32 HRESULT hres;
33 ULONG res;
34 IBackgroundCopyManager *manager = NULL;
36 /* Creating BITS instance */
37 hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL, CLSCTX_LOCAL_SERVER,
38 &IID_IBackgroundCopyManager, (void **) &manager);
39 ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
40 if(hres != S_OK) {
41 skip("Unable to create bits instance.\n");
42 return;
45 /* Releasing bits manager */
46 res = IBackgroundCopyManager_Release(manager);
47 ok(res == 0, "Bad ref count on release: %u\n", res);
51 static void test_CreateJob(void)
53 /* Job information */
54 static const WCHAR copyNameW[] = {'T', 'e', 's', 't', 0};
55 IBackgroundCopyJob* job = NULL;
56 GUID tmpId;
57 HRESULT hres;
58 ULONG res;
59 IBackgroundCopyManager* manager = NULL;
61 /* Setup */
62 hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL,
63 CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager,
64 (void **) &manager);
65 if(hres != S_OK)
67 skip("Unable to create bits instance required for test.\n");
68 return;
71 /* Create bits job */
72 hres = IBackgroundCopyManager_CreateJob(manager, copyNameW,
73 BG_JOB_TYPE_DOWNLOAD, &tmpId,
74 &job);
75 ok(hres == S_OK, "CreateJob failed: %08x\n", hres);
76 if(hres != S_OK)
77 skip("Unable to create bits job.\n");
78 else
80 res = IBackgroundCopyJob_Release(job);
81 ok(res == 0, "Bad ref count on release: %u\n", res);
84 IBackgroundCopyManager_Release(manager);
87 START_TEST(qmgr)
89 CoInitialize(NULL);
90 test_CreateInstance();
91 test_CreateJob();
92 CoUninitialize();