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