diff options
Diffstat (limited to 'tests')
59 files changed, 161 insertions, 156 deletions
diff --git a/tests/checkout/index.c b/tests/checkout/index.c index a649d8512..69252e3d9 100644 --- a/tests/checkout/index.c +++ b/tests/checkout/index.c @@ -146,7 +146,7 @@ void test_checkout_index__honor_coresymlinks_default(void) const char *url = git_repository_path(g_repo); cl_assert(getcwd(cwd, sizeof(cwd)) != NULL); - cl_assert_equal_i(0, p_mkdir("readonly", 0555)); // Read-only directory + cl_assert_equal_i(0, p_mkdir("readonly", 0555)); /* Read-only directory */ cl_assert_equal_i(0, chdir("readonly")); cl_git_pass(git_repository_init(&repo, "../symlink.git", true)); cl_assert_equal_i(0, chdir(cwd)); diff --git a/tests/checkout/tree.c b/tests/checkout/tree.c index a78bf82df..a69574bf3 100644 --- a/tests/checkout/tree.c +++ b/tests/checkout/tree.c @@ -915,7 +915,7 @@ void test_checkout_tree__target_directory_from_bare(void) void test_checkout_tree__extremely_long_file_name(void) { - // A utf-8 string with 83 characters, but 249 bytes. + /* A utf-8 string with 83 characters, but 249 bytes. */ const char *longname = "\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97"; char path[1024]; diff --git a/tests/cherrypick/workdir.c b/tests/cherrypick/workdir.c index d83f54b51..e43bb0807 100644 --- a/tests/cherrypick/workdir.c +++ b/tests/cherrypick/workdir.c @@ -12,7 +12,7 @@ static git_repository *repo; static git_index *repo_index; -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_cherrypick_workdir__initialize(void) { repo = cl_git_sandbox_init(TEST_REPO_PATH); diff --git a/tests/commit/parse.c b/tests/commit/parse.c index e61589dfd..47ec6ddbf 100644 --- a/tests/commit/parse.c +++ b/tests/commit/parse.c @@ -3,7 +3,7 @@ #include "commit.h" #include "signature.h" -// Fixture setup +/* Fixture setup */ static git_repository *g_repo; void test_commit_parse__initialize(void) { @@ -15,7 +15,7 @@ void test_commit_parse__cleanup(void) } -// Header parsing +/* Header parsing */ typedef struct { const char *line; const char *header; @@ -70,7 +70,7 @@ void test_commit_parse__header(void) } -// Signature parsing +/* Signature parsing */ typedef struct { const char *string; const char *header; @@ -89,27 +89,27 @@ passing_signature_test_case passing_signature_cases[] = { {"committer Vicent Marti <tanoku@gmail.com> 123456 +0000 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, 0}, {"committer Vicent Marti <tanoku@gmail.com> 123456 +0100 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, 60}, {"committer Vicent Marti <tanoku@gmail.com> 123456 -0100 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, -60}, - // Parse a signature without an author field + /* Parse a signature without an author field */ {"committer <tanoku@gmail.com> 123456 -0100 \n", "committer ", "", "tanoku@gmail.com", 123456, -60}, - // Parse a signature without an author field + /* Parse a signature without an author field */ {"committer <tanoku@gmail.com> 123456 -0100 \n", "committer ", "", "tanoku@gmail.com", 123456, -60}, - // Parse a signature with an empty author field + /* Parse a signature with an empty author field */ {"committer <tanoku@gmail.com> 123456 -0100 \n", "committer ", "", "tanoku@gmail.com", 123456, -60}, - // Parse a signature with an empty email field + /* Parse a signature with an empty email field */ {"committer Vicent Marti <> 123456 -0100 \n", "committer ", "Vicent Marti", "", 123456, -60}, - // Parse a signature with an empty email field + /* Parse a signature with an empty email field */ {"committer Vicent Marti < > 123456 -0100 \n", "committer ", "Vicent Marti", "", 123456, -60}, - // Parse a signature with empty name and email + /* Parse a signature with empty name and email */ {"committer <> 123456 -0100 \n", "committer ", "", "", 123456, -60}, - // Parse a signature with empty name and email + /* Parse a signature with empty name and email */ {"committer <> 123456 -0100 \n", "committer ", "", "", 123456, -60}, - // Parse a signature with empty name and email + /* Parse a signature with empty name and email */ {"committer < > 123456 -0100 \n", "committer ", "", "", 123456, -60}, - // Parse an obviously invalid signature + /* Parse an obviously invalid signature */ {"committer foo<@bar> 123456 -0100 \n", "committer ", "foo", "@bar", 123456, -60}, - // Parse an obviously invalid signature + /* Parse an obviously invalid signature */ {"committer foo<@bar> 123456 -0100 \n", "committer ", "foo", "@bar", 123456, -60}, - // Parse an obviously invalid signature + /* Parse an obviously invalid signature */ {"committer <>\n", "committer ", "", "", 0, 0}, {"committer Vicent Marti <tanoku@gmail.com> 123456 -1500 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, 0}, {"committer Vicent Marti <tanoku@gmail.com> 123456 +0163 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, 0}, @@ -173,65 +173,65 @@ void test_commit_parse__signature(void) static char *failing_commit_cases[] = { -// empty commit +/* empty commit */ "", -// random garbage +/* random garbage */ "asd97sa9du902e9a0jdsuusad09as9du098709aweu8987sd\n", -// broken endlines 1 +/* broken endlines 1 */ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\r\n\ parent 05452d6349abcd67aa396dfb28660d765d8b2a36\r\n\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\r\n\ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\r\n\ \r\n\ a test commit with broken endlines\r\n", -// broken endlines 2 +/* broken endlines 2 */ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\ parent 05452d6349abcd67aa396dfb28660d765d8b2a36\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\ \ another test commit with broken endlines", -// starting endlines +/* starting endlines */ "\ntree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ \n\ a test commit with a starting endline\n", -// corrupted commit 1 +/* corrupted commit 1 */ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ parent 05452d6349abcd67aa396df", -// corrupted commit 2 +/* corrupted commit 2 */ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ parent ", -// corrupted commit 3 +/* corrupted commit 3 */ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ parent ", -// corrupted commit 4 +/* corrupted commit 4 */ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ par", }; static char *passing_commit_cases[] = { -// simple commit with no message +/* simple commit with no message */ "tree 1810dff58d8a660512d4832e740f692884338ccd\n\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ \n", -// simple commit, no parent +/* simple commit, no parent */ "tree 1810dff58d8a660512d4832e740f692884338ccd\n\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ \n\ a simple commit which works\n", -// simple commit, no parent, no newline in message +/* simple commit, no parent, no newline in message */ "tree 1810dff58d8a660512d4832e740f692884338ccd\n\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ \n\ a simple commit which works", -// simple commit, 1 parent +/* simple commit, 1 parent */ "tree 1810dff58d8a660512d4832e740f692884338ccd\n\ parent e90810b8df3e80c413d903f631643c716887138d\n\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ @@ -317,7 +317,7 @@ void test_commit_parse__entire_commit(void) } -// query the details on a parsed commit +/* query the details on a parsed commit */ void test_commit_parse__details0(void) { static const char *commit_ids[] = { "a4a7dce85cf63874e984719f4fdd239f5145052f", /* 0 */ @@ -365,7 +365,7 @@ void test_commit_parse__details0(void) { old_parent = parent; cl_git_pass(git_commit_parent(&parent, commit, p)); cl_assert(parent != NULL); - cl_assert(git_commit_author(parent) != NULL); // is it really a commit? + cl_assert(git_commit_author(parent) != NULL); /* is it really a commit? */ } git_commit_free(old_parent); git_commit_free(parent); diff --git a/tests/commit/signature.c b/tests/commit/signature.c index 286079fa2..78ddbbef3 100644 --- a/tests/commit/signature.c +++ b/tests/commit/signature.c @@ -59,7 +59,7 @@ void test_commit_signature__angle_brackets_in_email_are_not_supported(void) void test_commit_signature__create_empties(void) { - // can not create a signature with empty name or email + /* can not create a signature with empty name or email */ cl_git_pass(try_build_signature("nulltoken", "emeric.fermas@gmail.com", 1234567890, 60)); cl_git_fail(try_build_signature("", "emeric.fermas@gmail.com", 1234567890, 60)); @@ -70,19 +70,19 @@ void test_commit_signature__create_empties(void) void test_commit_signature__create_one_char(void) { - // creating a one character signature + /* creating a one character signature */ assert_name_and_email("x", "foo@bar.baz", "x", "foo@bar.baz"); } void test_commit_signature__create_two_char(void) { - // creating a two character signature + /* creating a two character signature */ assert_name_and_email("xx", "foo@bar.baz", "xx", "foo@bar.baz"); } void test_commit_signature__create_zero_char(void) { - // creating a zero character signature + /* creating a zero character signature */ git_signature *sign; cl_git_fail(git_signature_new(&sign, "", "x@y.z", 1234567890, 60)); cl_assert(sign == NULL); diff --git a/tests/commit/write.c b/tests/commit/write.c index 7b0af8cc0..2ba74ca9b 100644 --- a/tests/commit/write.c +++ b/tests/commit/write.c @@ -15,7 +15,7 @@ static char *head_old; static git_reference *head, *branch; static git_commit *commit; -// Fixture setup +/* Fixture setup */ static git_repository *g_repo; void test_commit_write__initialize(void) { @@ -42,7 +42,7 @@ void test_commit_write__cleanup(void) } -// write a new commit object from memory to disk +/* write a new commit object from memory to disk */ void test_commit_write__from_memory(void) { git_oid tree_id, parent_id, commit_id; @@ -137,7 +137,7 @@ This is a root commit\n\ git_signature_free(committer); } -// create a root commit +/* create a root commit */ void test_commit_write__root(void) { git_oid tree_id, commit_id; diff --git a/tests/config/write.c b/tests/config/write.c index cffa54e4d..521dcb0ae 100644 --- a/tests/config/write.c +++ b/tests/config/write.c @@ -365,7 +365,7 @@ void test_config_write__add_value_at_specific_level(void) int64_t l, expected = +9223372036854775803; git_buf buf = GIT_BUF_INIT; - // open config15 as global level config file + /* open config15 as global level config file */ cl_git_pass(git_config_new(&cfg)); cl_git_pass(git_config_add_file_ondisk(cfg, "config9", GIT_CONFIG_LEVEL_LOCAL, NULL, 0)); @@ -381,7 +381,7 @@ void test_config_write__add_value_at_specific_level(void) git_config_free(cfg_specific); git_config_free(cfg); - // open config15 as local level config file + /* open config15 as local level config file */ cl_git_pass(git_config_open_ondisk(&cfg, "config15")); cl_git_pass(git_config_get_int32(&i, cfg, "core.int32global")); diff --git a/tests/core/filebuf.c b/tests/core/filebuf.c index 51d8a0146..8d1952f57 100644 --- a/tests/core/filebuf.c +++ b/tests/core/filebuf.c @@ -8,7 +8,7 @@ void test_core_filebuf__0(void) int fd; char test[] = "test", testlock[] = "test.lock"; - fd = p_creat(testlock, 0744); //-V536 + fd = p_creat(testlock, 0744); /* -V536 */ cl_must_pass(fd); cl_must_pass(p_close(fd)); diff --git a/tests/core/futils.c b/tests/core/futils.c index c69c210ee..fce4848f5 100644 --- a/tests/core/futils.c +++ b/tests/core/futils.c @@ -1,7 +1,7 @@ #include "clar_libgit2.h" #include "fileops.h" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_core_futils__initialize(void) { cl_must_pass(p_mkdir("futils", 0777)); diff --git a/tests/core/vector.c b/tests/core/vector.c index c2e5d3f34..4e6f6fc7f 100644 --- a/tests/core/vector.c +++ b/tests/core/vector.c @@ -18,13 +18,13 @@ void test_core_vector__0(void) void test_core_vector__1(void) { git_vector x; - // make initial capacity exact for our insertions. + /* make initial capacity exact for our insertions. */ git_vector_init(&x, 3, NULL); git_vector_insert(&x, (void*) 0xabc); git_vector_insert(&x, (void*) 0xdef); git_vector_insert(&x, (void*) 0x123); - git_vector_remove(&x, 0); // used to read past array bounds. + git_vector_remove(&x, 0); /* used to read past array bounds. */ git_vector_free(&x); } diff --git a/tests/date/rfc2822.c b/tests/date/rfc2822.c index eda475ac9..d98c1f05e 100644 --- a/tests/date/rfc2822.c +++ b/tests/date/rfc2822.c @@ -31,7 +31,7 @@ void test_date_rfc2822__format_rfc2822_negative_offset(void) void test_date_rfc2822__format_rfc2822_buffer_too_small(void) { - // "Wed, 10 Apr 2014 08:21:03 +0000" + /* "Wed, 10 Apr 2014 08:21:03 +0000" */ git_time t = {1397031663 + 86400, 0}; char buf[GIT_DATE_RFC2822_SZ-1]; diff --git a/tests/describe/t6120.c b/tests/describe/t6120.c index 6df397ec6..65e8582aa 100644 --- a/tests/describe/t6120.c +++ b/tests/describe/t6120.c @@ -2,7 +2,7 @@ #include "describe_helpers.h" #include "repository.h" -// Ported from https://github.com/git/git/blob/adfc1857bdb090786fd9d22c1acec39371c76048/t/t6120-describe.sh +/* Ported from https://github.com/git/git/blob/adfc1857bdb090786fd9d22c1acec39371c76048/t/t6120-describe.sh */ static git_repository *repo; diff --git a/tests/index/conflicts.c b/tests/index/conflicts.c index cabef888c..367d5b5bc 100644 --- a/tests/index/conflicts.c +++ b/tests/index/conflicts.c @@ -9,7 +9,7 @@ static git_index *repo_index; #define TEST_REPO_PATH "mergedrepo" #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_index_conflicts__initialize(void) { repo = cl_git_sandbox_init("mergedrepo"); diff --git a/tests/index/names.c b/tests/index/names.c index 5fa4b4e72..11d2c416a 100644 --- a/tests/index/names.c +++ b/tests/index/names.c @@ -10,7 +10,7 @@ static git_index *repo_index; #define TEST_REPO_PATH "mergedrepo" #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_index_names__initialize(void) { repo = cl_git_sandbox_init("mergedrepo"); diff --git a/tests/index/nsec.c b/tests/index/nsec.c index a20e3ead8..dee1509e1 100644 --- a/tests/index/nsec.c +++ b/tests/index/nsec.c @@ -9,7 +9,7 @@ static git_index *repo_index; #define TEST_REPO_PATH "nsecs" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_index_nsec__initialize(void) { repo = cl_git_sandbox_init("nsecs"); diff --git a/tests/index/reuc.c b/tests/index/reuc.c index 134f499af..1489ed13e 100644 --- a/tests/index/reuc.c +++ b/tests/index/reuc.c @@ -18,7 +18,7 @@ static git_index *repo_index; #define TWO_OUR_OID "8f3c06cff9a83757cec40c80bc9bf31a2582bde9" #define TWO_THEIR_OID "887b153b165d32409c70163e0f734c090f12f673" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_index_reuc__initialize(void) { repo = cl_git_sandbox_init("mergedrepo"); diff --git a/tests/index/stage.c b/tests/index/stage.c index 58dc1fb5e..cdfe3a811 100644 --- a/tests/index/stage.c +++ b/tests/index/stage.c @@ -8,7 +8,7 @@ static git_index *repo_index; #define TEST_REPO_PATH "mergedrepo" #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_index_stage__initialize(void) { repo = cl_git_sandbox_init("mergedrepo"); diff --git a/tests/merge/files.c b/tests/merge/files.c index 6f5a1fd9c..27c96363f 100644 --- a/tests/merge/files.c +++ b/tests/merge/files.c @@ -15,7 +15,7 @@ static git_repository *repo; static git_index *repo_index; -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_merge_files__initialize(void) { git_config *cfg; diff --git a/tests/merge/trees/automerge.c b/tests/merge/trees/automerge.c index 67f2cf786..e16b829ee 100644 --- a/tests/merge/trees/automerge.c +++ b/tests/merge/trees/automerge.c @@ -55,7 +55,7 @@ static git_repository *repo; "", \ "5c3b68a71fc4fa5d362fd3875e53137c6a5ab7a5" } -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_merge_trees_automerge__initialize(void) { repo = cl_git_sandbox_init(TEST_REPO_PATH); diff --git a/tests/merge/trees/modeconflict.c b/tests/merge/trees/modeconflict.c index d858b8f66..e85e340b9 100644 --- a/tests/merge/trees/modeconflict.c +++ b/tests/merge/trees/modeconflict.c @@ -13,7 +13,7 @@ static git_repository *repo; #define DF_SIDE1_BRANCH "df_side1" #define DF_SIDE2_BRANCH "df_side2" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_merge_trees_modeconflict__initialize(void) { repo = cl_git_sandbox_init(TEST_REPO_PATH); diff --git a/tests/merge/trees/renames.c b/tests/merge/trees/renames.c index 853bf2fa0..fbcfd2d3b 100644 --- a/tests/merge/trees/renames.c +++ b/tests/merge/trees/renames.c @@ -13,7 +13,7 @@ static git_repository *repo; #define BRANCH_RENAME_OURS "rename_conflict_ours" #define BRANCH_RENAME_THEIRS "rename_conflict_theirs" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_merge_trees_renames__initialize(void) { repo = cl_git_sandbox_init(TEST_REPO_PATH); diff --git a/tests/merge/trees/trivial.c b/tests/merge/trees/trivial.c index c7f8d2423..4a8255624 100644 --- a/tests/merge/trees/trivial.c +++ b/tests/merge/trees/trivial.c @@ -13,7 +13,7 @@ static git_repository *repo; #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_merge_trees_trivial__initialize(void) { repo = cl_git_sandbox_init(TEST_REPO_PATH); diff --git a/tests/merge/trees/whitespace.c b/tests/merge/trees/whitespace.c index b99583cb3..fdb11253b 100644 --- a/tests/merge/trees/whitespace.c +++ b/tests/merge/trees/whitespace.c @@ -16,7 +16,7 @@ static git_repository *repo; #define BRANCH_A_CHANGE "branch_a_change" #define BRANCH_B_CHANGE "branch_b_change" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_merge_trees_whitespace__initialize(void) { repo = cl_git_sandbox_init(TEST_REPO_PATH); diff --git a/tests/merge/workdir/analysis.c b/tests/merge/workdir/analysis.c index 84885c4fa..f87fc58b0 100644 --- a/tests/merge/workdir/analysis.c +++ b/tests/merge/workdir/analysis.c @@ -24,7 +24,7 @@ static git_index *repo_index; #define NOFASTFORWARD_ID "7cb63eed597130ba4abb87b3e544b85021905520" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_merge_workdir_analysis__initialize(void) { repo = cl_git_sandbox_init(TEST_REPO_PATH); diff --git a/tests/merge/workdir/renames.c b/tests/merge/workdir/renames.c index fabcda2a8..a8ee59a44 100644 --- a/tests/merge/workdir/renames.c +++ b/tests/merge/workdir/renames.c @@ -14,7 +14,7 @@ static git_repository *repo; #define BRANCH_RENAME_OURS "rename_conflict_ours" #define BRANCH_RENAME_THEIRS "rename_conflict_theirs" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_merge_workdir_renames__initialize(void) { git_config *cfg; diff --git a/tests/merge/workdir/setup.c b/tests/merge/workdir/setup.c index 92524e2ed..3a8f9d987 100644 --- a/tests/merge/workdir/setup.c +++ b/tests/merge/workdir/setup.c @@ -31,7 +31,7 @@ static git_index *repo_index; #define OCTO5_BRANCH "octo5" #define OCTO5_OID "e4f618a2c3ed0669308735727df5ebf2447f022f" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_merge_workdir_setup__initialize(void) { repo = cl_git_sandbox_init(TEST_REPO_PATH); diff --git a/tests/merge/workdir/simple.c b/tests/merge/workdir/simple.c index 32b20623f..cff1a5765 100644 --- a/tests/merge/workdir/simple.c +++ b/tests/merge/workdir/simple.c @@ -73,7 +73,7 @@ static git_index *repo_index; "5c3b68a71fc4fa5d362fd3875e53137c6a5ab7a5" } -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_merge_workdir_simple__initialize(void) { git_config *cfg; diff --git a/tests/merge/workdir/submodules.c b/tests/merge/workdir/submodules.c index c4cc188a8..35280e61e 100644 --- a/tests/merge/workdir/submodules.c +++ b/tests/merge/workdir/submodules.c @@ -16,7 +16,7 @@ static git_repository *repo; #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_merge_workdir_submodules__initialize(void) { repo = cl_git_sandbox_init(TEST_REPO_PATH); diff --git a/tests/merge/workdir/trivial.c b/tests/merge/workdir/trivial.c index 85cce493a..39d1ddc9b 100644 --- a/tests/merge/workdir/trivial.c +++ b/tests/merge/workdir/trivial.c @@ -14,7 +14,7 @@ static git_index *repo_index; #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index" -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_merge_workdir_trivial__initialize(void) { repo = cl_git_sandbox_init(TEST_REPO_PATH); diff --git a/tests/network/refspecs.c b/tests/network/refspecs.c index 15d36245b..1a65fd246 100644 --- a/tests/network/refspecs.c +++ b/tests/network/refspecs.c @@ -18,7 +18,7 @@ static void assert_refspec(unsigned int direction, const char *input, bool is_ex void test_network_refspecs__parsing(void) { - // Ported from https://github.com/git/git/blob/abd2bde78bd994166900290434a2048e660dabed/t/t5511-refspec.sh + /* Ported from https://github.com/git/git/blob/abd2bde78bd994166900290434a2048e660dabed/t/t5511-refspec.sh */ assert_refspec(GIT_DIRECTION_PUSH, "", false); assert_refspec(GIT_DIRECTION_PUSH, ":", true); @@ -40,8 +40,8 @@ void test_network_refspecs__parsing(void) * code. They will be caught downstream anyway, but we may want to * have tighter check later... */ - //assert_refspec(GIT_DIRECTION_PUSH, "refs/heads/master::refs/remotes/frotz/xyzzy", false); - //assert_refspec(GIT_DIRECTION_PUSH, "refs/heads/maste :refs/remotes/frotz/xyzzy", false); + /*assert_refspec(GIT_DIRECTION_PUSH, "refs/heads/master::refs/remotes/frotz/xyzzy", false); */ + /*assert_refspec(GIT_DIRECTION_PUSH, "refs/heads/maste :refs/remotes/frotz/xyzzy", false); */ assert_refspec(GIT_DIRECTION_FETCH, "refs/heads/*:refs/remotes/frotz/*", true); assert_refspec(GIT_DIRECTION_FETCH, "refs/heads/*:refs/remotes/frotz", false); 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; diff --git a/tests/rebase/abort.c b/tests/rebase/abort.c index d8891fb1d..a83c529ce 100644 --- a/tests/rebase/abort.c +++ b/tests/rebase/abort.c @@ -8,7 +8,7 @@ static git_repository *repo; -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_rebase_abort__initialize(void) { repo = cl_git_sandbox_init("rebase"); diff --git a/tests/rebase/inmemory.c b/tests/rebase/inmemory.c index 367d6b3ac..040a81b1b 100644 --- a/tests/rebase/inmemory.c +++ b/tests/rebase/inmemory.c @@ -7,7 +7,7 @@ static git_repository *repo; static git_signature *signature; -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_rebase_inmemory__initialize(void) { repo = cl_git_sandbox_init("rebase"); diff --git a/tests/rebase/iterator.c b/tests/rebase/iterator.c index db57b0a83..49a601243 100644 --- a/tests/rebase/iterator.c +++ b/tests/rebase/iterator.c @@ -8,7 +8,7 @@ static git_repository *repo; static git_index *_index; static git_signature *signature; -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_rebase_iterator__initialize(void) { repo = cl_git_sandbox_init("rebase"); diff --git a/tests/rebase/merge.c b/tests/rebase/merge.c index 7b2d6876c..830593707 100644 --- a/tests/rebase/merge.c +++ b/tests/rebase/merge.c @@ -19,7 +19,7 @@ static void set_core_autocrlf_to(git_repository *repo, bool value) git_config_free(cfg); } -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_rebase_merge__initialize(void) { repo = cl_git_sandbox_init("rebase"); diff --git a/tests/rebase/setup.c b/tests/rebase/setup.c index b07a83af6..f00294574 100644 --- a/tests/rebase/setup.c +++ b/tests/rebase/setup.c @@ -8,7 +8,7 @@ static git_repository *repo; static git_index *_index; static git_signature *signature; -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_rebase_setup__initialize(void) { repo = cl_git_sandbox_init("rebase"); diff --git a/tests/rebase/submodule.c b/tests/rebase/submodule.c index f71b94f7f..5aa9ceb37 100644 --- a/tests/rebase/submodule.c +++ b/tests/rebase/submodule.c @@ -10,7 +10,7 @@ static git_repository *repo; static git_signature *signature; -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_rebase_submodule__initialize(void) { git_index *index; diff --git a/tests/refs/delete.c b/tests/refs/delete.c index 8cad31686..4cc78aa9c 100644 --- a/tests/refs/delete.c +++ b/tests/refs/delete.c @@ -27,7 +27,7 @@ void test_refs_delete__cleanup(void) void test_refs_delete__packed_loose(void) { - // deleting a ref which is both packed and loose should remove both tracks in the filesystem + /* deleting a ref which is both packed and loose should remove both tracks in the filesystem */ git_reference *looked_up_ref, *another_looked_up_ref; git_buf temp_path = GIT_BUF_INIT; @@ -57,7 +57,7 @@ void test_refs_delete__packed_loose(void) void test_refs_delete__packed_only(void) { - // can delete a just packed reference + /* can delete a just packed reference */ git_reference *ref; git_refdb *refdb; git_oid id; diff --git a/tests/refs/list.c b/tests/refs/list.c index 97461fd69..3e8c82c94 100644 --- a/tests/refs/list.c +++ b/tests/refs/list.c @@ -22,7 +22,7 @@ void test_refs_list__cleanup(void) void test_refs_list__all(void) { - // try to list all the references in our test repo + /* try to list all the references in our test repo */ git_strarray ref_list; cl_git_pass(git_reference_list(&ref_list, g_repo)); diff --git a/tests/refs/normalize.c b/tests/refs/normalize.c index f9c525edc..c692eda77 100644 --- a/tests/refs/normalize.c +++ b/tests/refs/normalize.c @@ -4,7 +4,7 @@ #include "git2/reflog.h" #include "reflog.h" -// Helpers +/* Helpers */ static void ensure_refname_normalized( unsigned int flags, const char *input_refname, @@ -149,7 +149,7 @@ void test_refs_normalize__symbolic(void) void test_refs_normalize__jgit_suite(void) { - // tests borrowed from JGit + /* tests borrowed from JGit */ /* EmptyString */ ensure_refname_invalid( @@ -316,9 +316,10 @@ void test_refs_normalize__jgit_suite(void) ensure_refname_normalized( GIT_REF_FORMAT_ALLOW_ONELEVEL, "refs/heads/}", "refs/heads/}"); - // This is valid on UNIX, but not on Windows - // hence we make in invalid due to non-portability - // + /* + * This is valid on UNIX, but not on Windows + * hence we make in invalid due to non-portability + */ ensure_refname_invalid( GIT_REF_FORMAT_ALLOW_ONELEVEL, "refs/heads/\\"); diff --git a/tests/refs/overwrite.c b/tests/refs/overwrite.c index 5aea2a764..2e499b75e 100644 --- a/tests/refs/overwrite.c +++ b/tests/refs/overwrite.c @@ -23,7 +23,7 @@ void test_refs_overwrite__cleanup(void) void test_refs_overwrite__symbolic(void) { - // Overwrite an existing symbolic reference + /* Overwrite an existing symbolic reference */ git_reference *ref, *branch_ref; /* The target needds to exist and we need to check the name has changed */ @@ -53,7 +53,7 @@ void test_refs_overwrite__symbolic(void) void test_refs_overwrite__object_id(void) { - // Overwrite an existing object id reference + /* Overwrite an existing object id reference */ git_reference *ref; git_oid id; @@ -85,7 +85,7 @@ void test_refs_overwrite__object_id(void) void test_refs_overwrite__object_id_with_symbolic(void) { - // Overwrite an existing object id reference with a symbolic one + /* Overwrite an existing object id reference with a symbolic one */ git_reference *ref; git_oid id; @@ -110,7 +110,7 @@ void test_refs_overwrite__object_id_with_symbolic(void) void test_refs_overwrite__symbolic_with_object_id(void) { - // Overwrite an existing symbolic reference with an object id one + /* Overwrite an existing symbolic reference with an object id one */ git_reference *ref; git_oid id; diff --git a/tests/refs/read.c b/tests/refs/read.c index c00b016ee..3c7a0a1bf 100644 --- a/tests/refs/read.c +++ b/tests/refs/read.c @@ -28,7 +28,7 @@ void test_refs_read__cleanup(void) void test_refs_read__loose_tag(void) { - // lookup a loose tag reference + /* lookup a loose tag reference */ git_reference *reference; git_object *object; git_buf ref_name_from_tag_name = GIT_BUF_INIT; @@ -54,7 +54,7 @@ void test_refs_read__loose_tag(void) void test_refs_read__nonexisting_tag(void) { - // lookup a loose tag reference that doesn't exist + /* lookup a loose tag reference that doesn't exist */ git_reference *reference; cl_git_fail(git_reference_lookup(&reference, g_repo, non_existing_tag_ref_name)); @@ -65,7 +65,7 @@ void test_refs_read__nonexisting_tag(void) void test_refs_read__symbolic(void) { - // lookup a symbolic reference + /* lookup a symbolic reference */ git_reference *reference, *resolved_ref; git_object *object; git_oid id; @@ -93,7 +93,7 @@ void test_refs_read__symbolic(void) void test_refs_read__nested_symbolic(void) { - // lookup a nested symbolic reference + /* lookup a nested symbolic reference */ git_reference *reference, *resolved_ref; git_object *object; git_oid id; @@ -121,7 +121,7 @@ void test_refs_read__nested_symbolic(void) void test_refs_read__head_then_master(void) { - // lookup the HEAD and resolve the master branch + /* lookup the HEAD and resolve the master branch */ git_reference *reference, *resolved_ref, *comp_base_ref; cl_git_pass(git_reference_lookup(&reference, g_repo, head_tracker_sym_ref_name)); @@ -145,7 +145,7 @@ void test_refs_read__head_then_master(void) void test_refs_read__master_then_head(void) { - // lookup the master branch and then the HEAD + /* lookup the master branch and then the HEAD */ git_reference *reference, *master_ref, *resolved_ref; cl_git_pass(git_reference_lookup(&master_ref, g_repo, current_head_target)); @@ -162,7 +162,7 @@ void test_refs_read__master_then_head(void) void test_refs_read__packed(void) { - // lookup a packed reference + /* lookup a packed reference */ git_reference *reference; git_object *object; @@ -182,7 +182,7 @@ void test_refs_read__packed(void) void test_refs_read__loose_first(void) { - // assure that a loose reference is looked up before a packed reference + /* assure that a loose reference is looked up before a packed reference */ git_reference *reference; cl_git_pass(git_reference_lookup(&reference, g_repo, packed_head_name)); diff --git a/tests/refs/reflog/reflog.c b/tests/refs/reflog/reflog.c index a4484631a..ec251da08 100644 --- a/tests/refs/reflog/reflog.c +++ b/tests/refs/reflog/reflog.c @@ -11,7 +11,7 @@ static const char *current_master_tip = "a65fedf39aefe402d3bb6e24df4d4f5fe454775 static git_repository *g_repo; -// helpers +/* helpers */ static void assert_signature(const git_signature *expected, const git_signature *actual) { cl_assert(actual); @@ -22,15 +22,15 @@ static void assert_signature(const git_signature *expected, const git_signature } -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_refs_reflog_reflog__initialize(void) { - g_repo = cl_git_sandbox_init("testrepo.git"); + g_repo = cl_git_sandbox_init("testrepo.git"); } void test_refs_reflog_reflog__cleanup(void) { - cl_git_sandbox_cleanup(); + cl_git_sandbox_cleanup(); } static void assert_appends(const git_signature *committer, const git_oid *oid) diff --git a/tests/refs/rename.c b/tests/refs/rename.c index e3e51485e..6ec8f65ea 100644 --- a/tests/refs/rename.c +++ b/tests/refs/rename.c @@ -34,7 +34,7 @@ void test_refs_rename__cleanup(void) void test_refs_rename__loose(void) { - // rename a loose reference + /* rename a loose reference */ git_reference *looked_up_ref, *new_ref, *another_looked_up_ref; git_buf temp_path = GIT_BUF_INIT; const char *new_name = "refs/tags/Nemo/knows/refs.kung-fu"; @@ -76,7 +76,7 @@ void test_refs_rename__loose(void) void test_refs_rename__packed(void) { - // rename a packed reference (should make it loose) + /* rename a packed reference (should make it loose) */ git_reference *looked_up_ref, *new_ref, *another_looked_up_ref; git_buf temp_path = GIT_BUF_INIT; const char *brand_new_name = "refs/heads/brand_new_name"; @@ -118,7 +118,7 @@ void test_refs_rename__packed(void) void test_refs_rename__packed_doesnt_pack_others(void) { - // renaming a packed reference does not pack another reference which happens to be in both loose and pack state + /* renaming a packed reference does not pack another reference which happens to be in both loose and pack state */ git_reference *looked_up_ref, *another_looked_up_ref, *renamed_ref; git_buf temp_path = GIT_BUF_INIT; const char *brand_new_name = "refs/heads/brand_new_name"; @@ -160,7 +160,7 @@ void test_refs_rename__packed_doesnt_pack_others(void) void test_refs_rename__name_collision(void) { - // can not rename a reference with the name of an existing reference + /* can not rename a reference with the name of an existing reference */ git_reference *looked_up_ref, *renamed_ref; /* An existing reference... */ @@ -179,7 +179,7 @@ void test_refs_rename__name_collision(void) void test_refs_rename__invalid_name(void) { - // can not rename a reference with an invalid name + /* can not rename a reference with an invalid name */ git_reference *looked_up_ref, *renamed_ref; /* An existing oid reference... */ @@ -205,7 +205,7 @@ void test_refs_rename__invalid_name(void) void test_refs_rename__force_loose_packed(void) { - // can force-rename a packed reference with the name of an existing loose and packed reference + /* can force-rename a packed reference with the name of an existing loose and packed reference */ git_reference *looked_up_ref, *renamed_ref; git_oid oid; @@ -230,7 +230,7 @@ void test_refs_rename__force_loose_packed(void) void test_refs_rename__force_loose(void) { - // can force-rename a loose reference with the name of an existing loose reference + /* can force-rename a loose reference with the name of an existing loose reference */ git_reference *looked_up_ref, *renamed_ref; git_oid oid; @@ -258,7 +258,7 @@ void test_refs_rename__force_loose(void) void test_refs_rename__overwrite(void) { - // can not overwrite name of existing reference + /* can not overwrite name of existing reference */ git_reference *ref, *ref_one, *ref_one_new, *ref_two; git_refdb *refdb; git_oid id; @@ -292,7 +292,7 @@ void test_refs_rename__overwrite(void) void test_refs_rename__prefix(void) { - // can be renamed to a new name prefixed with the old name + /* can be renamed to a new name prefixed with the old name */ git_reference *ref, *ref_two, *looked_up_ref, *renamed_ref; git_oid id; @@ -325,7 +325,7 @@ void test_refs_rename__prefix(void) void test_refs_rename__move_up(void) { - // can move a reference to a upper reference hierarchy + /* can move a reference to a upper reference hierarchy */ git_reference *ref, *ref_two, *looked_up_ref, *renamed_ref; git_oid id; diff --git a/tests/refs/setter.c b/tests/refs/setter.c index 2b42ff253..03c214618 100644 --- a/tests/refs/setter.c +++ b/tests/refs/setter.c @@ -65,7 +65,7 @@ void test_refs_setter__update_symbolic(void) void test_refs_setter__cant_update_direct_with_symbolic(void) { - // Overwrite an existing object id reference with a symbolic one + /* Overwrite an existing object id reference with a symbolic one */ git_reference *ref, *new; git_oid id; @@ -80,7 +80,7 @@ void test_refs_setter__cant_update_direct_with_symbolic(void) void test_refs_setter__cant_update_symbolic_with_direct(void) { - // Overwrite an existing symbolic reference with an object id one + /* Overwrite an existing symbolic reference with an object id one */ git_reference *ref, *new; git_oid id; diff --git a/tests/repo/discover.c b/tests/repo/discover.c index b13c97bd9..cc61c7125 100644 --- a/tests/repo/discover.c +++ b/tests/repo/discover.c @@ -58,7 +58,7 @@ static void write_file(const char *path, const char *content) cl_git_pass(error); } -//no check is performed on ceiling_dirs length, so be sure it's long enough +/*no check is performed on ceiling_dirs length, so be sure it's long enough */ static void append_ceiling_dir(git_buf *ceiling_dirs, const char *path) { git_buf pretty_path = GIT_BUF_INIT; diff --git a/tests/revert/bare.c b/tests/revert/bare.c index 206c86d70..fda2b82b0 100644 --- a/tests/revert/bare.c +++ b/tests/revert/bare.c @@ -11,7 +11,7 @@ static git_repository *repo; -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_revert_bare__initialize(void) { repo = cl_git_sandbox_init(TEST_REPO_PATH); diff --git a/tests/revert/workdir.c b/tests/revert/workdir.c index 86047350a..53bb0e439 100644 --- a/tests/revert/workdir.c +++ b/tests/revert/workdir.c @@ -12,7 +12,7 @@ static git_repository *repo; static git_index *repo_index; -// Fixture setup and teardown +/* Fixture setup and teardown */ void test_revert_workdir__initialize(void) { git_config *cfg; diff --git a/tests/stash/apply.c b/tests/stash/apply.c index 986eba0f3..16cb14000 100644 --- a/tests/stash/apply.c +++ b/tests/stash/apply.c @@ -422,7 +422,7 @@ void test_stash_apply__uses_reflog_like_indices_1(void) cl_git_pass(git_stash_save(&oid, repo, signature, NULL, GIT_STASH_INCLUDE_UNTRACKED)); assert_status(repo, "untracked", GIT_ENOTFOUND); - // stash@{1} is the oldest (first) stash we made + /* stash@{1} is the oldest (first) stash we made */ cl_git_pass(git_stash_apply(repo, 1, NULL)); cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); assert_status(repo, "what", GIT_STATUS_WT_MODIFIED); @@ -441,7 +441,7 @@ void test_stash_apply__uses_reflog_like_indices_2(void) cl_git_pass(git_stash_save(&oid, repo, signature, NULL, GIT_STASH_INCLUDE_UNTRACKED)); assert_status(repo, "untracked", GIT_ENOTFOUND); - // stash@{0} is the newest stash we made immediately above + /* stash@{0} is the newest stash we made immediately above */ cl_git_pass(git_stash_apply(repo, 0, NULL)); cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); diff --git a/tests/status/status_data.h b/tests/status/status_data.h index 8ad4235fd..09b9827f2 100644 --- a/tests/status/status_data.h +++ b/tests/status/status_data.h @@ -1,6 +1,6 @@ #include "status_helpers.h" -// A utf-8 string with 83 characters, but 249 bytes. +/* A utf-8 string with 83 characters, but 249 bytes. */ static const char *longname = "\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97"; diff --git a/tests/status/worktree.c b/tests/status/worktree.c index bb9f8ec97..7abc703db 100644 --- a/tests/status/worktree.c +++ b/tests/status/worktree.c @@ -260,7 +260,7 @@ void test_status_worktree__within_subdir(void) pathsArray.strings = paths; opts.pathspec = pathsArray; - // We committed zzz_new_dir/new_file above. It shouldn't be reported. + /* We committed zzz_new_dir/new_file above. It shouldn't be reported. */ cl_git_pass( git_status_foreach_ext(repo, &opts, cb_status__normal, &counts) ); @@ -957,7 +957,7 @@ void test_status_worktree__long_filenames(void) git_status_options opts = GIT_STATUS_OPTIONS_INIT; status_entry_counts counts = {0}; - // Create directory with amazingly long filename + /* Create directory with amazingly long filename */ sprintf(path, "empty_standard_repo/%s", longname); cl_git_pass(git_futils_mkdir_r(path, 0777)); sprintf(path, "empty_standard_repo/%s/foo", longname); diff --git a/tests/threads/basic.c b/tests/threads/basic.c index af6049090..9ce740cf9 100644 --- a/tests/threads/basic.c +++ b/tests/threads/basic.c @@ -19,7 +19,7 @@ void test_threads_basic__cleanup(void) void test_threads_basic__cache(void) { - // run several threads polling the cache at the same time + /* run several threads polling the cache at the same time */ cl_assert(1 == 1); } diff --git a/tests/worktree/config.c b/tests/worktree/config.c index 3ab317bb5..81dcfe1fa 100644 --- a/tests/worktree/config.c +++ b/tests/worktree/config.c @@ -36,8 +36,10 @@ void test_worktree_config__set(void) cl_git_pass(git_config_set_int32(cfg, "core.dummy", 5)); git_config_free(cfg); - // reopen to verify configuration has been set in the - // common dir + /* + * reopen to verify configuration has been set in the + * common dir + */ cl_git_pass(git_repository_config(&cfg, fixture.repo)); cl_git_pass(git_config_get_int32(&val, cfg, "core.dummy")); cl_assert_equal_i(val, 5); |
