summaryrefslogtreecommitdiff
path: root/tests/iterator
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-06-07 10:59:31 +0200
committerPatrick Steinhardt <ps@pks.im>2018-01-03 11:50:38 +0000
commit9aba76364fcb4755930856a7bafc5294ed3ee944 (patch)
tree9045ab33b61b17d0ab4de72dad3467bf30178012 /tests/iterator
parent72c28ab011759dce113c2a0c7c36ebcd56bd6ddf (diff)
downloadlibgit2-9aba76364fcb4755930856a7bafc5294ed3ee944.tar.gz
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.
Diffstat (limited to 'tests/iterator')
-rw-r--r--tests/iterator/iterator_helpers.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/iterator/iterator_helpers.c b/tests/iterator/iterator_helpers.c
index ae48fcd46..68d574126 100644
--- a/tests/iterator/iterator_helpers.c
+++ b/tests/iterator/iterator_helpers.c
@@ -51,8 +51,7 @@ void expect_iterator_items(
cl_assert(entry->mode != GIT_FILEMODE_TREE);
}
- if (++count >= expected_flat)
- break;
+ cl_assert(++count <= expected_flat);
}
assert_at_end(i, v);