comctl32: A couple fixes for tab icon offsets.
[wine] / dlls / msi / tests / msi.c
1 /*
2  * tests for Microsoft Installer functionality
3  *
4  * Copyright 2005 Mike McCormack for CodeWeavers
5  *
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.
10  *
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.
15  *
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include <stdio.h>
22 #include <windows.h>
23 #include <msi.h>
24 #include <msiquery.h>
25
26 #include "wine/test.h"
27
28 typedef INSTALLSTATE (WINAPI *fnMsiUseFeatureExA)(LPCSTR, LPCSTR ,DWORD, DWORD );
29 fnMsiUseFeatureExA pMsiUseFeatureExA;
30
31 static void test_usefeature(void)
32 {
33     UINT r;
34
35     if (!pMsiUseFeatureExA)
36         return;
37
38     r = MsiQueryFeatureState(NULL,NULL);
39     ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
40
41     r = MsiQueryFeatureState("{9085040-6000-11d3-8cfe-0150048383c9}" ,NULL);
42     ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
43
44     r = MsiUseFeatureExA(NULL,NULL,0,0);
45     ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
46
47     r = MsiUseFeatureExA(NULL, 
48                          "WORDVIEWFiles", -2, 1 );
49     ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
50
51     r = MsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}", 
52                          NULL, -2, 0 );
53     ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
54
55     r = MsiUseFeatureExA("{9085040-6000-11d3-8cfe-0150048383c9}", 
56                          "WORDVIEWFiles", -2, 0 );
57     ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
58
59     r = MsiUseFeatureExA("{0085040-6000-11d3-8cfe-0150048383c9}", 
60                          "WORDVIEWFiles", -2, 0 );
61     ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
62
63     r = MsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}", 
64                          "WORDVIEWFiles", -2, 1 );
65     ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
66
67 }
68
69 START_TEST(msi)
70 {
71     HMODULE hmod = GetModuleHandle("msi.dll");
72     pMsiUseFeatureExA = (fnMsiUseFeatureExA) 
73         GetProcAddress(hmod, "MsiUseFeatureExA");
74
75     test_usefeature();
76 }