2 * Unit test suite for Background Copy Job Interface
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
25 #include "wine/test.h"
28 /* Globals used by many tests */
29 static const WCHAR test_displayName
[] = {'T', 'e', 's', 't', 0};
30 static IBackgroundCopyManager
*test_manager
;
31 static IBackgroundCopyJob
*test_job
;
32 static GUID test_jobId
;
33 static BG_JOB_TYPE test_type
;
35 /* Generic test setup */
36 static BOOL
setup(void)
42 memset(&test_jobId
, 0, sizeof test_jobId
);
43 test_type
= BG_JOB_TYPE_DOWNLOAD
;
45 hres
= CoCreateInstance(&CLSID_BackgroundCopyManager
, NULL
,
47 &IID_IBackgroundCopyManager
,
48 (void **) &test_manager
);
52 hres
= IBackgroundCopyManager_CreateJob(test_manager
, test_displayName
,
53 test_type
, &test_jobId
, &test_job
);
56 IBackgroundCopyManager_Release(test_manager
);
63 /* Generic test cleanup */
64 static void teardown(void)
66 IBackgroundCopyJob_Release(test_job
);
67 IBackgroundCopyManager_Release(test_manager
);
70 /* Test that the jobId is properly set */
71 static void test_GetId(void)
76 hres
= IBackgroundCopyJob_GetId(test_job
, &tmpId
);
77 ok(hres
== S_OK
, "GetId failed: %08x\n", hres
);
80 skip("Unable to get ID of test_job.\n");
83 ok(memcmp(&tmpId
, &test_jobId
, sizeof tmpId
) == 0, "Got incorrect GUID\n");
86 typedef void (*test_t
)(void);
90 static const test_t tests
[] = {
97 for (test
= tests
; *test
; ++test
)
99 /* Keep state seperate between tests. */
102 skip("Unable to setup test\n");