Fix subclassing to support nested messages.
[wine] / dlls / urlmon / tests / 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 "urlmon.h"
18
19 #include "wine/test.h"
20
21 /***********************************************************************
22  * Compability macros
23  */
24
25 #define DWORD_PTR UINT_PTR
26 #define LONG_PTR INT_PTR
27 #define ULONG_PTR UINT_PTR
28
29 /***********************************************************************
30  * Windows API extension
31  */
32
33 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
34 # define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field)
35 #elif defined(__GNUC__)
36 # define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field)
37 #else
38 /* FIXME: Not sure if is possible to do without compiler extension */
39 #endif
40
41 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
42 # define _TYPE_ALIGNMENT(type) __alignof(type)
43 #elif defined(__GNUC__)
44 # define _TYPE_ALIGNMENT(type) __alignof__(type)
45 #else
46 /*
47  * FIXME: Not sure if is possible to do without compiler extension
48  *        (if type is not just a name that is, if so the normal)
49  *         TYPE_ALIGNMENT can be used)
50  */
51 #endif
52
53 #if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
54 # define TYPE_ALIGNMENT _TYPE_ALIGNMENT
55 #endif
56
57 /***********************************************************************
58  * Test helper macros
59  */
60
61 #ifdef FIELD_ALIGNMENT
62 # define TEST_FIELD_ALIGNMENT(type, field, align) \
63    ok(FIELD_ALIGNMENT(type, field) == align, \
64        "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \
65            FIELD_ALIGNMENT(type, field))
66 #else
67 # define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0)
68 #endif
69
70 #define TEST_FIELD_OFFSET(type, field, offset) \
71     ok(FIELD_OFFSET(type, field) == offset, \
72         "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \
73              FIELD_OFFSET(type, field))
74
75 #ifdef _TYPE_ALIGNMENT
76 #define TEST__TYPE_ALIGNMENT(type, align) \
77     ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", _TYPE_ALIGNMENT(type))
78 #else
79 # define TEST__TYPE_ALIGNMENT(type, align) do { } while (0)
80 #endif
81
82 #ifdef TYPE_ALIGNMENT
83 #define TEST_TYPE_ALIGNMENT(type, align) \
84     ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", TYPE_ALIGNMENT(type))
85 #else
86 # define TEST_TYPE_ALIGNMENT(type, align) do { } while (0)
87 #endif
88
89 #define TEST_TYPE_SIZE(type, size) \
90     ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", sizeof(type))
91
92 /***********************************************************************
93  * Test macros
94  */
95
96 #define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \
97   TEST_TYPE_SIZE(field_type, field_size); \
98   TEST_FIELD_ALIGNMENT(type, field_name, field_align); \
99   TEST_FIELD_OFFSET(type, field_name, field_offset); \
100
101 #define TEST_TYPE(type, size, align) \
102   TEST_TYPE_ALIGNMENT(type, align); \
103   TEST_TYPE_SIZE(type, size)
104
105 #define TEST_TYPE_POINTER(type, size, align) \
106     TEST__TYPE_ALIGNMENT(*(type)0, align); \
107     TEST_TYPE_SIZE(*(type)0, size)
108
109 #define TEST_TYPE_SIGNED(type) \
110     ok((type) -1 < 0, "(" #type ") -1 < 0\n");
111
112 #define TEST_TYPE_UNSIGNED(type) \
113      ok((type) -1 > 0, "(" #type ") -1 > 0\n");
114
115 static void test_pack_BINDINFO(void)
116 {
117     /* BINDINFO (pack 4) */
118     TEST_FIELD(BINDINFO, ULONG, cbSize, 0, 4, 4);
119     TEST_FIELD(BINDINFO, LPWSTR, szExtraInfo, 4, 4, 4);
120 }
121
122 static void test_pack_IBindHost(void)
123 {
124     /* IBindHost */
125 }
126
127 static void test_pack_IBindStatusCallback(void)
128 {
129     /* IBindStatusCallback */
130 }
131
132 static void test_pack_IBinding(void)
133 {
134     /* IBinding */
135 }
136
137 static void test_pack_IWinInetHttpInfo(void)
138 {
139     /* IWinInetHttpInfo */
140 }
141
142 static void test_pack_IWinInetInfo(void)
143 {
144     /* IWinInetInfo */
145 }
146
147 static void test_pack(void)
148 {
149     test_pack_BINDINFO();
150     test_pack_IBindHost();
151     test_pack_IBindStatusCallback();
152     test_pack_IBinding();
153     test_pack_IWinInetHttpInfo();
154     test_pack_IWinInetInfo();
155 }
156
157 START_TEST(generated)
158 {
159     test_pack();
160 }