Debian Codegraph @

src/vendor/azure-uamqp-c/deps/azure-macro-utils-c/tests/define_struct_test.h

raw
1 // Copyright (c) Microsoft. All rights reserved.
2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4 #ifndef DEFINE_STRUCT_TEST_H
5 #define DEFINE_STRUCT_TEST_H
6
7 #include "azure_macro_utils/macro_utils.h"
8
9 /*this construct defines a struct with 1 field*/
10
11 #define TEST_STRUCT_WITH_1_FIELD_FIELDS \
12 int, a
13
14 MU_DEFINE_STRUCT(TEST_STRUCT_WITH_1_FIELD, TEST_STRUCT_WITH_1_FIELD_FIELDS);
15
16 /*this construct defines a struct with 2 fields*/
17
18 #define TEST_STRUCT_WITH_2_FIELDS_FIELDS \
19 int, a, \
20 char*, x
21
22 MU_DEFINE_STRUCT(TEST_STRUCT_WITH_2_FIELDS, TEST_STRUCT_WITH_2_FIELDS_FIELDS);
23
24 /*this construct defines a struct with another struct in it, u la la*/
25
26 #define TEST_NESTED_STRUCT_FIELDS \
27 int, a, \
28 TEST_STRUCT_WITH_2_FIELDS, z, \
29 char*, x
30
31 MU_DEFINE_STRUCT(TEST_NESTED_STRUCT, TEST_NESTED_STRUCT_FIELDS);
32
33 int run_define_struct_tests(void);
34
35 #endif // DEFINE_STRUCT_TEST_H