summaryrefslogtreecommitdiff
path: root/tests-clar/commit
diff options
context:
space:
mode:
Diffstat (limited to 'tests-clar/commit')
-rw-r--r--tests-clar/commit/parse.c12
-rw-r--r--tests-clar/commit/write.c12
2 files changed, 12 insertions, 12 deletions
diff --git a/tests-clar/commit/parse.c b/tests-clar/commit/parse.c
index 1ef2bfe2b..9d291bbc2 100644
--- a/tests-clar/commit/parse.c
+++ b/tests-clar/commit/parse.c
@@ -159,8 +159,8 @@ void test_commit_parse__signature(void)
size_t len = strlen(passcase->string);
struct git_signature person = {0};
cl_git_pass(git_signature__parse(&person, &str, str + len, passcase->header, '\n'));
- cl_assert(strcmp(passcase->name, person.name) == 0);
- cl_assert(strcmp(passcase->email, person.email) == 0);
+ cl_assert_equal_s(passcase->name, person.name);
+ cl_assert_equal_s(passcase->email, person.email);
cl_assert(passcase->time == person.when.time);
cl_assert(passcase->offset == person.when.offset);
git__free(person.name); git__free(person.email);
@@ -347,10 +347,10 @@ void test_commit_parse__details0(void) {
commit_time = git_commit_time(commit);
parents = git_commit_parentcount(commit);
- cl_assert(strcmp(author->name, "Scott Chacon") == 0);
- cl_assert(strcmp(author->email, "schacon@gmail.com") == 0);
- cl_assert(strcmp(committer->name, "Scott Chacon") == 0);
- cl_assert(strcmp(committer->email, "schacon@gmail.com") == 0);
+ cl_assert_equal_s("Scott Chacon", author->name);
+ cl_assert_equal_s("schacon@gmail.com", author->email);
+ cl_assert_equal_s("Scott Chacon", committer->name);
+ cl_assert_equal_s("schacon@gmail.com", committer->email);
cl_assert(message != NULL);
cl_assert(strchr(message, '\n') != NULL);
cl_assert(commit_time > 0);
diff --git a/tests-clar/commit/write.c b/tests-clar/commit/write.c
index 7b9868b89..88e2f32fb 100644
--- a/tests-clar/commit/write.c
+++ b/tests-clar/commit/write.c
@@ -78,19 +78,19 @@ void test_commit_write__from_memory(void)
/* Check attributes were set correctly */
author1 = git_commit_author(commit);
cl_assert(author1 != NULL);
- cl_assert(strcmp(author1->name, committer_name) == 0);
- cl_assert(strcmp(author1->email, committer_email) == 0);
+ cl_assert_equal_s(committer_name, author1->name);
+ cl_assert_equal_s(committer_email, author1->email);
cl_assert(author1->when.time == 987654321);
cl_assert(author1->when.offset == 90);
committer1 = git_commit_committer(commit);
cl_assert(committer1 != NULL);
- cl_assert(strcmp(committer1->name, committer_name) == 0);
- cl_assert(strcmp(committer1->email, committer_email) == 0);
+ cl_assert_equal_s(committer_name, committer1->name);
+ cl_assert_equal_s(committer_email, committer1->email);
cl_assert(committer1->when.time == 123456789);
cl_assert(committer1->when.offset == 60);
- cl_assert(strcmp(git_commit_message(commit), commit_message) == 0);
+ cl_assert_equal_s(commit_message, git_commit_message(commit));
}
// create a root commit
@@ -142,5 +142,5 @@ void test_commit_write__root(void)
cl_git_pass(git_reference_lookup(&branch, g_repo, branch_name));
branch_oid = git_reference_target(branch);
cl_git_pass(git_oid_cmp(branch_oid, &commit_id));
- cl_assert(!strcmp(git_commit_message(commit), root_commit_message));
+ cl_assert_equal_s(root_commit_message, git_commit_message(commit));
}