From 7604ddbf701b586b6f6160807cf32fca28398df1 Mon Sep 17 00:00:00 2001 From: Sascha Cunz Date: Fri, 21 Sep 2012 00:57:21 +0200 Subject: [PATCH] Tests: Add 3 tags to resources/testrepo. Adjusts refs::list test (including the comments) Adjusts objects::tags::list test --- tests-clar/object/tag/list.c | 8 ++++---- tests-clar/refs/list.c | 6 +++--- tests-clar/resources/testrepo/.gitted/packed-refs | 1 + tests-clar/resources/testrepo/.gitted/refs/tags/foo/bar | 1 + .../resources/testrepo/.gitted/refs/tags/foo/foo/bar | 1 + 5 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 tests-clar/resources/testrepo/.gitted/refs/tags/foo/bar create mode 100644 tests-clar/resources/testrepo/.gitted/refs/tags/foo/foo/bar diff --git a/tests-clar/object/tag/list.c b/tests-clar/object/tag/list.c index 75feb55e1..f57a689d5 100644 --- a/tests-clar/object/tag/list.c +++ b/tests-clar/object/tag/list.c @@ -4,7 +4,7 @@ static git_repository *g_repo; -#define MAX_USED_TAGS 3 +#define MAX_USED_TAGS 6 struct pattern_match_t { @@ -47,7 +47,7 @@ static void ensure_tag_pattern_match(git_repository *repo, } } } - cl_assert(sucessfully_found == data->expected_matches); + cl_assert_equal_i((int)sucessfully_found, (int)data->expected_matches); exit: git_strarray_free(&tag_list); @@ -72,13 +72,13 @@ void test_object_tag_list__list_all(void) cl_git_pass(git_tag_list(&tag_list, g_repo)); - cl_assert(tag_list.count == 3); + cl_assert_equal_i((int)tag_list.count, 6); git_strarray_free(&tag_list); } static const struct pattern_match_t matches[] = { - { "", 3, { "e90810b", "point_to_blob", "test" } }, + { "", 6, { "e90810b", "point_to_blob", "test", "packed-tag", "foo/bar", "foo/foo/bar" } }, { "t*", 1, { "test" } }, { "*b", 2, { "e90810b", "point_to_blob" } }, { "e", 0 }, diff --git a/tests-clar/refs/list.c b/tests-clar/refs/list.c index 2daa3941e..3948b2b7a 100644 --- a/tests-clar/refs/list.c +++ b/tests-clar/refs/list.c @@ -33,10 +33,10 @@ void test_refs_list__all(void) printf("# %s\n", ref_list.strings[i]); }*/ - /* We have exactly 9 refs in total if we include the packed ones: + /* We have exactly 12 refs in total if we include the packed ones: * there is a reference that exists both in the packfile and as * loose, but we only list it once */ - cl_assert_equal_i((int)ref_list.count, 10); + cl_assert_equal_i((int)ref_list.count, 13); git_strarray_free(&ref_list); } @@ -62,7 +62,7 @@ void test_refs_list__do_not_retrieve_references_which_name_end_with_a_lock_exten "144344043ba4d4a405da03de3844aa829ae8be0e\n"); cl_git_pass(git_reference_list(&ref_list, g_repo, GIT_REF_LISTALL)); - cl_assert_equal_i((int)ref_list.count, 10); + cl_assert_equal_i((int)ref_list.count, 13); git_strarray_free(&ref_list); } diff --git a/tests-clar/resources/testrepo/.gitted/packed-refs b/tests-clar/resources/testrepo/.gitted/packed-refs index 52f5e876f..6018a19d2 100644 --- a/tests-clar/resources/testrepo/.gitted/packed-refs +++ b/tests-clar/resources/testrepo/.gitted/packed-refs @@ -1,3 +1,4 @@ # pack-refs with: peeled 41bc8c69075bbdb46c5c6f0566cc8cc5b46e8bd9 refs/heads/packed 5b5b025afb0b4c913b4c338a42934a3863bf3644 refs/heads/packed-test +b25fa35b38051e4ae45d4222e795f9df2e43f1d1 refs/tags/packed-tag diff --git a/tests-clar/resources/testrepo/.gitted/refs/tags/foo/bar b/tests-clar/resources/testrepo/.gitted/refs/tags/foo/bar new file mode 100644 index 000000000..6ee952a03 --- /dev/null +++ b/tests-clar/resources/testrepo/.gitted/refs/tags/foo/bar @@ -0,0 +1 @@ +b25fa35b38051e4ae45d4222e795f9df2e43f1d1 diff --git a/tests-clar/resources/testrepo/.gitted/refs/tags/foo/foo/bar b/tests-clar/resources/testrepo/.gitted/refs/tags/foo/foo/bar new file mode 100644 index 000000000..6ee952a03 --- /dev/null +++ b/tests-clar/resources/testrepo/.gitted/refs/tags/foo/foo/bar @@ -0,0 +1 @@ +b25fa35b38051e4ae45d4222e795f9df2e43f1d1