summaryrefslogtreecommitdiff
path: root/tests/index
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2020-02-07 11:53:51 +0100
committerPatrick Steinhardt <ps@pks.im>2020-02-07 11:53:51 +0100
commit2e6cbff86e74b6eaa9b90dc8adc205b9d940a481 (patch)
tree43b6f99dc07ff2e61f997de6081bd1ce85c72c09 /tests/index
parent7d65d4cb7d48cd4e4686d911fe10cdec792443cf (diff)
downloadlibgit2-2e6cbff86e74b6eaa9b90dc8adc205b9d940a481.tar.gz
tests: add missing error checks
We should always verify error codes returned by function calls in our test suite to not accidentally miss any weird results. Coverity reported missing checks in several locations, which this commit fixes.
Diffstat (limited to 'tests/index')
-rw-r--r--tests/index/nsec.c2
-rw-r--r--tests/index/tests.c3
2 files changed, 2 insertions, 3 deletions
diff --git a/tests/index/nsec.c b/tests/index/nsec.c
index dee1509e1..6edcf030a 100644
--- a/tests/index/nsec.c
+++ b/tests/index/nsec.c
@@ -54,7 +54,7 @@ static bool should_expect_nsecs(void)
expect = try_create_file_with_nsec_timestamp(nsec_path.ptr);
- p_unlink(nsec_path.ptr);
+ cl_must_pass(p_unlink(nsec_path.ptr));
git_buf_dispose(&nsec_path);
diff --git a/tests/index/tests.c b/tests/index/tests.c
index 4c9deaaba..d9d8371dd 100644
--- a/tests/index/tests.c
+++ b/tests/index/tests.c
@@ -566,8 +566,7 @@ void test_index_tests__cannot_add_invalid_filename(void)
{
git_repository *repo;
- p_mkdir("invalid", 0700);
-
+ cl_must_pass(p_mkdir("invalid", 0700));
cl_git_pass(git_repository_init(&repo, "./invalid", 0));
cl_must_pass(p_mkdir("./invalid/subdir", 0777));