|
infix
A JIT-Powered FFI Library for C
|
Unit test for the Manual API (infix_type_create_* functions).
More...
#include "common/compat_c23.h"#include "common/double_tap.h"#include <infix/infix.h>#include <stddef.h>#include <stdint.h>Classes | |
| struct | TestStruct |
| union | TestUnion |
Macros | |
| #define | DBLTAP_IMPLEMENTATION |
Typedefs | |
| typedef int64_t | TestArray[10] |
Functions | |
| subtest ("infix_type_create_struct API validation") | |
| subtest ("infix_type_create_union API validation") | |
| subtest ("infix_type_create_array API validation") | |
| subtest ("infix_type_create_enum API validation") | |
| subtest ("Forward trampoline introspection API") | |
Variables | |
| TEST | |
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.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.
| #define DBLTAP_IMPLEMENTATION |
| typedef int64_t TestArray[10] |
| subtest | ( | "Forward trampoline introspection API" | ) |
| subtest | ( | "infix_type_create_array API validation" | ) |
| subtest | ( | "infix_type_create_enum API validation" | ) |
| subtest | ( | "infix_type_create_struct API validation" | ) |
| subtest | ( | "infix_type_create_union API validation" | ) |