Fixed header dependencies to be fully compatible with the Windows
[wine/multimedia.git] / dlls / urlmon / tests / generated.c
blob26025375a94ff4957a80418abec9cc7a38063ec2
1 /* File generated automatically from tools/winapi/test.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>
16 #include "windef.h"
17 #include "winbase.h"
18 #include "urlmon.h"
20 #include "wine/test.h"
22 /***********************************************************************
23 * Compability macros
26 #define DWORD_PTR UINT_PTR
27 #define LONG_PTR INT_PTR
28 #define ULONG_PTR UINT_PTR
30 /***********************************************************************
31 * Windows API extension
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
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
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)
52 #endif
54 #if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
55 # define TYPE_ALIGNMENT _TYPE_ALIGNMENT
56 #endif
58 /***********************************************************************
59 * Test helper macros
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
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))
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
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
90 #define TEST_TYPE_SIZE(type, size) \
91 ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")", sizeof(type))
93 /***********************************************************************
94 * Test macros
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); \
102 #define TEST_TYPE(type, size, align) \
103 TEST_TYPE_ALIGNMENT(type, align); \
104 TEST_TYPE_SIZE(type, size)
106 #define TEST_TYPE_POINTER(type, size, align) \
107 TEST__TYPE_ALIGNMENT(*(type)0, align); \
108 TEST_TYPE_SIZE(*(type)0, size)
110 #define TEST_TYPE_SIGNED(type) \
111 ok((type) -1 < 0, "(" #type ") -1 < 0");
113 #define TEST_TYPE_UNSIGNED(type) \
114 ok((type) -1 > 0, "(" #type ") -1 > 0");
116 static void test_pack_BINDINFO(void)
118 /* BINDINFO (pack 4) */
119 TEST_FIELD(BINDINFO, ULONG, cbSize, 0, 4, 4);
120 TEST_FIELD(BINDINFO, LPWSTR, szExtraInfo, 4, 4, 4);
123 static void test_pack_IBindHost(void)
125 /* IBindHost */
128 static void test_pack_IBindStatusCallback(void)
130 /* IBindStatusCallback */
133 static void test_pack_IBinding(void)
135 /* IBinding */
138 static void test_pack_IWinInetHttpInfo(void)
140 /* IWinInetHttpInfo */
143 static void test_pack_IWinInetInfo(void)
145 /* IWinInetInfo */
148 static void test_pack(void)
150 test_pack_BINDINFO();
151 test_pack_IBindHost();
152 test_pack_IBindStatusCallback();
153 test_pack_IBinding();
154 test_pack_IWinInetHttpInfo();
155 test_pack_IWinInetInfo();
158 START_TEST(generated)
160 test_pack();