From: Chandra Pratap Date: Sun, 4 Aug 2024 14:06:48 +0000 (+0530) Subject: t-reftable-tree: add test for non-existent key X-Git-Tag: v2.47.0-rc0~136^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c70022c1b9b3a6ea4d4d3f4b54edf0d759e520e3;p=thirdparty%2Fgit.git t-reftable-tree: add test for non-existent key 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 Mentored-by: Christian Couder Signed-off-by: Chandra Pratap Signed-off-by: Junio C Hamano --- diff --git a/t/unit-tests/t-reftable-tree.c b/t/unit-tests/t-reftable-tree.c index 7cc52a1925..2220414a18 100644 --- a/t/unit-tests/t-reftable-tree.c +++ b/t/unit-tests/t-reftable-tree.c @@ -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); }