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:
Diffstat (limited to 'tests-clar/notes/notesref.c')
-rw-r--r--tests-clar/notes/notesref.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests-clar/notes/notesref.c b/tests-clar/notes/notesref.c
index 79ad0afee..c89b71ba5 100644
--- a/tests-clar/notes/notesref.c
+++ b/tests-clar/notes/notesref.c
@@ -16,10 +16,17 @@ void test_notes_notesref__initialize(void)
void test_notes_notesref__cleanup(void)
{
git_note_free(_note);
+ _note = NULL;
+
git_signature_free(_sig);
+ _sig = NULL;
+
git_config_free(_cfg);
+ _cfg = NULL;
git_repository_free(_repo);
+ _repo = NULL;
+
cl_fixture_cleanup("testrepo.git");
}
@@ -35,23 +42,23 @@ void test_notes_notesref__config_corenotesref(void)
cl_git_pass(git_config_set_string(_cfg, "core.notesRef", "refs/notes/mydefaultnotesref"));
- cl_git_pass(git_note_create(&note_oid, _repo, _sig, _sig, NULL, &oid, "test123test\n"));
+ cl_git_pass(git_note_create(&note_oid, _repo, _sig, _sig, NULL, &oid, "test123test\n", 0));
cl_git_pass(git_note_read(&_note, _repo, NULL, &oid));
- cl_assert(!strcmp(git_note_message(_note), "test123test\n"));
+ cl_assert_equal_s("test123test\n", git_note_message(_note));
cl_assert(!git_oid_cmp(git_note_oid(_note), &note_oid));
git_note_free(_note);
cl_git_pass(git_note_read(&_note, _repo, "refs/notes/mydefaultnotesref", &oid));
- cl_assert(!strcmp(git_note_message(_note), "test123test\n"));
+ cl_assert_equal_s("test123test\n", git_note_message(_note));
cl_assert(!git_oid_cmp(git_note_oid(_note), &note_oid));
cl_git_pass(git_note_default_ref(&default_ref, _repo));
- cl_assert(!strcmp(default_ref, "refs/notes/mydefaultnotesref"));
+ cl_assert_equal_s("refs/notes/mydefaultnotesref", default_ref);
- cl_git_pass(git_config_delete(_cfg, "core.notesRef"));
+ cl_git_pass(git_config_delete_entry(_cfg, "core.notesRef"));
cl_git_pass(git_note_default_ref(&default_ref, _repo));
- cl_assert(!strcmp(default_ref, GIT_NOTES_DEFAULT_REF));
+ cl_assert_equal_s(GIT_NOTES_DEFAULT_REF, default_ref);
}