Skip to content

Commit 9aba763

Browse files
committed
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.
1 parent 72c28ab commit 9aba763

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tests/iterator/iterator_helpers.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ void expect_iterator_items(
5151
cl_assert(entry->mode != GIT_FILEMODE_TREE);
5252
}
5353

54-
if (++count >= expected_flat)
55-
break;
54+
cl_assert(++count <= expected_flat);
5655
}
5756

5857
assert_at_end(i, v);

0 commit comments

Comments
 (0)