Commit d2bbea82 by Patrick Steinhardt

tests: iterator_helpers: assert number of iterator items

When the function `expect_iterator_items` surpasses the number of
expected items, we simply break the loop. This causes us to trigger an
assert later on which has message attached, which is annoying when
trying to locate the root error cause. Instead, directly assert that the
current count is still smaller or equal to the expected count inside of
the loop.

(cherry picked from commit 9aba7636)
parent 293c5ef2
...@@ -51,8 +51,7 @@ void expect_iterator_items( ...@@ -51,8 +51,7 @@ void expect_iterator_items(
cl_assert(entry->mode != GIT_FILEMODE_TREE); cl_assert(entry->mode != GIT_FILEMODE_TREE);
} }
if (++count >= expected_flat) cl_assert(++count <= expected_flat);
break;
} }
assert_at_end(i, v); assert_at_end(i, v);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment