Release 1.6-rc2.
[wine/testsucceed.git] / dlls / shlwapi / tests / generated.c
blobe5e0896af8fc32f6286f56165f4d204039c8e882
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 WINVER 0x0501
9 #define _WIN32_IE 0x0501
10 #define _WIN32_WINNT 0x0501
12 #define WINE_NOWINSOCK
14 #include <stdarg.h>
15 #include "windef.h"
16 #include "winbase.h"
17 #include "wtypes.h"
18 #include "winreg.h"
19 #include "shlwapi.h"
21 #include "wine/test.h"
23 /***********************************************************************
24 * Compatibility macros
27 #define DWORD_PTR UINT_PTR
28 #define LONG_PTR INT_PTR
29 #define ULONG_PTR UINT_PTR
31 /***********************************************************************
32 * Windows API extension
35 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
36 # define _TYPE_ALIGNMENT(type) __alignof(type)
37 #elif defined(__GNUC__)
38 # define _TYPE_ALIGNMENT(type) __alignof__(type)
39 #else
41 * FIXME: May not be possible without a compiler extension
42 * (if type is not just a name that is, otherwise the normal
43 * TYPE_ALIGNMENT can be used)
45 #endif
47 #if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)
48 #pragma warning(disable:4116)
49 #endif
51 #if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
52 # define TYPE_ALIGNMENT _TYPE_ALIGNMENT
53 #endif
55 /***********************************************************************
56 * Test helper macros
59 #define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size);
61 #ifdef TYPE_ALIGNMENT
62 # define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align);
63 #else
64 # define TEST_TYPE_ALIGN(type, align)
65 #endif
67 #ifdef _TYPE_ALIGNMENT
68 # define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align);
69 # define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align);
70 #else
71 # define TEST_TARGET_ALIGN(type, align)
72 # define TEST_FIELD_ALIGN(type, field, align)
73 #endif
75 #define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset);
77 #define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size)
78 #define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size)
79 #define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0);
80 #define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0);
83 #ifdef _WIN64
85 static void test_pack_ASSOCF(void)
87 /* ASSOCF */
88 TEST_TYPE_SIZE (ASSOCF, 4)
89 TEST_TYPE_ALIGN (ASSOCF, 4)
90 TEST_TYPE_UNSIGNED(ASSOCF)
93 static void test_pack_DLLGETVERSIONPROC(void)
95 /* DLLGETVERSIONPROC */
96 TEST_TYPE_SIZE (DLLGETVERSIONPROC, 8)
97 TEST_TYPE_ALIGN (DLLGETVERSIONPROC, 8)
100 static void test_pack_DLLVERSIONINFO(void)
102 /* DLLVERSIONINFO (pack 8) */
103 TEST_TYPE_SIZE (DLLVERSIONINFO, 20)
104 TEST_TYPE_ALIGN (DLLVERSIONINFO, 4)
105 TEST_FIELD_SIZE (DLLVERSIONINFO, cbSize, 4)
106 TEST_FIELD_ALIGN (DLLVERSIONINFO, cbSize, 4)
107 TEST_FIELD_OFFSET(DLLVERSIONINFO, cbSize, 0)
108 TEST_FIELD_SIZE (DLLVERSIONINFO, dwMajorVersion, 4)
109 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwMajorVersion, 4)
110 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwMajorVersion, 4)
111 TEST_FIELD_SIZE (DLLVERSIONINFO, dwMinorVersion, 4)
112 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwMinorVersion, 4)
113 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwMinorVersion, 8)
114 TEST_FIELD_SIZE (DLLVERSIONINFO, dwBuildNumber, 4)
115 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwBuildNumber, 4)
116 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwBuildNumber, 12)
117 TEST_FIELD_SIZE (DLLVERSIONINFO, dwPlatformID, 4)
118 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwPlatformID, 4)
119 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwPlatformID, 16)
122 static void test_pack_DLLVERSIONINFO2(void)
124 /* DLLVERSIONINFO2 (pack 8) */
125 TEST_TYPE_SIZE (DLLVERSIONINFO2, 32)
126 TEST_TYPE_ALIGN (DLLVERSIONINFO2, 8)
127 TEST_FIELD_SIZE (DLLVERSIONINFO2, info1, 20)
128 TEST_FIELD_ALIGN (DLLVERSIONINFO2, info1, 4)
129 TEST_FIELD_OFFSET(DLLVERSIONINFO2, info1, 0)
130 TEST_FIELD_SIZE (DLLVERSIONINFO2, dwFlags, 4)
131 TEST_FIELD_ALIGN (DLLVERSIONINFO2, dwFlags, 4)
132 TEST_FIELD_OFFSET(DLLVERSIONINFO2, dwFlags, 20)
133 TEST_FIELD_SIZE (DLLVERSIONINFO2, ullVersion, 8)
134 TEST_FIELD_ALIGN (DLLVERSIONINFO2, ullVersion, 8)
135 TEST_FIELD_OFFSET(DLLVERSIONINFO2, ullVersion, 24)
138 static void test_pack_HUSKEY(void)
140 /* HUSKEY */
141 TEST_TYPE_SIZE (HUSKEY, 8)
142 TEST_TYPE_ALIGN (HUSKEY, 8)
145 static void test_pack_PHUSKEY(void)
147 /* PHUSKEY */
148 TEST_TYPE_SIZE (PHUSKEY, 8)
149 TEST_TYPE_ALIGN (PHUSKEY, 8)
150 TEST_TARGET_SIZE (PHUSKEY, 8)
151 TEST_TARGET_ALIGN(PHUSKEY, 8)
154 #else /* _WIN64 */
156 static void test_pack_ASSOCF(void)
158 /* ASSOCF */
159 TEST_TYPE_SIZE (ASSOCF, 4)
160 TEST_TYPE_ALIGN (ASSOCF, 4)
161 TEST_TYPE_UNSIGNED(ASSOCF)
164 static void test_pack_DLLGETVERSIONPROC(void)
166 /* DLLGETVERSIONPROC */
167 TEST_TYPE_SIZE (DLLGETVERSIONPROC, 4)
168 TEST_TYPE_ALIGN (DLLGETVERSIONPROC, 4)
171 static void test_pack_DLLVERSIONINFO(void)
173 /* DLLVERSIONINFO (pack 8) */
174 TEST_TYPE_SIZE (DLLVERSIONINFO, 20)
175 TEST_TYPE_ALIGN (DLLVERSIONINFO, 4)
176 TEST_FIELD_SIZE (DLLVERSIONINFO, cbSize, 4)
177 TEST_FIELD_ALIGN (DLLVERSIONINFO, cbSize, 4)
178 TEST_FIELD_OFFSET(DLLVERSIONINFO, cbSize, 0)
179 TEST_FIELD_SIZE (DLLVERSIONINFO, dwMajorVersion, 4)
180 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwMajorVersion, 4)
181 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwMajorVersion, 4)
182 TEST_FIELD_SIZE (DLLVERSIONINFO, dwMinorVersion, 4)
183 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwMinorVersion, 4)
184 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwMinorVersion, 8)
185 TEST_FIELD_SIZE (DLLVERSIONINFO, dwBuildNumber, 4)
186 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwBuildNumber, 4)
187 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwBuildNumber, 12)
188 TEST_FIELD_SIZE (DLLVERSIONINFO, dwPlatformID, 4)
189 TEST_FIELD_ALIGN (DLLVERSIONINFO, dwPlatformID, 4)
190 TEST_FIELD_OFFSET(DLLVERSIONINFO, dwPlatformID, 16)
193 static void test_pack_DLLVERSIONINFO2(void)
195 /* DLLVERSIONINFO2 (pack 8) */
196 TEST_TYPE_SIZE (DLLVERSIONINFO2, 32)
197 TEST_TYPE_ALIGN (DLLVERSIONINFO2, 8)
198 TEST_FIELD_SIZE (DLLVERSIONINFO2, info1, 20)
199 TEST_FIELD_ALIGN (DLLVERSIONINFO2, info1, 4)
200 TEST_FIELD_OFFSET(DLLVERSIONINFO2, info1, 0)
201 TEST_FIELD_SIZE (DLLVERSIONINFO2, dwFlags, 4)
202 TEST_FIELD_ALIGN (DLLVERSIONINFO2, dwFlags, 4)
203 TEST_FIELD_OFFSET(DLLVERSIONINFO2, dwFlags, 20)
204 TEST_FIELD_SIZE (DLLVERSIONINFO2, ullVersion, 8)
205 TEST_FIELD_ALIGN (DLLVERSIONINFO2, ullVersion, 8)
206 TEST_FIELD_OFFSET(DLLVERSIONINFO2, ullVersion, 24)
209 static void test_pack_HUSKEY(void)
211 /* HUSKEY */
212 TEST_TYPE_SIZE (HUSKEY, 4)
213 TEST_TYPE_ALIGN (HUSKEY, 4)
216 static void test_pack_PHUSKEY(void)
218 /* PHUSKEY */
219 TEST_TYPE_SIZE (PHUSKEY, 4)
220 TEST_TYPE_ALIGN (PHUSKEY, 4)
221 TEST_TARGET_SIZE (PHUSKEY, 4)
222 TEST_TARGET_ALIGN(PHUSKEY, 4)
225 #endif /* _WIN64 */
227 static void test_pack(void)
229 test_pack_ASSOCF();
230 test_pack_DLLGETVERSIONPROC();
231 test_pack_DLLVERSIONINFO();
232 test_pack_DLLVERSIONINFO2();
233 test_pack_HUSKEY();
234 test_pack_PHUSKEY();
237 START_TEST(generated)
239 test_pack();