Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Price <price@mit.edu>2013-03-04 14:17:04 +0400
committerGreg Price <price@mit.edu>2013-04-01 02:33:22 +0400
commit2932c8826a1d948565124aa6c9a32df68a15895b (patch)
treea4c31ba216f447df743ca18dacbd861aa5781d88 /tests-clar/revwalk
parent06e6eab0e208966c1152fb13b54eec884e63f2aa (diff)
revwalk: refactor tests a bit
Signed-off-by: Greg Price <price@mit.edu>
Diffstat (limited to 'tests-clar/revwalk')
-rw-r--r--tests-clar/revwalk/basic.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests-clar/revwalk/basic.c b/tests-clar/revwalk/basic.c
index de529a9e2..2f1f817c9 100644
--- a/tests-clar/revwalk/basic.c
+++ b/tests-clar/revwalk/basic.c
@@ -56,22 +56,17 @@ static int get_commit_index(git_oid *raw_oid)
return -1;
}
-static int test_walk(git_revwalk *walk, const git_oid *root,
- int flags, const int possible_results[][6], int results_count)
+static int test_walk_only(git_revwalk *walk,
+ const int possible_results[][commit_count], int results_count)
{
git_oid oid;
-
int i;
int result_array[commit_count];
- git_revwalk_sorting(walk, flags);
- git_revwalk_push(walk, root);
-
for (i = 0; i < commit_count; ++i)
result_array[i] = -1;
i = 0;
-
while (git_revwalk_next(&oid, walk) == 0) {
result_array[i++] = get_commit_index(&oid);
/*{
@@ -90,6 +85,15 @@ static int test_walk(git_revwalk *walk, const git_oid *root,
return GIT_ERROR;
}
+static int test_walk(git_revwalk *walk, const git_oid *root,
+ int flags, const int possible_results[][6], int results_count)
+{
+ git_revwalk_sorting(walk, flags);
+ git_revwalk_push(walk, root);
+
+ return test_walk_only(walk, possible_results, results_count);
+}
+
static git_repository *_repo;
static git_revwalk *_walk;