ReactOS  0.4.15-dev-489-g75a0787
name.c
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Hans Leidekker for CodeWeavers
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18 
19 #include <stdio.h>
20 
21 #define COBJMACROS
22 
23 #include <windows.h>
24 #include <winsxs.h>
25 #include <corerror.h>
26 
27 #include "wine/test.h"
28 
29 static const WCHAR wine1W[] =
30  {'w','i','n','e',0};
31 static const WCHAR wine2W[] =
32  {'w','i','n','e',',','v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',0};
33 static const WCHAR wine3W[] =
34  {'w','i','n','e',',','v','e','r','s','i','o','n','=','1','.','2','.','3','.','4',0};
35 static const WCHAR wine4W[] =
36  {'w','i','n','e',',',' ','v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',0};
37 static const WCHAR wine5W[] =
38  {'w','i','n','e',',','v','e','r','s','i','o','n',' ','=','\"','1','.','2','.','3','.','4','\"',0};
39 static const WCHAR wine6W[] =
40  {'w','i','n','e',',','v','e','r','s','i','o','n','=',' ','\"','1','.','2','.','3','.','4','\"',0};
41 static const WCHAR wine7W[] =
42  {'w','i','n','e',' ',',','v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',0};
43 static const WCHAR wine8W[] =
44  {'w','i','n','e',',','v','e','r','s','i','o','n',0};
45 static const WCHAR wine9W[] =
46  {'w','i','n','e',',','t','y','p','e','=','\"','\"',0};
47 static const WCHAR wine10W[] =
48  {'w','i','n','e',',','t','y','p','e','=','\"','w','i','n','3','2',0};
49 
50 static void test_CreateAssemblyNameObject( void )
51 {
52  static const WCHAR emptyW[] = {0};
54  HRESULT hr;
55 
57  ok(hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr);
58 
59  name = (IAssemblyName *)0xdeadbeef;
61  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
62  ok( !name, "expected NULL got %p\n", name );
63 
64  name = (IAssemblyName *)0xdeadbeef;
66  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
67  ok( !name, "expected NULL got %p\n", name );
68 
69  name = (IAssemblyName *)0xdeadbeef;
71  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
72  ok( !name, "expected NULL got %p\n", name );
73 
74  name = (IAssemblyName *)0xdeadbeef;
76  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
77  ok( !name, "expected NULL got %p\n", name );
78 
79  name = NULL;
81  ok( hr == S_OK, "expected S_OK got %08x\n", hr );
82  ok( name != NULL, "expected non-NULL name\n" );
83  IAssemblyName_Release( name );
84 
86  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
87 
88  name = (IAssemblyName *)0xdeadbeef;
90  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
91  ok( !name, "expected NULL got %p\n", name );
92 
93  name = (IAssemblyName *)0xdeadbeef;
95  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
96  ok( !name, "expected NULL got %p\n", name );
97 
98  name = (IAssemblyName *)0xdeadbeef;
100  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
101  ok( !name, "expected NULL got %p\n", name );
102 
103  name = (IAssemblyName *)0xdeadbeef;
105  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
106  ok( !name, "expected NULL got %p\n", name );
107 
108  name = (IAssemblyName *)0xdeadbeef;
110  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
111  ok( !name, "expected NULL got %p\n", name );
112 
114  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
115 
116  name = (IAssemblyName *)0xdeadbeef;
118  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
119  ok( !name, "expected NULL got %p\n", name );
120 
121  name = (IAssemblyName *)0xdeadbeef;
123  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
124  ok( !name, "expected NULL got %p\n", name );
125 
126  name = (IAssemblyName *)0xdeadbeef;
128  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
129  ok( !name, "expected NULL got %p\n", name );
130 
131  name = (IAssemblyName *)0xdeadbeef;
133  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
134  ok( !name, "expected NULL got %p\n", name );
135 
136  name = (IAssemblyName *)0xdeadbeef;
138  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
139 
141  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
142 
143  name = (IAssemblyName *)0xdeadbeef;
145  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
146  ok( !name, "expected NULL got %p\n", name );
147 
148  name = (IAssemblyName *)0xdeadbeef;
150  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
151  ok( !name, "expected NULL got %p\n", name );
152 
153  name = (IAssemblyName *)0xdeadbeef;
155  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
156  ok( !name, "expected NULL got %p\n", name );
157 
158  name = (IAssemblyName *)0xdeadbeef;
160  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
161  ok( !name, "expected NULL got %p\n", name );
162 
163  name = (IAssemblyName *)0xdeadbeef;
165  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
166  ok( !name, "expected NULL got %p\n", name );
167 
168  name = NULL;
170  ok( hr == S_OK, "expected S_OK got %08x\n", hr );
171  ok( name != NULL, "expected non-NULL name\n" );
172  IAssemblyName_Release( name );
173 
174  name = (IAssemblyName *)0xdeadbeef;
176  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
177  ok( !name, "expected NULL got %p\n", name );
178 
179  name = (IAssemblyName *)0xdeadbeef;
182  "expected ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME got %08x\n", hr );
183  ok( !name, "expected NULL got %p\n", name );
184 
185  name = (IAssemblyName *)0xdeadbeef;
188  "expected ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME got %08x\n", hr );
189  ok( !name, "expected NULL got %p\n", name );
190 
191  name = (IAssemblyName *)0xdeadbeef;
193  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
194  ok( !name, "expected NULL got %p\n", name );
195 
196  name = NULL;
198  ok( hr == S_OK, "expected S_OK got %08x\n", hr );
199  ok( name != NULL, "expected non-NULL name\n" );
200  IAssemblyName_Release( name );
201 
202  name = (IAssemblyName *)0xdeadbeef;
204  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
205  ok( !name, "expected NULL got %p\n", name );
206 
207  name = NULL;
209  ok( hr == S_OK, "expected S_OK got %08x\n", hr );
210  ok( name != NULL, "expected non-NULL name\n" );
211  IAssemblyName_Release( name );
212 
213  name = (IAssemblyName *)0xdeadbeef;
215  ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr );
216  ok( !name, "expected NULL got %p\n", name );
217 }
218 
220 {
222 }
static const WCHAR wine8W[]
Definition: name.c:43
static const WCHAR wine6W[]
Definition: name.c:39
static const WCHAR wine1W[]
Definition: name.c:29
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
static const WCHAR wine5W[]
Definition: name.c:37
HRESULT hr
Definition: shlfolder.c:183
#define ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME
Definition: winerror.h:2221
HRESULT WINAPI CreateAssemblyNameObject(LPASSEMBLYNAME *obj, LPCWSTR assembly, DWORD flags, LPVOID reserved)
Definition: name.c:368
LPCSTR name
Definition: name.c:34
#define E_INVALIDARG
Definition: ddrawi.h:101
static const WCHAR wine4W[]
Definition: name.c:35
smooth NULL
Definition: ftsmooth.c:416
START_TEST(name)
Definition: name.c:225
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
static const WCHAR wine7W[]
Definition: name.c:41
static const WCHAR wine9W[]
Definition: name.c:45
static const WCHAR wine2W[]
Definition: name.c:31
#define S_OK
Definition: intsafe.h:59
static const WCHAR emptyW[]
Definition: navigate.c:40
#define ok(value,...)
Definition: atltest.h:57
static const WCHAR wine3W[]
Definition: name.c:33
static const WCHAR wine10W[]
Definition: name.c:47
Definition: name.c:38
static void test_CreateAssemblyNameObject(void)
Definition: name.c:50