summaryrefslogtreecommitdiffstats
path: root/src/tests/cmocka/test_be_ptask.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2015-03-09 21:48:11 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-03-24 18:15:21 +0100
commit8d1ae1f350f5618f1d8f00211d6db6b025e52dd6 (patch)
tree7aa5411c9a4ff075f79a9a42b8eaf275f73f4875 /src/tests/cmocka/test_be_ptask.c
parentcbab37e665d948278a491733e3993ac62beb0427 (diff)
downloadsssd-8d1ae1f350f5618f1d8f00211d6db6b025e52dd6.tar.gz
sssd-8d1ae1f350f5618f1d8f00211d6db6b025e52dd6.tar.xz
sssd-8d1ae1f350f5618f1d8f00211d6db6b025e52dd6.zip
tests: convert all unit tests to cmocka 1.0 or later
All tests now use the cmocka-1.0-compatible API. Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/tests/cmocka/test_be_ptask.c')
-rw-r--r--src/tests/cmocka/test_be_ptask.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tests/cmocka/test_be_ptask.c b/src/tests/cmocka/test_be_ptask.c
index 205204214..f4a120c0c 100644
--- a/src/tests/cmocka/test_be_ptask.c
+++ b/src/tests/cmocka/test_be_ptask.c
@@ -34,7 +34,7 @@
#define PERIOD 1
#define new_test(test) \
- unit_test_setup_teardown(test_ ## test, test_setup, test_teardown)
+ cmocka_unit_test_setup_teardown(test_ ## test, test_setup, test_teardown)
struct test_ctx {
struct be_ctx *be_ctx;
@@ -265,7 +265,7 @@ errno_t test_be_ptask_sync_error(TALLOC_CTX *mem_ctx,
return ERR_INTERNAL;
}
-void test_setup(void **state)
+static int test_setup(void **state)
{
struct test_ctx *test_ctx = NULL;
@@ -282,12 +282,14 @@ void test_setup(void **state)
assert_non_null(test_ctx->be_ctx->ev);
*state = test_ctx;
+ return 0;
}
-void test_teardown(void **state)
+static int test_teardown(void **state)
{
talloc_zfree(*state);
assert_true(leak_check_teardown());
+ return 0;
}
void test_be_ptask_create_einval_be(void **state)
@@ -944,7 +946,7 @@ int main(int argc, const char *argv[])
POPT_TABLEEND
};
- const UnitTest tests[] = {
+ const struct CMUnitTest tests[] = {
new_test(be_ptask_create_einval_be),
new_test(be_ptask_create_einval_period),
new_test(be_ptask_create_einval_send),
@@ -987,5 +989,5 @@ int main(int argc, const char *argv[])
DEBUG_CLI_INIT(debug_level);
- return run_tests(tests);
+ return cmocka_run_group_tests(tests, NULL, NULL);
}