rename tests to dllname_winetest to make it less trouble on exception to change build...
[reactos.git] / reactos / regtests / winetests / shlwapi / generated.c
1 /* File generated automatically from tools/winapi/test.dat; do not edit! */
2 /* This file can be copied, modified and distributed without restriction. */
3
4 /*
5 * Unit tests for data structure packing
6 */
7
8 #define WINVER 0x0501
9 #define _WIN32_IE 0x0501
10 #define _WIN32_WINNT 0x0501
11
12 #define WINE_NOWINSOCK
13
14 #include <stdarg.h>
15 #include "windef.h"
16 #include "winbase.h"
17 #include "wtypes.h"
18 #include "winreg.h"
19 #include "shlwapi.h"
20
21 #include "wine/test.h"
22
23 /***********************************************************************
24 * Compability macros
25 */
26
27 #define DWORD_PTR UINT_PTR
28 #define LONG_PTR INT_PTR
29 #define ULONG_PTR UINT_PTR
30
31 /***********************************************************************
32 * Windows API extension
33 */
34
35 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
36 # define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field)
37 #elif defined(__GNUC__)
38 # define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field)
39 #else
40 /* FIXME: Not sure if is possible to do without compiler extension */
41 #endif
42
43 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
44 # define _TYPE_ALIGNMENT(type) __alignof(type)
45 #elif defined(__GNUC__)
46 # define _TYPE_ALIGNMENT(type) __alignof__(type)
47 #else
48 /*
49 * FIXME: Not sure if is possible to do without compiler extension
50 * (if type is not just a name that is, if so the normal)
51 * TYPE_ALIGNMENT can be used)
52 */
53 #endif
54
55 #if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)
56 #pragma warning(disable:4116)
57 #endif
58
59 #if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
60 # define TYPE_ALIGNMENT _TYPE_ALIGNMENT
61 #endif
62
63 /***********************************************************************
64 * Test helper macros
65 */
66
67 #ifdef FIELD_ALIGNMENT
68 # define TEST_FIELD_ALIGNMENT(type, field, align) \
69 ok(FIELD_ALIGNMENT(type, field) == align, \
70 "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \
71 (int)FIELD_ALIGNMENT(type, field))
72 #else
73 # define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0)
74 #endif
75
76 #define TEST_FIELD_OFFSET(type, field, offset) \
77 ok(FIELD_OFFSET(type, field) == offset, \
78 "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \
79 (long int)FIELD_OFFSET(type, field))
80
81 #ifdef _TYPE_ALIGNMENT
82 #define TEST__TYPE_ALIGNMENT(type, align) \
83 ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)_TYPE_ALIGNMENT(type))
84 #else
85 # define TEST__TYPE_ALIGNMENT(type, align) do { } while (0)
86 #endif
87
88 #ifdef TYPE_ALIGNMENT
89 #define TEST_TYPE_ALIGNMENT(type, align) \
90 ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)TYPE_ALIGNMENT(type))
91 #else
92 # define TEST_TYPE_ALIGNMENT(type, align) do { } while (0)
93 #endif
94
95 #define TEST_TYPE_SIZE(type, size) \
96 ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", ((int) sizeof(type)))
97
98 /***********************************************************************
99 * Test macros
100 */
101
102 #define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \
103 TEST_TYPE_SIZE(field_type, field_size); \
104 TEST_FIELD_ALIGNMENT(type, field_name, field_align); \
105 TEST_FIELD_OFFSET(type, field_name, field_offset); \
106
107 #define TEST_TYPE(type, size, align) \
108 TEST_TYPE_ALIGNMENT(type, align); \
109 TEST_TYPE_SIZE(type, size)
110
111 #define TEST_TYPE_POINTER(type, size, align) \
112 TEST__TYPE_ALIGNMENT(*(type)0, align); \
113 TEST_TYPE_SIZE(*(type)0, size)
114
115 #define TEST_TYPE_SIGNED(type) \
116 ok((type) -1 < 0, "(" #type ") -1 < 0\n");
117
118 #define TEST_TYPE_UNSIGNED(type) \
119 ok((type) -1 > 0, "(" #type ") -1 > 0\n");
120
121 static void test_pack_ASSOCF(void)
122 {
123 /* ASSOCF */
124 TEST_TYPE(ASSOCF, 4, 4);
125 TEST_TYPE_UNSIGNED(ASSOCF);
126 }
127
128 static void test_pack_DLLGETVERSIONPROC(void)
129 {
130 /* DLLGETVERSIONPROC */
131 TEST_TYPE(DLLGETVERSIONPROC, 4, 4);
132 }
133
134 static void test_pack_DLLVERSIONINFO(void)
135 {
136 /* DLLVERSIONINFO (pack 8) */
137 TEST_TYPE(DLLVERSIONINFO, 20, 4);
138 TEST_FIELD(DLLVERSIONINFO, DWORD, cbSize, 0, 4, 4);
139 TEST_FIELD(DLLVERSIONINFO, DWORD, dwMajorVersion, 4, 4, 4);
140 TEST_FIELD(DLLVERSIONINFO, DWORD, dwMinorVersion, 8, 4, 4);
141 TEST_FIELD(DLLVERSIONINFO, DWORD, dwBuildNumber, 12, 4, 4);
142 TEST_FIELD(DLLVERSIONINFO, DWORD, dwPlatformID, 16, 4, 4);
143 }
144
145 static void test_pack_DLLVERSIONINFO2(void)
146 {
147 /* DLLVERSIONINFO2 (pack 8) */
148 TEST_TYPE(DLLVERSIONINFO2, 32, 8);
149 TEST_FIELD(DLLVERSIONINFO2, DLLVERSIONINFO, info1, 0, 20, 4);
150 TEST_FIELD(DLLVERSIONINFO2, DWORD, dwFlags, 20, 4, 4);
151 TEST_FIELD(DLLVERSIONINFO2, ULONGLONG, ullVersion, 24, 8, 8);
152 }
153
154 static void test_pack_HUSKEY(void)
155 {
156 /* HUSKEY */
157 TEST_TYPE(HUSKEY, 4, 4);
158 }
159
160 static void test_pack_IQueryAssociations(void)
161 {
162 /* IQueryAssociations */
163 }
164
165 static void test_pack_PHUSKEY(void)
166 {
167 /* PHUSKEY */
168 TEST_TYPE(PHUSKEY, 4, 4);
169 TEST_TYPE_POINTER(PHUSKEY, 4, 4);
170 }
171
172 static void test_pack(void)
173 {
174 test_pack_ASSOCF();
175 test_pack_DLLGETVERSIONPROC();
176 test_pack_DLLVERSIONINFO();
177 test_pack_DLLVERSIONINFO2();
178 test_pack_HUSKEY();
179 test_pack_IQueryAssociations();
180 test_pack_PHUSKEY();
181 }
182
183 START_TEST(generated)
184 {
185 test_pack();
186 }