diff options
author | Patrick Steinhardt <ps@pks.im> | 2020-06-08 12:57:48 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2020-06-08 12:57:48 +0200 |
commit | 9e4e25b11b20ad2eb848a86041cc3c2ca62ea846 (patch) | |
tree | 5a6fd6583d83375c1864646546863d9815cdcaf9 /tests | |
parent | 45901d3e03d16c59ddae76aa0d7acca8a4888738 (diff) | |
download | libgit2-9e4e25b11b20ad2eb848a86041cc3c2ca62ea846.tar.gz |
tests: refs: modernize coding style of testcase
The coding style of the testcase refs::create::propagate_eexists is not
really up-to-date. Convert it to use a more modern coding style.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/refs/create.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/refs/create.c b/tests/refs/create.c index 20ac579b3..01eb62a52 100644 --- a/tests/refs/create.c +++ b/tests/refs/create.c @@ -212,17 +212,12 @@ void test_refs_create__oid_unknown_fails_by_default(void) void test_refs_create__propagate_eexists(void) { - int error; git_oid oid; - git_reference *ref; /* Make sure it works for oid and for symbolic both */ - git_oid_fromstr(&oid, current_master_tip); - error = git_reference_create(&ref, g_repo, current_head_target, &oid, false, NULL); - cl_assert(error == GIT_EEXISTS); - - error = git_reference_symbolic_create(&ref, g_repo, "HEAD", current_head_target, false, NULL); - cl_assert(error == GIT_EEXISTS); + cl_git_pass(git_oid_fromstr(&oid, current_master_tip)); + cl_git_fail_with(GIT_EEXISTS, git_reference_create(NULL, g_repo, current_head_target, &oid, false, NULL)); + cl_git_fail_with(GIT_EEXISTS, git_reference_symbolic_create(NULL, g_repo, "HEAD", current_head_target, false, NULL)); } void test_refs_create__existing_dir_propagates_edirectory(void) |