diff options
Diffstat (limited to 'tests/object')
| -rw-r--r-- | tests/object/lookupbypath.c | 2 | ||||
| -rw-r--r-- | tests/object/message.c | 4 | ||||
| -rw-r--r-- | tests/object/raw/write.c | 4 | ||||
| -rw-r--r-- | tests/object/tag/list.c | 32 | ||||
| -rw-r--r-- | tests/object/tag/read.c | 12 | ||||
| -rw-r--r-- | tests/object/tag/write.c | 14 | ||||
| -rw-r--r-- | tests/object/tree/read.c | 6 |
7 files changed, 38 insertions, 36 deletions
diff --git a/tests/object/lookupbypath.c b/tests/object/lookupbypath.c index 13cd6a128..15e79f6ec 100644 --- a/tests/object/lookupbypath.c +++ b/tests/object/lookupbypath.c @@ -42,7 +42,7 @@ void test_object_lookupbypath__errors(void) { cl_assert_equal_i(GIT_EINVALIDSPEC, git_object_lookup_bypath(&g_actualobject, (git_object*)g_root_tree, - "subdir/subdir_test2.txt", GIT_OBJ_TREE)); // It's not a tree + "subdir/subdir_test2.txt", GIT_OBJ_TREE)); /* It's not a tree */ cl_assert_equal_i(GIT_ENOTFOUND, git_object_lookup_bypath(&g_actualobject, (git_object*)g_root_tree, "file/doesnt/exist", GIT_OBJ_ANY)); diff --git a/tests/object/message.c b/tests/object/message.c index 519ce5f31..bc005340b 100644 --- a/tests/object/message.c +++ b/tests/object/message.c @@ -14,8 +14,8 @@ static void assert_message_prettifying(char *expected_output, char *input, int s #define t40 "A quick brown fox jumps over the lazy do" #define s40 " " -#define sss s40 s40 s40 s40 s40 s40 s40 s40 s40 s40 // # 400 -#define ttt t40 t40 t40 t40 t40 t40 t40 t40 t40 t40 // # 400 +#define sss s40 s40 s40 s40 s40 s40 s40 s40 s40 s40 /* # 400 */ +#define ttt t40 t40 t40 t40 t40 t40 t40 t40 t40 t40 /* # 400 */ /* Ported from git.git */ /* see https://github.com/git/git/blob/master/t/t0030-stripspace.sh */ diff --git a/tests/object/raw/write.c b/tests/object/raw/write.c index 273f08f2c..c7270e26a 100644 --- a/tests/object/raw/write.c +++ b/tests/object/raw/write.c @@ -16,7 +16,7 @@ void test_body(object_data *d, git_rawobj *o); -// Helpers +/* Helpers */ static void remove_object_files(object_data *d) { cl_git_pass(p_unlink(d->file)); @@ -57,7 +57,7 @@ static void make_odb_dir(void) } -// Standard test form +/* Standard test form */ void test_body(object_data *d, git_rawobj *o) { git_odb *db; diff --git a/tests/object/tag/list.c b/tests/object/tag/list.c index 6d5a24347..b8d507fe7 100644 --- a/tests/object/tag/list.c +++ b/tests/object/tag/list.c @@ -13,7 +13,7 @@ struct pattern_match_t const char* expected_results[MAX_USED_TAGS]; }; -// Helpers +/* Helpers */ static void ensure_tag_pattern_match(git_repository *repo, const struct pattern_match_t* data) { @@ -34,7 +34,7 @@ static void ensure_tag_pattern_match(git_repository *repo, goto exit; } - // we have to be prepared that tags come in any order. + /* 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++) @@ -54,7 +54,7 @@ exit: cl_git_pass(error); } -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_object_tag_list__initialize(void) { g_repo = cl_git_sandbox_init("testrepo"); @@ -67,7 +67,7 @@ void test_object_tag_list__cleanup(void) void test_object_tag_list__list_all(void) { - // list all tag names from the repository + /* list all tag names from the repository */ git_strarray tag_list; cl_git_pass(git_tag_list(&tag_list, g_repo)); @@ -78,37 +78,39 @@ void test_object_tag_list__list_all(void) } static const struct pattern_match_t matches[] = { - // All tags, including a packed one and two namespaced ones. + /* 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 + /* beginning with */ { "t*", 1, { "test" } }, - // ending with + /* ending with */ { "*b", 2, { "e90810b", "point_to_blob" } }, - // exact match + /* exact match */ { "e", 0 }, { "e90810b", 1, { "e90810b" } }, - // either or + /* either or */ { "e90810[ab]", 1, { "e90810b" } }, - // glob in the middle + /* glob in the middle */ { "foo/*/bar", 1, { "foo/foo/bar" } }, - // The matching of '*' is based on plain string matching analog to the regular expression ".*" - // => a '/' in the tag name has no special meaning. - // Compare to `git tag -l "*bar"` + /* + * The matching of '*' is based on plain string matching analog to the regular expression ".*" + * => a '/' in the tag name has no special meaning. + * Compare to `git tag -l "*bar"` + */ { "*bar", 2, { "foo/bar", "foo/foo/bar" } }, - // End of list + /* End of list */ { NULL } }; void test_object_tag_list__list_by_pattern(void) { - // list all tag names from the repository matching a specified pattern + /* 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++]); diff --git a/tests/object/tag/read.c b/tests/object/tag/read.c index 8f28afd54..e28056ec7 100644 --- a/tests/object/tag/read.c +++ b/tests/object/tag/read.c @@ -13,7 +13,7 @@ static const char *taggerless = "4a23e2e65ad4e31c4c9db7dc746650bfad082679"; static git_repository *g_repo; -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_object_tag_read__initialize(void) { g_repo = cl_git_sandbox_init("testrepo"); @@ -27,7 +27,7 @@ void test_object_tag_read__cleanup(void) void test_object_tag_read__parse(void) { - // read and parse a tag from the repository + /* read and parse a tag from the repository */ git_tag *tag1, *tag2; git_commit *commit; git_oid id1, id2, id_commit; @@ -58,13 +58,13 @@ void test_object_tag_read__parse(void) void test_object_tag_read__parse_without_tagger(void) { - // read and parse a tag without a tagger field + /* read and parse a tag without a tagger field */ git_repository *bad_tag_repo; git_tag *bad_tag; git_commit *commit; git_oid id, id_commit; - // TODO: This is a little messy + /* TODO: This is a little messy */ cl_git_pass(git_repository_open(&bad_tag_repo, cl_fixture("bad_tag.git"))); git_oid_fromstr(&id, bad_tag_id); @@ -90,13 +90,13 @@ void test_object_tag_read__parse_without_tagger(void) void test_object_tag_read__parse_without_message(void) { - // read and parse a tag without a message field + /* read and parse a tag without a message field */ git_repository *short_tag_repo; git_tag *short_tag; git_commit *commit; git_oid id, id_commit; - // TODO: This is a little messy + /* TODO: This is a little messy */ cl_git_pass(git_repository_open(&short_tag_repo, cl_fixture("short_tag.git"))); git_oid_fromstr(&id, short_tag_id); diff --git a/tests/object/tag/write.c b/tests/object/tag/write.c index 68e4b6c61..4c5080185 100644 --- a/tests/object/tag/write.c +++ b/tests/object/tag/write.c @@ -9,7 +9,7 @@ static const char *tagged_commit = "e90810b8df3e80c413d903f631643c716887138d"; static git_repository *g_repo; -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_object_tag_write__initialize(void) { g_repo = cl_git_sandbox_init("testrepo"); @@ -22,7 +22,7 @@ void test_object_tag_write__cleanup(void) void test_object_tag_write__basic(void) { - // write a tag to the repository and read it again + /* write a tag to the repository and read it again */ git_tag *tag; git_oid target_id, tag_id; git_signature *tagger; @@ -67,7 +67,7 @@ void test_object_tag_write__basic(void) void test_object_tag_write__overwrite(void) { - // Attempt to write a tag bearing the same name than an already existing tag + /* Attempt to write a tag bearing the same name than an already existing tag */ git_oid target_id, tag_id; git_signature *tagger; git_object *target; @@ -93,7 +93,7 @@ void test_object_tag_write__overwrite(void) void test_object_tag_write__replace(void) { - // Replace an already existing tag + /* Replace an already existing tag */ git_oid target_id, tag_id, old_tag_id; git_signature *tagger; git_reference *ref_tag; @@ -130,7 +130,7 @@ void test_object_tag_write__replace(void) void test_object_tag_write__lightweight(void) { - // write a lightweight tag to the repository and read it again + /* write a lightweight tag to the repository and read it again */ git_oid target_id, object_id; git_reference *ref_tag; git_object *target; @@ -159,7 +159,7 @@ void test_object_tag_write__lightweight(void) void test_object_tag_write__lightweight_over_existing(void) { - // Attempt to write a lightweight tag bearing the same name than an already existing tag + /* Attempt to write a lightweight tag bearing the same name than an already existing tag */ git_oid target_id, object_id, existing_object_id; git_object *target; @@ -181,7 +181,7 @@ void test_object_tag_write__lightweight_over_existing(void) void test_object_tag_write__delete(void) { - // Delete an already existing tag + /* Delete an already existing tag */ git_reference *ref_tag; cl_git_pass(git_tag_delete(g_repo, "e90810b")); diff --git a/tests/object/tree/read.c b/tests/object/tree/read.c index 59a809bf1..1d3a9133d 100644 --- a/tests/object/tree/read.c +++ b/tests/object/tree/read.c @@ -6,7 +6,7 @@ static const char *tree_oid = "1810dff58d8a660512d4832e740f692884338ccd"; static git_repository *g_repo; -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_object_tree_read__initialize(void) { g_repo = cl_git_sandbox_init("testrepo"); @@ -21,7 +21,7 @@ void test_object_tree_read__cleanup(void) void test_object_tree_read__loaded(void) { - // acces randomly the entries on a loaded tree + /* acces randomly the entries on a loaded tree */ git_oid id; git_tree *tree; @@ -42,7 +42,7 @@ void test_object_tree_read__loaded(void) void test_object_tree_read__two(void) { - // read a tree from the repository + /* read a tree from the repository */ git_oid id; git_tree *tree; const git_tree_entry *entry; |
