Unit test for the Manual API (infix_type_create_* functions).
This test file validates the correctness of the programmatic type creation API. Its primary goal is to ensure that the infix_type objects created by these functions have a memory layout (size and alignment) that perfectly matches the layout produced by the C compiler for equivalent native types.
It tests:
infix_type_create_struct: Verifies standard padding and layout calculation.
infix_type_create_union: Verifies size and alignment for unions.
infix_type_create_array: Verifies layout for fixed-size arrays.
infix_type_create_enum: Verifies that enums have the layout of their underlying type.
- Introspection API: Checks that functions like
infix_forward_get_num_args and infix_forward_get_arg_type return correct information about a created trampoline.
This test is crucial for guaranteeing that the library's internal understanding of C's data layout rules is accurate.