Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/dlls/browseui/tests/progressdlg.c
5968 views
1
/* Unit tests for progressdialog object
2
*
3
* Copyright 2012 Detlef Riekenberg
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18
*/
19
20
#define COBJMACROS
21
22
#include <stdarg.h>
23
#include <shlobj.h>
24
25
#include "wine/test.h"
26
27
28
static void test_IProgressDialog_QueryInterface(void)
29
{
30
IProgressDialog *dlg;
31
IProgressDialog *dlg2;
32
IOleWindow *olewindow;
33
IUnknown *unk;
34
HRESULT hr;
35
36
hr = CoCreateInstance(&CLSID_ProgressDialog, NULL, CLSCTX_INPROC_SERVER, &IID_IProgressDialog, (void **)&dlg);
37
if (FAILED(hr))
38
{
39
win_skip("ProgressDialog is not supported, hr %#lx.\n", hr);
40
return;
41
}
42
43
hr = IProgressDialog_QueryInterface(dlg, &IID_IUnknown, NULL);
44
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
45
46
hr = IProgressDialog_QueryInterface(dlg, &IID_IUnknown, (void**)&unk);
47
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
48
if (SUCCEEDED(hr)) {
49
IUnknown_Release(unk);
50
}
51
52
hr = IProgressDialog_QueryInterface(dlg, &IID_IOleWindow, (void**)&olewindow);
53
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
54
if (SUCCEEDED(hr)) {
55
hr = IOleWindow_QueryInterface(olewindow, &IID_IProgressDialog, (void**)&dlg2);
56
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
57
if (SUCCEEDED(hr)) {
58
IProgressDialog_Release(dlg2);
59
}
60
IOleWindow_Release(olewindow);
61
}
62
IProgressDialog_Release(dlg);
63
}
64
65
66
START_TEST(progressdlg)
67
{
68
CoInitialize(NULL);
69
70
test_IProgressDialog_QueryInterface();
71
72
CoUninitialize();
73
}
74
75