The tests are very straightforward, and effecitvely are just ensuring that the formatting works correctly and is included in all of the important cases. It's also very important to ensure we do not generate laid-out structs for layouts which we cannot reasonably represent in C (such as in cases where we weren't told what annotation to use for packed and specifically-aligned structures). Thus, add some tests to verify that this is the case. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
30 lines
552 B
TOML
30 lines
552 B
TOML
header = """
|
|
#define CBINDGEN_PACKED __attribute__ ((packed))
|
|
#define CBINDGEN_ALIGNED(n) __attribute__ ((aligned(n)))
|
|
"""
|
|
|
|
[layout]
|
|
packed = "CBINDGEN_PACKED"
|
|
aligned_n = "CBINDGEN_ALIGNED"
|
|
|
|
[export]
|
|
include = [
|
|
"Align1Struct",
|
|
"Align2Struct",
|
|
"Align4Struct",
|
|
"Align8Struct",
|
|
"Align32Struct",
|
|
"PackedStruct",
|
|
"Align1Union",
|
|
"Align4Union",
|
|
"Align16Union",
|
|
"PackedUnion",
|
|
"UnsupportedPacked4Struct",
|
|
"UnsupportedPacked4Union",
|
|
"UnsupportedAlign4Enum",
|
|
"RustAlign4Struct",
|
|
"RustPackedStruct",
|
|
"RustAlign4Union",
|
|
"RustPackedUnion",
|
|
]
|