]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
migrate test cancel
authorBastian Dehn <hhaalo@arcor.de>
Sun, 17 Mar 2024 13:22:50 +0000 (14:22 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 17 Mar 2024 13:22:50 +0000 (14:22 +0100)
tests/kds_s2000w_net_tests.c
tests/kds_s2000w_net_tests.h
tests/runtests.c

index ab33b99c3141eab75c357608eca74d30bcb2a6df..8d854963895c4e7fb81cb60910fe29bc1cafa05c 100644 (file)
@@ -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;
index 8d4a0238f93bdbe8d12eed88015a91acc85ea490..9bae39a14e9905ce4c65ca63b0c8824494714b78 100644 (file)
@@ -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
index df9b9cbb895c0284dbba62ebd1865248d545ccaf..0f1cb7f4bd322e2a562aff1bf833145ab2ee404d 100644 (file)
@@ -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);