diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2020-02-08 17:32:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-08 17:32:51 +0000 |
commit | 6a61a418c05a1835cefebe611bf31f12a6ce76bf (patch) | |
tree | ca53cae6b7eda280ed3f73364bddd06ab669351a | |
parent | 03ac24b1195e1ffb69a242eb77acce903812f032 (diff) | |
parent | 26b71d605ca6bbc926b58992e20d75e589d9c4f7 (diff) | |
download | libgit2-6a61a418c05a1835cefebe611bf31f12a6ce76bf.tar.gz |
Merge pull request #5393 from pks-t/pks/tests-iterator-missing-ref
tests: iterator: fix iterator expecting too few items
-rw-r--r-- | tests/iterator/workdir.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/iterator/workdir.c b/tests/iterator/workdir.c index 72f8bf42c..547fb7d95 100644 --- a/tests/iterator/workdir.c +++ b/tests/iterator/workdir.c @@ -637,13 +637,14 @@ void test_iterator_workdir__filesystem2(void) git_iterator_free(i); } -/* Lots of empty dirs, or nearly empty ones, make the old workdir - * iterator cry. Also, segfault. +/* + * Lots of empty dirs, or nearly empty ones, make the old workdir + * iterator cry. Also, segfault. */ void test_iterator_workdir__filesystem_gunk(void) { - git_iterator *i; git_buf parent = GIT_BUF_INIT; + git_iterator *i; int n; if (!cl_is_env_set("GITTEST_INVASIVE_SPEED")) @@ -653,19 +654,18 @@ void test_iterator_workdir__filesystem_gunk(void) for (n = 0; n < 100000; n++) { git_buf_clear(&parent); - git_buf_printf(&parent, "%s/refs/heads/foo/%d/subdir", - git_repository_path(g_repo), n); - cl_assert(!git_buf_oom(&parent)); - + cl_git_pass(git_buf_printf(&parent, "%s/refs/heads/foo/%d/subdir", git_repository_path(g_repo), n)); cl_git_pass(git_futils_mkdir(parent.ptr, 0775, GIT_MKDIR_PATH)); } cl_git_pass(git_iterator_for_filesystem(&i, "testrepo/.git/refs", NULL)); - /* should only have 16 items, since we're not asking for trees to be + /* + * Should only have 17 items, since we're not asking for trees to be * returned. the goal of this test is simply to not crash. */ - expect_iterator_items(i, 16, NULL, 15, NULL); + expect_iterator_items(i, 17, NULL, 16, NULL); + git_iterator_free(i); git_buf_dispose(&parent); } |