Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2014-07-01 22:09:01 +0400
committerEdward Thomson <ethomson@edwardthomson.com>2014-07-01 22:40:16 +0400
commit0cee70ebb7297f155129e0d05f5a23be82231256 (patch)
tree6d98f55d737f4187e58f2a180ffb75f05b98bfba /tests/repo
parente1fc03c9baea9864dec90d0aef7aadcc2ff20576 (diff)
Introduce cl_assert_equal_oid
Diffstat (limited to 'tests/repo')
-rw-r--r--tests/repo/hashfile.c12
-rw-r--r--tests/repo/head.c4
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/repo/hashfile.c b/tests/repo/hashfile.c
index 4cc9f18b4..ae8e122f6 100644
--- a/tests/repo/hashfile.c
+++ b/tests/repo/hashfile.c
@@ -22,14 +22,14 @@ void test_repo_hashfile__simple(void)
/* hash with repo relative path */
cl_git_pass(git_odb_hashfile(&a, "status/current_file", GIT_OBJ_BLOB));
cl_git_pass(git_repository_hashfile(&b, _repo, "current_file", GIT_OBJ_BLOB, NULL));
- cl_assert(git_oid_equal(&a, &b));
+ cl_assert_equal_oid(&a, &b);
cl_git_pass(git_buf_joinpath(&full, git_repository_workdir(_repo), "current_file"));
/* hash with full path */
cl_git_pass(git_odb_hashfile(&a, full.ptr, GIT_OBJ_BLOB));
cl_git_pass(git_repository_hashfile(&b, _repo, full.ptr, GIT_OBJ_BLOB, NULL));
- cl_assert(git_oid_equal(&a, &b));
+ cl_assert_equal_oid(&a, &b);
/* hash with invalid type */
cl_git_fail(git_odb_hashfile(&a, full.ptr, GIT_OBJ_ANY));
@@ -58,12 +58,12 @@ void test_repo_hashfile__filtered(void)
/* equal hashes because filter is binary */
cl_git_pass(git_odb_hashfile(&a, "status/testfile.bin", GIT_OBJ_BLOB));
cl_git_pass(git_repository_hashfile(&b, _repo, "testfile.bin", GIT_OBJ_BLOB, NULL));
- cl_assert(git_oid_equal(&a, &b));
+ cl_assert_equal_oid(&a, &b);
/* equal hashes when 'as_file' points to binary filtering */
cl_git_pass(git_odb_hashfile(&a, "status/testfile.txt", GIT_OBJ_BLOB));
cl_git_pass(git_repository_hashfile(&b, _repo, "testfile.txt", GIT_OBJ_BLOB, "foo.bin"));
- cl_assert(git_oid_equal(&a, &b));
+ cl_assert_equal_oid(&a, &b);
/* not equal hashes when 'as_file' points to text filtering */
cl_git_pass(git_odb_hashfile(&a, "status/testfile.bin", GIT_OBJ_BLOB));
@@ -73,11 +73,11 @@ void test_repo_hashfile__filtered(void)
/* equal hashes when 'as_file' is empty and turns off filtering */
cl_git_pass(git_odb_hashfile(&a, "status/testfile.txt", GIT_OBJ_BLOB));
cl_git_pass(git_repository_hashfile(&b, _repo, "testfile.txt", GIT_OBJ_BLOB, ""));
- cl_assert(git_oid_equal(&a, &b));
+ cl_assert_equal_oid(&a, &b);
cl_git_pass(git_odb_hashfile(&a, "status/testfile.bin", GIT_OBJ_BLOB));
cl_git_pass(git_repository_hashfile(&b, _repo, "testfile.bin", GIT_OBJ_BLOB, ""));
- cl_assert(git_oid_equal(&a, &b));
+ cl_assert_equal_oid(&a, &b);
/* some hash type failures */
cl_git_fail(git_odb_hashfile(&a, "status/testfile.txt", 0));
diff --git a/tests/repo/head.c b/tests/repo/head.c
index 79892a3ea..d678e150e 100644
--- a/tests/repo/head.c
+++ b/tests/repo/head.c
@@ -229,13 +229,13 @@ static void test_reflog(git_repository *repo, size_t idx,
if (old_spec) {
git_object *obj;
cl_git_pass(git_revparse_single(&obj, repo, old_spec));
- cl_assert_equal_i(0, git_oid_cmp(git_object_id(obj), git_reflog_entry_id_old(entry)));
+ cl_assert_equal_oid(git_object_id(obj), git_reflog_entry_id_old(entry));
git_object_free(obj);
}
if (new_spec) {
git_object *obj;
cl_git_pass(git_revparse_single(&obj, repo, new_spec));
- cl_assert_equal_i(0, git_oid_cmp(git_object_id(obj), git_reflog_entry_id_new(entry)));
+ cl_assert_equal_oid(git_object_id(obj), git_reflog_entry_id_new(entry));
git_object_free(obj);
}