aboutsummaryrefslogtreecommitdiffstats
path: root/t/unit-tests/u-oidmap.c
AgeCommit message (Collapse)AuthorFilesLines
2025-05-12oidmap: rename oidmap_free() to oidmap_clear()Jeff King1-1/+1
This function does not free the oidmap struct itself; it just drops all items from the map (using hashmap_clear_() internally). It should be called oidmap_clear(), per CodingGuidelines. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-02-25t/unit-tests: convert oidmap test to use clar test frameworkSeyi Kuforiji1-0/+136
Adapt oidmap test script to clar framework by using clar assertions where necessary. `cl_parse_any_oid()` ensures the hash algorithm is set before parsing. This prevents issues from an uninitialized or invalid hash algorithm. Introduce 'test_oidmap__initialize` handles the to set up of the global oidmap map with predefined key-value pairs, and `test_oidmap__cleanup` frees the oidmap and its entries when all tests are completed. The test loops through all entries to detect multiple errors. With this change, it stops at the first error encountered, making it easier to address it. Mentored-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>