diff options
Diffstat (limited to 'tests/index')
| -rw-r--r-- | tests/index/conflicts.c | 26 | ||||
| -rw-r--r-- | tests/index/crlf.c | 12 | ||||
| -rw-r--r-- | tests/index/read_tree.c | 2 | ||||
| -rw-r--r-- | tests/index/rename.c | 4 | ||||
| -rw-r--r-- | tests/index/reuc.c | 54 | ||||
| -rw-r--r-- | tests/index/tests.c | 8 |
6 files changed, 53 insertions, 53 deletions
diff --git a/tests/index/conflicts.c b/tests/index/conflicts.c index 90aaa442d..427351693 100644 --- a/tests/index/conflicts.c +++ b/tests/index/conflicts.c @@ -107,13 +107,13 @@ void test_index_conflicts__get(void) cl_assert_equal_s("conflicts-one.txt", conflict_entry[0]->path); git_oid_fromstr(&oid, CONFLICTS_ONE_ANCESTOR_OID); - cl_assert(git_oid_cmp(&conflict_entry[0]->id, &oid) == 0); + cl_assert_equal_oid(&oid, &conflict_entry[0]->id); git_oid_fromstr(&oid, CONFLICTS_ONE_OUR_OID); - cl_assert(git_oid_cmp(&conflict_entry[1]->id, &oid) == 0); + cl_assert_equal_oid(&oid, &conflict_entry[1]->id); git_oid_fromstr(&oid, CONFLICTS_ONE_THEIR_OID); - cl_assert(git_oid_cmp(&conflict_entry[2]->id, &oid) == 0); + cl_assert_equal_oid(&oid, &conflict_entry[2]->id); cl_git_pass(git_index_conflict_get(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], repo_index, "conflicts-two.txt")); @@ -121,13 +121,13 @@ void test_index_conflicts__get(void) cl_assert_equal_s("conflicts-two.txt", conflict_entry[0]->path); git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID); - cl_assert(git_oid_cmp(&conflict_entry[0]->id, &oid) == 0); + cl_assert_equal_oid(&oid, &conflict_entry[0]->id); git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID); - cl_assert(git_oid_cmp(&conflict_entry[1]->id, &oid) == 0); + cl_assert_equal_oid(&oid, &conflict_entry[1]->id); git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID); - cl_assert(git_oid_cmp(&conflict_entry[2]->id, &oid) == 0); + cl_assert_equal_oid(&oid, &conflict_entry[2]->id); } void test_index_conflicts__iterate(void) @@ -141,29 +141,29 @@ void test_index_conflicts__iterate(void) cl_git_pass(git_index_conflict_next(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], iterator)); git_oid_fromstr(&oid, CONFLICTS_ONE_ANCESTOR_OID); - cl_assert(git_oid_cmp(&conflict_entry[0]->id, &oid) == 0); + cl_assert_equal_oid(&oid, &conflict_entry[0]->id); cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-one.txt") == 0); git_oid_fromstr(&oid, CONFLICTS_ONE_OUR_OID); - cl_assert(git_oid_cmp(&conflict_entry[1]->id, &oid) == 0); + cl_assert_equal_oid(&oid, &conflict_entry[1]->id); cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-one.txt") == 0); git_oid_fromstr(&oid, CONFLICTS_ONE_THEIR_OID); - cl_assert(git_oid_cmp(&conflict_entry[2]->id, &oid) == 0); + cl_assert_equal_oid(&oid, &conflict_entry[2]->id); cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-one.txt") == 0); cl_git_pass(git_index_conflict_next(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], iterator)); git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID); - cl_assert(git_oid_cmp(&conflict_entry[0]->id, &oid) == 0); + cl_assert_equal_oid(&oid, &conflict_entry[0]->id); cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-two.txt") == 0); git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID); - cl_assert(git_oid_cmp(&conflict_entry[1]->id, &oid) == 0); + cl_assert_equal_oid(&oid, &conflict_entry[1]->id); cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-two.txt") == 0); git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID); - cl_assert(git_oid_cmp(&conflict_entry[2]->id, &oid) == 0); + cl_assert_equal_oid(&oid, &conflict_entry[2]->id); cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-two.txt") == 0); cl_assert(git_index_conflict_next(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], iterator) == GIT_ITEROVER); @@ -281,7 +281,7 @@ void test_index_conflicts__partial(void) cl_git_pass(git_index_conflict_get(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], repo_index, "test-one.txt")); - cl_assert(git_oid_cmp(&ancestor_entry.id, &conflict_entry[0]->id) == 0); + cl_assert_equal_oid(&ancestor_entry.id, &conflict_entry[0]->id); cl_assert(conflict_entry[1] == NULL); cl_assert(conflict_entry[2] == NULL); } diff --git a/tests/index/crlf.c b/tests/index/crlf.c index 7babd5939..23f47932f 100644 --- a/tests/index/crlf.c +++ b/tests/index/crlf.c @@ -41,7 +41,7 @@ void test_index_crlf__autocrlf_false_no_attrs(void) cl_git_pass(git_oid_fromstr(&oid, (GIT_EOL_NATIVE == GIT_EOL_CRLF) ? FILE_OID_CRLF : FILE_OID_LF)); - cl_assert(git_oid_cmp(&oid, &entry->id) == 0); + cl_assert_equal_oid(&oid, &entry->id); } void test_index_crlf__autocrlf_true_no_attrs(void) @@ -58,7 +58,7 @@ void test_index_crlf__autocrlf_true_no_attrs(void) entry = git_index_get_bypath(g_index, "newfile.txt", 0); cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF)); - cl_assert(git_oid_cmp(&oid, &entry->id) == 0); + cl_assert_equal_oid(&oid, &entry->id); } void test_index_crlf__autocrlf_input_no_attrs(void) @@ -75,7 +75,7 @@ void test_index_crlf__autocrlf_input_no_attrs(void) entry = git_index_get_bypath(g_index, "newfile.txt", 0); cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF)); - cl_assert(git_oid_cmp(&oid, &entry->id) == 0); + cl_assert_equal_oid(&oid, &entry->id); } void test_index_crlf__autocrlf_false_text_auto_attr(void) @@ -94,7 +94,7 @@ void test_index_crlf__autocrlf_false_text_auto_attr(void) entry = git_index_get_bypath(g_index, "newfile.txt", 0); cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF)); - cl_assert(git_oid_cmp(&oid, &entry->id) == 0); + cl_assert_equal_oid(&oid, &entry->id); } void test_index_crlf__autocrlf_true_text_auto_attr(void) @@ -113,7 +113,7 @@ void test_index_crlf__autocrlf_true_text_auto_attr(void) entry = git_index_get_bypath(g_index, "newfile.txt", 0); cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF)); - cl_assert(git_oid_cmp(&oid, &entry->id) == 0); + cl_assert_equal_oid(&oid, &entry->id); } void test_index_crlf__autocrlf_input_text_auto_attr(void) @@ -132,7 +132,7 @@ void test_index_crlf__autocrlf_input_text_auto_attr(void) entry = git_index_get_bypath(g_index, "newfile.txt", 0); cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF)); - cl_assert(git_oid_cmp(&oid, &entry->id) == 0); + cl_assert_equal_oid(&oid, &entry->id); } void test_index_crlf__safecrlf_true_no_attrs(void) diff --git a/tests/index/read_tree.c b/tests/index/read_tree.c index 6c6b40121..0e1882818 100644 --- a/tests/index/read_tree.c +++ b/tests/index/read_tree.c @@ -37,7 +37,7 @@ void test_index_read_tree__read_write_involution(void) git_tree_free(tree); cl_git_pass(git_index_write_tree(&tree_oid, index)); - cl_assert(git_oid_cmp(&expected, &tree_oid) == 0); + cl_assert_equal_oid(&expected, &tree_oid); git_index_free(index); git_repository_free(repo); diff --git a/tests/index/rename.c b/tests/index/rename.c index b6fb61d10..dd3cfa732 100644 --- a/tests/index/rename.c +++ b/tests/index/rename.c @@ -27,7 +27,7 @@ void test_index_rename__single_file(void) cl_assert(!git_index_find(&position, index, "lame.name.txt")); entry = git_index_get_byindex(index, position); - cl_assert(git_oid_cmp(&expected, &entry->id) == 0); + cl_assert_equal_oid(&expected, &entry->id); /* This removes the entry from the index, but not from the object database */ cl_git_pass(git_index_remove(index, "lame.name.txt", 0)); @@ -41,7 +41,7 @@ void test_index_rename__single_file(void) cl_assert(!git_index_find(&position, index, "fancy.name.txt")); entry = git_index_get_byindex(index, position); - cl_assert(git_oid_cmp(&expected, &entry->id) == 0); + cl_assert_equal_oid(&expected, &entry->id); git_index_free(index); git_repository_free(repo); diff --git a/tests/index/reuc.c b/tests/index/reuc.c index 27240a30f..0b4d71a6a 100644 --- a/tests/index/reuc.c +++ b/tests/index/reuc.c @@ -53,9 +53,9 @@ void test_index_reuc__add(void) cl_assert(reuc->mode[0] == 0100644); cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); - cl_assert(git_oid_cmp(&reuc->oid[0], &ancestor_oid) == 0); - cl_assert(git_oid_cmp(&reuc->oid[1], &our_oid) == 0); - cl_assert(git_oid_cmp(&reuc->oid[2], &their_oid) == 0); + cl_assert_equal_oid(&reuc->oid[0], &ancestor_oid); + cl_assert_equal_oid(&reuc->oid[1], &our_oid); + cl_assert_equal_oid(&reuc->oid[2], &their_oid); } void test_index_reuc__add_no_ancestor(void) @@ -78,9 +78,9 @@ void test_index_reuc__add_no_ancestor(void) cl_assert(reuc->mode[0] == 0); cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); - cl_assert(git_oid_cmp(&reuc->oid[0], &ancestor_oid) == 0); - cl_assert(git_oid_cmp(&reuc->oid[1], &our_oid) == 0); - cl_assert(git_oid_cmp(&reuc->oid[2], &their_oid) == 0); + cl_assert_equal_oid(&reuc->oid[0], &ancestor_oid); + cl_assert_equal_oid(&reuc->oid[1], &our_oid); + cl_assert_equal_oid(&reuc->oid[2], &their_oid); } void test_index_reuc__read_bypath(void) @@ -97,11 +97,11 @@ void test_index_reuc__read_bypath(void) cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); git_oid_fromstr(&oid, TWO_ANCESTOR_OID); - cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[0], &oid); git_oid_fromstr(&oid, TWO_OUR_OID); - cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[1], &oid); git_oid_fromstr(&oid, TWO_THEIR_OID); - cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[2], &oid); cl_assert(reuc = git_index_reuc_get_bypath(repo_index, "one.txt")); @@ -110,11 +110,11 @@ void test_index_reuc__read_bypath(void) cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); git_oid_fromstr(&oid, ONE_ANCESTOR_OID); - cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[0], &oid); git_oid_fromstr(&oid, ONE_OUR_OID); - cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[1], &oid); git_oid_fromstr(&oid, ONE_THEIR_OID); - cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[2], &oid); } void test_index_reuc__ignore_case(void) @@ -142,11 +142,11 @@ void test_index_reuc__ignore_case(void) cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); git_oid_fromstr(&oid, TWO_ANCESTOR_OID); - cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[0], &oid); git_oid_fromstr(&oid, TWO_OUR_OID); - cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[1], &oid); git_oid_fromstr(&oid, TWO_THEIR_OID); - cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[2], &oid); } void test_index_reuc__read_byindex(void) @@ -163,11 +163,11 @@ void test_index_reuc__read_byindex(void) cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); git_oid_fromstr(&oid, ONE_ANCESTOR_OID); - cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[0], &oid); git_oid_fromstr(&oid, ONE_OUR_OID); - cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[1], &oid); git_oid_fromstr(&oid, ONE_THEIR_OID); - cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[2], &oid); cl_assert(reuc = git_index_reuc_get_byindex(repo_index, 1)); @@ -176,11 +176,11 @@ void test_index_reuc__read_byindex(void) cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); git_oid_fromstr(&oid, TWO_ANCESTOR_OID); - cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[0], &oid); git_oid_fromstr(&oid, TWO_OUR_OID); - cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[1], &oid); git_oid_fromstr(&oid, TWO_THEIR_OID); - cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[2], &oid); } void test_index_reuc__updates_existing(void) @@ -216,11 +216,11 @@ void test_index_reuc__updates_existing(void) cl_assert_equal_s("TWO.txt", reuc->path); git_oid_fromstr(&oid, TWO_OUR_OID); - cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[0], &oid); git_oid_fromstr(&oid, TWO_THEIR_OID); - cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[1], &oid); git_oid_fromstr(&oid, TWO_ANCESTOR_OID); - cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[2], &oid); } void test_index_reuc__remove(void) @@ -242,11 +242,11 @@ void test_index_reuc__remove(void) cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); git_oid_fromstr(&oid, TWO_ANCESTOR_OID); - cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[0], &oid); git_oid_fromstr(&oid, TWO_OUR_OID); - cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[1], &oid); git_oid_fromstr(&oid, TWO_THEIR_OID); - cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0); + cl_assert_equal_oid(&reuc->oid[2], &oid); } void test_index_reuc__write(void) diff --git a/tests/index/tests.c b/tests/index/tests.c index fa5c0bb1a..373889912 100644 --- a/tests/index/tests.c +++ b/tests/index/tests.c @@ -243,11 +243,11 @@ void test_index_tests__add(void) entry = git_index_get_byindex(index, 0); /* And the built-in hashing mechanism worked as expected */ - cl_assert(git_oid_cmp(&id1, &entry->id) == 0); + cl_assert_equal_oid(&id1, &entry->id); /* Test access by path instead of index */ cl_assert((entry = git_index_get_bypath(index, "test.txt", 0)) != NULL); - cl_assert(git_oid_cmp(&id1, &entry->id) == 0); + cl_assert_equal_oid(&id1, &entry->id); git_index_free(index); git_repository_free(repo); @@ -283,14 +283,14 @@ void test_index_tests__add_issue_1397(void) /* Make sure the initial SHA-1 is correct */ cl_assert((entry = git_index_get_bypath(index, "crlf_file.txt", 0)) != NULL); - cl_assert_(git_oid_cmp(&id1, &entry->id) == 0, "first oid check"); + cl_assert_equal_oid(&id1, &entry->id); /* Update the index */ cl_git_pass(git_index_add_bypath(index, "crlf_file.txt")); /* Check the new SHA-1 */ cl_assert((entry = git_index_get_bypath(index, "crlf_file.txt", 0)) != NULL); - cl_assert_(git_oid_cmp(&id1, &entry->id) == 0, "second oid check"); + cl_assert_equal_oid(&id1, &entry->id); git_index_free(index); } |
