2026-03-29 10:40:09 -06:00
|
|
|
find_package(cmocka REQUIRED)
|
|
|
|
|
|
|
|
|
|
add_executable(test_arena test_arena.c)
|
|
|
|
|
|
|
|
|
|
target_link_libraries(test_arena
|
2026-04-23 12:09:34 -06:00
|
|
|
arena
|
2026-03-29 10:40:09 -06:00
|
|
|
cmocka::cmocka
|
|
|
|
|
)
|
|
|
|
|
|
2026-04-23 12:09:34 -06:00
|
|
|
# Sanitizers (solo si están activados y el compilador lo soporta)
|
|
|
|
|
if(ARENA_ENABLE_SANITIZERS)
|
|
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
|
|
|
|
|
target_compile_options(test_arena PRIVATE
|
|
|
|
|
-fsanitize=address
|
|
|
|
|
-fno-omit-frame-pointer
|
|
|
|
|
)
|
|
|
|
|
target_link_options(test_arena PRIVATE
|
|
|
|
|
-fsanitize=address
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
refactor(all): Fixed alloc and moved growing logic to another function
OK, so evrything was a fucknig mess, it still kinda is, AI helped
me to clean my own mess, it really sucks but the fucking debugger
and address sanitizer were not working, also, there were small
small errors so no big deal but still, a bit sad, also changed a
the way i cast from uint8_t to double and int in the tests, may
change that i guess, verything else i might say is good :)
2026-04-03 12:44:01 -06:00
|
|
|
|
2026-03-29 10:40:09 -06:00
|
|
|
add_test(NAME arena_tests COMMAND test_arena)
|