]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t-reftable-tree: add test for non-existent key
authorChandra Pratap <chandrapratap3519@gmail.com>
Sun, 4 Aug 2024 14:06:48 +0000 (19:36 +0530)
committerJunio C Hamano <gitster@pobox.com>
Sun, 4 Aug 2024 16:50:27 +0000 (09:50 -0700)
In the current testing setup for tree_search(), the case for
non-existent key is not exercised. Improve this by adding a
test-case for the same.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/unit-tests/t-reftable-tree.c

index 7cc52a192550a4f8996159f8687baaf94205a038..2220414a1877182a386e7dfaef69eb6fbb7e2008 100644 (file)
@@ -47,6 +47,7 @@ static void t_tree_search(void)
                check_pointer_eq(nodes[i], tree_search(&values[i], &root, &t_compare, 0));
        }
 
+       check(!tree_search(values, &root, t_compare, 0));
        tree_free(root);
 }