diff options
author | schu <schu-github@schulog.org> | 2011-05-18 12:35:57 +0200 |
---|---|---|
committer | schu <schu-github@schulog.org> | 2011-05-18 12:36:41 +0200 |
commit | 6628c2560c73315a208378919510e1c2cf01f4cd (patch) | |
tree | 18d05f0cef064ba6334f2b254785193b9aae2f93 /tests/test_lib.h | |
parent | c9662061f25ea51f39018a278b98c9a9b4410e84 (diff) | |
download | libgit2-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-x | tests/test_lib.h | 3 |
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)) |