Tests: reindent object/tag/list.c to use tabs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
diff --git a/tests-clar/object/tag/list.c b/tests-clar/object/tag/list.c
index 3657335..a3e0b88 100644
--- a/tests-clar/object/tag/list.c
+++ b/tests-clar/object/tag/list.c
@@ -8,103 +8,103 @@ static git_repository *g_repo;
struct pattern_match_t
{
- const char* pattern;
- const size_t expected_matches;
- const char* expected_results[MAX_USED_TAGS];
+ const char* pattern;
+ const size_t expected_matches;
+ const char* expected_results[MAX_USED_TAGS];
};
// Helpers
static void ensure_tag_pattern_match(git_repository *repo,
- const struct pattern_match_t* data)
+ const struct pattern_match_t* data)
{
- int already_found[MAX_USED_TAGS] = { 0 };
- git_strarray tag_list;
- int error = 0;
- size_t sucessfully_found = 0;
- size_t i, j;
-
- cl_assert(data->expected_matches <= MAX_USED_TAGS);
-
- if ((error = git_tag_list_match(&tag_list, data->pattern, repo)) < 0)
- goto exit;
-
- if (tag_list.count != data->expected_matches)
- {
- error = GIT_ERROR;
- goto exit;
- }
-
- // we have to be prepared that tags come in any order.
- for (i = 0; i < tag_list.count; i++)
- {
- for (j = 0; j < data->expected_matches; j++)
- {
- if (!already_found[j] && !strcmp(data->expected_results[j], tag_list.strings[i]))
- {
- already_found[j] = 1;
- sucessfully_found++;
- break;
- }
- }
- }
- cl_assert_equal_i((int)sucessfully_found, (int)data->expected_matches);
+ int already_found[MAX_USED_TAGS] = { 0 };
+ git_strarray tag_list;
+ int error = 0;
+ size_t sucessfully_found = 0;
+ size_t i, j;
+
+ cl_assert(data->expected_matches <= MAX_USED_TAGS);
+
+ if ((error = git_tag_list_match(&tag_list, data->pattern, repo)) < 0)
+ goto exit;
+
+ if (tag_list.count != data->expected_matches)
+ {
+ error = GIT_ERROR;
+ goto exit;
+ }
+
+ // we have to be prepared that tags come in any order.
+ for (i = 0; i < tag_list.count; i++)
+ {
+ for (j = 0; j < data->expected_matches; j++)
+ {
+ if (!already_found[j] && !strcmp(data->expected_results[j], tag_list.strings[i]))
+ {
+ already_found[j] = 1;
+ sucessfully_found++;
+ break;
+ }
+ }
+ }
+ cl_assert_equal_i((int)sucessfully_found, (int)data->expected_matches);
exit:
- git_strarray_free(&tag_list);
- cl_git_pass(error);
+ git_strarray_free(&tag_list);
+ cl_git_pass(error);
}
// Fixture setup and teardown
void test_object_tag_list__initialize(void)
{
- g_repo = cl_git_sandbox_init("testrepo");
+ g_repo = cl_git_sandbox_init("testrepo");
}
void test_object_tag_list__cleanup(void)
{
- cl_git_sandbox_cleanup();
+ cl_git_sandbox_cleanup();
}
void test_object_tag_list__list_all(void)
{
- // list all tag names from the repository
- git_strarray tag_list;
+ // list all tag names from the repository
+ git_strarray tag_list;
- cl_git_pass(git_tag_list(&tag_list, g_repo));
+ cl_git_pass(git_tag_list(&tag_list, g_repo));
- cl_assert_equal_i((int)tag_list.count, 6);
+ cl_assert_equal_i((int)tag_list.count, 6);
- git_strarray_free(&tag_list);
+ git_strarray_free(&tag_list);
}
static const struct pattern_match_t matches[] = {
- // All tags, including a packed one and two namespaced ones.
- { "", 6, { "e90810b", "point_to_blob", "test", "packed-tag", "foo/bar", "foo/foo/bar" } },
+ // All tags, including a packed one and two namespaced ones.
+ { "", 6, { "e90810b", "point_to_blob", "test", "packed-tag", "foo/bar", "foo/foo/bar" } },
- // beginning with
- { "t*", 1, { "test" } },
+ // beginning with
+ { "t*", 1, { "test" } },
- // ending with
- { "*b", 2, { "e90810b", "point_to_blob" } },
+ // ending with
+ { "*b", 2, { "e90810b", "point_to_blob" } },
- // exact match
- { "e", 0 },
- { "e90810b", 1, { "e90810b" } },
+ // exact match
+ { "e", 0 },
+ { "e90810b", 1, { "e90810b" } },
- // either or
- { "e90810[ab]", 1, { "e90810b" } },
+ // either or
+ { "e90810[ab]", 1, { "e90810b" } },
- // glob in the middle
- { "foo/*/bar", 1, { "foo/foo/bar" } },
+ // glob in the middle
+ { "foo/*/bar", 1, { "foo/foo/bar" } },
- // End of list
- { NULL }
+ // End of list
+ { NULL }
};
void test_object_tag_list__list_by_pattern(void)
{
- // list all tag names from the repository matching a specified pattern
- size_t i = 0;
- while (matches[i].pattern)
- ensure_tag_pattern_match(g_repo, &matches[i++]);
+ // list all tag names from the repository matching a specified pattern
+ size_t i = 0;
+ while (matches[i].pattern)
+ ensure_tag_pattern_match(g_repo, &matches[i++]);
}