summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2015-03-25 15:11:45 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-03-26 11:20:49 +0100
commit2233216c653247dd9cc06ce7db6f61f464299906 (patch)
tree70c69f3ebb313d1df78fb3c10e33a8cdbf23f708
parent50afd8b1dd782820fa31240e958df38c915ba5af (diff)
downloadsssd-2233216c653247dd9cc06ce7db6f61f464299906.tar.gz
sssd-2233216c653247dd9cc06ce7db6f61f464299906.tar.xz
sssd-2233216c653247dd9cc06ce7db6f61f464299906.zip
test_expire: Use right assertion macro for standard functions
Documentation to macro assert_return_code says: Assert that the return_code is greater than or equal to 0. The function prints an error message to standard error and terminates the test by calling fail() if the return code is smaller than 0. If the function you check sets an errno if it fails you can pass it to the function and it will be printed as part of the error message. So in case of error we will see more verbose message. Reviewed-by: Pavel Reichl <preichl@redhat.com>
-rw-r--r--src/tests/cmocka/test_expire_common.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tests/cmocka/test_expire_common.c b/src/tests/cmocka/test_expire_common.c
index 1698bd80e..5d3ea02f3 100644
--- a/src/tests/cmocka/test_expire_common.c
+++ b/src/tests/cmocka/test_expire_common.c
@@ -117,7 +117,8 @@ void expire_test_tz(const char* tz,
if (tz) {
ret = setenv("TZ", tz, 1);
- assert_false(ret == -1);
+
+ assert_return_code(ret, errno);
}
test_func(test_in, _test_out);
@@ -125,6 +126,6 @@ void expire_test_tz(const char* tz,
/* restore */
if (orig_tz != NULL) {
ret = setenv("TZ", orig_tz, 1);
- assert_false(ret == -1);
+ assert_return_code(ret, errno);
}
}