Unit test for the internal arena allocator.
This test file validates the core functionality of the infix_arena_t memory manager. Since the arena allocator is an internal component, this test must include the arena.c source file directly to access its functions. It also defines the infix_* memory macros to use the standard malloc, etc., to avoid interference from the fault-injection allocator in other tests.
The test verifies:
- Creation/Destruction:
infix_arena_create and infix_arena_destroy work as expected.
- Basic Allocation:
infix_arena_alloc returns a valid, non-null pointer.
- Alignment: A pointer allocated with a specific alignment is correctly aligned.
- Zeroed Allocation:
infix_arena_calloc returns a block of memory that is properly zero-initialized.
- Error Handling: When an allocation request exceeds the arena's capacity,
infix_arena_alloc correctly returns nullptr and sets the arena's internal error flag.