mfplat: Read queue subscriber within the critical section.
[wine/zf.git] / dlls / shlwapi / tests / generated.c
blob8465bf3447565379a531ffbe1e5536abcf1ed696
1 /* File generated automatically from tools/winapi/tests.dat; do not edit! */
2 /* This file can be copied, modified and distributed without restriction. */
4 /*
5 * Unit tests for data structure packing
6 */
8 #define WINE_NOWINSOCK
10 #include <stdarg.h>
11 #include "windef.h"
12 #include "winbase.h"
13 #include "wtypes.h"
14 #include "winreg.h"
15 #include "shlwapi.h"
17 #include "wine/test.h"
19 /***********************************************************************
20 * Compatibility macros
23 #define DWORD_PTR UINT_PTR
24 #define LONG_PTR INT_PTR
25 #define ULONG_PTR UINT_PTR
27 /***********************************************************************
28 * Windows API extension
31 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
32 # define _TYPE_ALIGNMENT(type) __alignof(type)
33 #elif defined(__GNUC__) || defined(__clang__)
34 # define _TYPE_ALIGNMENT(type) __alignof__(type)
35 #else
37 * FIXME: May not be possible without a compiler extension
38 * (if type is not just a name that is, otherwise the normal
39 * TYPE_ALIGNMENT can be used)
41 #endif
43 #if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)
44 #pragma warning(disable:4116)
45 #endif
47 #if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
48 # define TYPE_ALIGNMENT _TYPE_ALIGNMENT
49 #endif
51 /***********************************************************************
52 * Test helper macros
55 #define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size);
57 #ifdef TYPE_ALIGNMENT
58 # define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align);
59 #else
60 # define TEST_TYPE_ALIGN(type, align)
61 #endif
63 #ifdef _TYPE_ALIGNMENT
64 # define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align);
65 # define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align);
66 #else
67 # define TEST_TARGET_ALIGN(type, align)
68 # define TEST_FIELD_ALIGN(type, field, align)
69 #endif
71 #define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset);
73 #define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size)
74 #define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size)
75 #define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0);
76 #define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0);
79 #ifdef _WIN64
81 static void test_pack_ASSOCF(void)
83 /* ASSOCF */
84 TEST_TYPE_SIZE (ASSOCF, 4)
85 TEST_TYPE_ALIGN (ASSOCF, 4)
86 TEST_TYPE_UNSIGNED(ASSOCF)
89 static void test_pack_DLLGETVERSIONPROC(void)
91 /* DLLGETVERSIONPROC */
92 TEST_TYPE_SIZE (DLLGETVERSIONPROC, 8)
93 TEST_TYPE_ALIGN (DLLGETVERSIONPROC, 8)
96 static void test_pack_DLLVERSIONINFO(void)
98 /* DLLVERSIONINFO (pack 8) */
99 TEST_TYPE_SIZE (DLLVERSIONINFO, 20)
100 TEST_TYPE_ALIGN (DLLVERSIONINFO, 4)
101 TEST_FIELD_SIZE (DLLVERSIONINFO, cbSize, 4)
102 TEST_FIELD_ALIGN (DLLVERSIONINFO, cbSize, 4)
103 TEST_FIELD_OFFSET(DLLVERSIONINFO, cbSize, 0)
104 TEST_FIELD_SIZE (DLLVERSIONINFO, dwMajorVersion, 4)
105 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwMajorVersion, 4)
106 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwMajorVersion, 4)
107 TEST_FIELD_SIZE (DLLVERSIONINFO, dwMinorVersion, 4)
108 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwMinorVersion, 4)
109 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwMinorVersion, 8)
110 TEST_FIELD_SIZE (DLLVERSIONINFO, dwBuildNumber, 4)
111 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwBuildNumber, 4)
112 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwBuildNumber, 12)
113 TEST_FIELD_SIZE (DLLVERSIONINFO, dwPlatformID, 4)
114 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwPlatformID, 4)
115 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwPlatformID, 16)
118 static void test_pack_DLLVERSIONINFO2(void)
120 /* DLLVERSIONINFO2 (pack 8) */
121 TEST_TYPE_SIZE (DLLVERSIONINFO2, 32)
122 TEST_TYPE_ALIGN (DLLVERSIONINFO2, 8)
123 TEST_FIELD_SIZE (DLLVERSIONINFO2, info1, 20)
124 TEST_FIELD_ALIGN (DLLVERSIONINFO2, info1, 4)
125 TEST_FIELD_OFFSET(DLLVERSIONINFO2, info1, 0)
126 TEST_FIELD_SIZE (DLLVERSIONINFO2, dwFlags, 4)
127 TEST_FIELD_ALIGN (DLLVERSIONINFO2, dwFlags, 4)
128 TEST_FIELD_OFFSET(DLLVERSIONINFO2, dwFlags, 20)
129 TEST_FIELD_SIZE (DLLVERSIONINFO2, ullVersion, 8)
130 TEST_FIELD_ALIGN (DLLVERSIONINFO2, ullVersion, 8)
131 TEST_FIELD_OFFSET(DLLVERSIONINFO2, ullVersion, 24)
134 static void test_pack_HUSKEY(void)
136 /* HUSKEY */
137 TEST_TYPE_SIZE (HUSKEY, 8)
138 TEST_TYPE_ALIGN (HUSKEY, 8)
141 static void test_pack_PHUSKEY(void)
143 /* PHUSKEY */
144 TEST_TYPE_SIZE (PHUSKEY, 8)
145 TEST_TYPE_ALIGN (PHUSKEY, 8)
146 TEST_TARGET_SIZE (PHUSKEY, 8)
147 TEST_TARGET_ALIGN(PHUSKEY, 8)
150 #else /* _WIN64 */
152 static void test_pack_ASSOCF(void)
154 /* ASSOCF */
155 TEST_TYPE_SIZE (ASSOCF, 4)
156 TEST_TYPE_ALIGN (ASSOCF, 4)
157 TEST_TYPE_UNSIGNED(ASSOCF)
160 static void test_pack_DLLGETVERSIONPROC(void)
162 /* DLLGETVERSIONPROC */
163 TEST_TYPE_SIZE (DLLGETVERSIONPROC, 4)
164 TEST_TYPE_ALIGN (DLLGETVERSIONPROC, 4)
167 static void test_pack_DLLVERSIONINFO(void)
169 /* DLLVERSIONINFO (pack 8) */
170 TEST_TYPE_SIZE (DLLVERSIONINFO, 20)
171 TEST_TYPE_ALIGN (DLLVERSIONINFO, 4)
172 TEST_FIELD_SIZE (DLLVERSIONINFO, cbSize, 4)
173 TEST_FIELD_ALIGN (DLLVERSIONINFO, cbSize, 4)
174 TEST_FIELD_OFFSET(DLLVERSIONINFO, cbSize, 0)
175 TEST_FIELD_SIZE (DLLVERSIONINFO, dwMajorVersion, 4)
176 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwMajorVersion, 4)
177 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwMajorVersion, 4)
178 TEST_FIELD_SIZE (DLLVERSIONINFO, dwMinorVersion, 4)
179 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwMinorVersion, 4)
180 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwMinorVersion, 8)
181 TEST_FIELD_SIZE (DLLVERSIONINFO, dwBuildNumber, 4)
182 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwBuildNumber, 4)
183 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwBuildNumber, 12)
184 TEST_FIELD_SIZE (DLLVERSIONINFO, dwPlatformID, 4)
185 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwPlatformID, 4)
186 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwPlatformID, 16)
189 static void test_pack_DLLVERSIONINFO2(void)
191 /* DLLVERSIONINFO2 (pack 8) */
192 TEST_TYPE_SIZE (DLLVERSIONINFO2, 32)
193 TEST_TYPE_ALIGN (DLLVERSIONINFO2, 8)
194 TEST_FIELD_SIZE (DLLVERSIONINFO2, info1, 20)
195 TEST_FIELD_ALIGN (DLLVERSIONINFO2, info1, 4)
196 TEST_FIELD_OFFSET(DLLVERSIONINFO2, info1, 0)
197 TEST_FIELD_SIZE (DLLVERSIONINFO2, dwFlags, 4)
198 TEST_FIELD_ALIGN (DLLVERSIONINFO2, dwFlags, 4)
199 TEST_FIELD_OFFSET(DLLVERSIONINFO2, dwFlags, 20)
200 TEST_FIELD_SIZE (DLLVERSIONINFO2, ullVersion, 8)
201 TEST_FIELD_ALIGN (DLLVERSIONINFO2, ullVersion, 8)
202 TEST_FIELD_OFFSET(DLLVERSIONINFO2, ullVersion, 24)
205 static void test_pack_HUSKEY(void)
207 /* HUSKEY */
208 TEST_TYPE_SIZE (HUSKEY, 4)
209 TEST_TYPE_ALIGN (HUSKEY, 4)
212 static void test_pack_PHUSKEY(void)
214 /* PHUSKEY */
215 TEST_TYPE_SIZE (PHUSKEY, 4)
216 TEST_TYPE_ALIGN (PHUSKEY, 4)
217 TEST_TARGET_SIZE (PHUSKEY, 4)
218 TEST_TARGET_ALIGN(PHUSKEY, 4)
221 #endif /* _WIN64 */
223 static void test_pack(void)
225 test_pack_ASSOCF();
226 test_pack_DLLGETVERSIONPROC();
227 test_pack_DLLVERSIONINFO();
228 test_pack_DLLVERSIONINFO2();
229 test_pack_HUSKEY();
230 test_pack_PHUSKEY();
233 START_TEST(generated)
235 test_pack();