summaryrefslogtreecommitdiff
path: root/tests/test_lib.h
diff options
context:
space:
mode:
authorschu <schu-github@schulog.org>2011-05-18 12:35:57 +0200
committerschu <schu-github@schulog.org>2011-05-18 12:36:41 +0200
commit6628c2560c73315a208378919510e1c2cf01f4cd (patch)
tree18d05f0cef064ba6334f2b254785193b9aae2f93 /tests/test_lib.h
parentc9662061f25ea51f39018a278b98c9a9b4410e84 (diff)
downloadlibgit2-6628c2560c73315a208378919510e1c2cf01f4cd.tar.gz
test_lib: add return value to git_test
Save the return value of functions not passing must_pass() and report the returned error. Signed-off-by: schu <schu-github@schulog.org>
Diffstat (limited to 'tests/test_lib.h')
-rwxr-xr-xtests/test_lib.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_lib.h b/tests/test_lib.h
index d0b62c8d4..f3febe857 100755
--- a/tests/test_lib.h
+++ b/tests/test_lib.h
@@ -38,8 +38,9 @@ typedef git_testsuite *(*libgit2_suite)(void);
void git_test__init(git_test *t, const char *name, const char *description);
void git_test__fail(git_test *tc, const char *file, int line, const char *message);
void git_test__assert(git_test *tc, const char *file, int line, const char *message, int condition);
+void git_test__assert_pass(git_test *tc, const char *file, int line, const char *message, int ret_value);
-#define must_pass(expr) git_test__assert(_gittest, __FILE__, __LINE__, "Method failed: " #expr, (expr) == 0)
+#define must_pass(expr) git_test__assert_pass(_gittest, __FILE__, __LINE__, "Method failed: " #expr, (expr))
#define must_fail(expr) git_test__assert(_gittest, __FILE__, __LINE__, "Expected method to fail: " #expr, (expr) < 0)
#define must_be_true(expr) git_test__assert(_gittest, __FILE__, __LINE__, "Expression is not true: " #expr, !!(expr))