aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test_random.c
Commit message (Collapse)AuthorAgeFilesLines
* Add comments to test programs, replace custom atoi with libcHEADmasterThomas Vanbesien2026-02-271-16/+18
| | | | | | Clarify purpose of helper functions and label the allocate/verify/free phases in _s_test_category and _s_test_realloc. Remove _s_atoi in favor of stdlib atoi.
* Fix stale filename comment, const qualifier, and int-to-size_t castsThomas Vanbesien2026-02-271-3/+3
| | | | | | | - test_preload.c: @file main.c -> @file test_preload.c - show_alloc_mem.c, test_preload.c: hex array -> static const - show_alloc_mem.c, test_preload.c, test_random.c: use size_t for sizeof-derived indices instead of casting to int
* Implement realloc and add realloc rounds to random testThomas Vanbesien2026-02-271-1/+103
| | | | | | realloc returns the same pointer if the chunk is large enough, otherwise malloc + memcpy + free. The random test now verifies data integrity after resizing across all three categories.
* Add randomized correctness testThomas Vanbesien2026-02-271-0/+176
test_random allocates N blocks per category (TINY/SMALL/LARGE) with random sizes, fills them with a deterministic pattern, and verifies the data. Run with system malloc and LD_PRELOAD to compare output. Seed and count are parameterized via argv.