test: add 56 unit tests for semantic, slab_alloc, and ast_profile modules#681
Open
RollerCoaster1899 wants to merge 1 commit into
Open
Conversation
…ules Add focused unit tests for three previously untested modules: - tests/test_semantic.c (32 tests): cbm_sem_tokenize (camel/snake/dot/abbrev), cbm_sem_cosine (identical/orthogonal/zero/negative/null), cbm_sem_normalize, cbm_sem_vec_add_scaled, cbm_sem_random_index (determinism), cbm_sem_proximity, cbm_sem_diffuse, corpus lifecycle, IDF, config - tests/test_slab_alloc.c (14 tests): slab malloc/free (≤64B and >64B), calloc zeroing/overflow, realloc (shrink/promote/same-size), free-list cycling, pointer uniqueness, thread reset - tests/test_ast_profile.c (10 tests): to_str/from_str round-trip (25 fields), null/empty/invalid inputs, to_vector range/saturation All 56 tests pass with ASan+UBSan. Registered in Makefile.cbm and test_main.c. Signed-off-by: Raul Acosta <raulacosta@users.noreply.github.com> Signed-off-by: Raul Acosta <raul.acosta.mmm@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 56 unit tests across 3 new test files for previously untested modules:
tests/test_semantic.c(32 tests):cbm_sem_tokenize(camel/snake/dot/abbrev),cbm_sem_cosine(identical/orthogonal/zero/negative/null),cbm_sem_normalize,cbm_sem_vec_add_scaled,cbm_sem_random_index(determinism),cbm_sem_proximity,cbm_sem_diffuse, corpus lifecycle, IDF, configtests/test_slab_alloc.c(14 tests): Slab malloc/free (≤64B and >64B), calloc zeroing/overflow, realloc (shrink/promote/same-size), free-list cycling, pointer uniqueness, thread resettests/test_ast_profile.c(10 tests):to_str/from_strround-trip (25 fields), null/empty/invalid inputs,to_vectorrange/saturationVerification
All 56 pass with ASan+UBSan.
Files modified
Makefile.cbm: Register new test sources inALL_TEST_SRCStests/test_main.c: Registersuite_semantic,suite_ast_profile,suite_slab_alloc