Tests the infix_type_* API functions for correctness and error handling.
Copyright (c) 2025 Sanko Robinson
This source code is dual-licensed under the Artistic License 2.0 or the MIT License. You may choose to use this code under the terms of either license.
SPDX-License-Identifier: (Artistic-2.0 OR MIT)
The documentation blocks within this file are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
SPDX-License-Identifier: CC-BY-4.0
This test suite focuses on the internal consistency of the type system's public API, rather than its use in FFI calls. It ensures that the functions for creating structs, unions, and arrays behave as expected under both normal and exceptional conditions.
The tests verify:
- Correctness: That
infix_type_create_struct
, _union
, and _array
calculate the size and alignment of types in a way that matches the C compiler's own sizeof
and _Alignof
operators.
- Error Handling: That the creation functions correctly reject invalid arguments (e.g., nullptr pointers for required parameters) and return the appropriate error status.