From ea65a783a3fa1999cdf350c197286aa8fec2f53e Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 17 Mar 2024 14:22:50 +0100 Subject: [PATCH] migrate test cancel --- tests/kds_s2000w_net_tests.c | 6 ++---- tests/kds_s2000w_net_tests.h | 1 + tests/runtests.c | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/kds_s2000w_net_tests.c b/tests/kds_s2000w_net_tests.c index ab33b99..8d85496 100644 --- a/tests/kds_s2000w_net_tests.c +++ b/tests/kds_s2000w_net_tests.c @@ -517,18 +517,17 @@ void sane_kds_s2000w_net_get_parameter_cancel() h = NULL; } -START_TEST(sane_kds_s2000w_net_cancel) +void sane_kds_s2000w_net_cancel() { handler* h = init_handler(); _sane_kds_s2000w_net_cancel(h); - ck_assert_int_eq(h->read_info->cancel, 1); + assert_int_equal(h->read_info->cancel, 1); free_handler(h); h = NULL; } -END_TEST START_TEST(sane_kds_s2000w_net_open) { @@ -552,7 +551,6 @@ Suite* net_tests() Suite* net_tests_suite = suite_create("kds_s2000w_net"); TCase* net_tests = tcase_create("kds_s2000w_net_tests"); - tcase_add_test(net_tests, sane_kds_s2000w_net_cancel); tcase_add_test(net_tests, sane_kds_s2000w_net_open); suite_add_tcase(net_tests_suite, net_tests); return net_tests_suite; diff --git a/tests/kds_s2000w_net_tests.h b/tests/kds_s2000w_net_tests.h index 8d4a023..9bae39a 100644 --- a/tests/kds_s2000w_net_tests.h +++ b/tests/kds_s2000w_net_tests.h @@ -37,6 +37,7 @@ void sane_kds_s2000w_net_control_get_option_twentyone(); void sane_kds_s2000w_net_control_get_option_twentytwo(); void sane_kds_s2000w_net_start_cancel(); void sane_kds_s2000w_net_get_parameter_cancel(); +void sane_kds_s2000w_net_cancel(); Suite* net_tests(); #endif \ No newline at end of file diff --git a/tests/runtests.c b/tests/runtests.c index df9b9cb..0f1cb7f 100644 --- a/tests/runtests.c +++ b/tests/runtests.c @@ -73,7 +73,8 @@ int run_cmocka_tests() cmocka_unit_test(sane_kds_s2000w_net_control_get_option_twentyone), cmocka_unit_test(sane_kds_s2000w_net_control_get_option_twentytwo), cmocka_unit_test(sane_kds_s2000w_net_start_cancel), - cmocka_unit_test(sane_kds_s2000w_net_get_parameter_cancel) + cmocka_unit_test(sane_kds_s2000w_net_get_parameter_cancel), + cmocka_unit_test(sane_kds_s2000w_net_cancel) }; result = cmocka_run_group_tests(net_read_tests, NULL, NULL); -- 2.39.5