git/t/unit-tests
Johannes Schindelin e3ddc2e529 reftable tests: check reftable_table_init_ref_iterator() return
test_reftable_table__seek_once() and test_reftable_table__reseek()
both call reftable_table_init_ref_iterator() without checking its
return value. This function returns an int error code (0 on
success, negative on failure). Every other reftable function call
in these same tests checks the return via cl_assert_equal_i() or
cl_assert(), making this omission inconsistent.

If the iterator initialization ever fails (e.g., due to a memory
allocation failure in the reftable internals), the test would
proceed to seek and read with an uninitialized iterator, producing
misleading test results or crashes rather than a clear assertion
failure.

Check the return value via cl_assert_equal_i(ret, 0), consistent
with the surrounding code.

Pointed out by Coverity.

Assisted-by: Claude Opus 4.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-12 09:05:49 -07:00
..
clar doc: fix typos via codespell 2026-06-08 00:21:35 +09:00
.gitignore
generate-clar-decls.sh
generate-clar-suites.sh
lib-oid.c
lib-oid.h
lib-reftable.c reftable: split up write options 2026-06-26 08:27:19 -07:00
lib-reftable.h reftable: split up write options 2026-06-26 08:27:19 -07:00
test-lib.c
test-lib.h
u-ctype.c
u-dir.c
u-example-decorate.c
u-hash.c
u-hashmap.c
u-list-objects-filter-options.c
u-mem-pool.c
u-odb-inmemory.c odb: use size_t for object_info.sizep and the size APIs 2026-06-15 07:45:41 -07:00
u-oid-array.c
u-oidmap.c
u-oidtree.c
u-prio-queue.c prio-queue: fold lazy_queue into prio_queue for automatic get+put fusion 2026-06-09 11:11:46 -07:00
u-reftable-basics.c
u-reftable-block.c
u-reftable-merged.c reftable: split up write options 2026-06-26 08:27:19 -07:00
u-reftable-pq.c
u-reftable-readwrite.c reftable: split up write options 2026-06-26 08:27:19 -07:00
u-reftable-record.c
u-reftable-stack.c reftable: split up write options 2026-06-26 08:27:19 -07:00
u-reftable-table.c reftable tests: check reftable_table_init_ref_iterator() return 2026-08-12 09:05:49 -07:00
u-reftable-tree.c
u-strbuf.c
u-strcmp-offset.c
u-string-list.c
u-strvec.c
u-trailer.c
u-urlmatch-normalization.c
u-utf8-width.c
unit-test.c
unit-test.h