]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
migrate net init test
authorBastian Dehn <hhaalo@arcor.de>
Sun, 17 Mar 2024 11:26:35 +0000 (12:26 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 17 Mar 2024 11:26:35 +0000 (12:26 +0100)
tests/kds_s2000w_net_tests.c
tests/kds_s2000w_net_tests.h
tests/runtests.c

index e8937208c3d027ada529134795899f74ba28b9e9..ecc646a83cd9ca2802df293c8d3b29add3af62c5 100644 (file)
@@ -117,19 +117,18 @@ void kds_s2000w_net_get_devices()
        device_list = NULL;
 }
 
-START_TEST(kds_s2000w_net_init)
+void kds_s2000w_net_init()
 {
        SANE_Int* version = malloc(sizeof(SANE_Int));
 
        SANE_Status status = _sane_kds_s2000w_net_init(version, NULL);
 
-       ck_assert_int_eq(*version, SANE_VERSION_CODE(1, 0, 0));
-       ck_assert_int_eq(status, SANE_STATUS_GOOD);
+       assert_int_equal(*version, SANE_VERSION_CODE(1, 0, 0));
+       assert_int_equal(status, SANE_STATUS_GOOD);
 
        free(version);
        version = NULL;
 }
-END_TEST
 
 START_TEST(kds_s2000w_net_get_devices_only_remote)
 {
@@ -558,7 +557,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, kds_s2000w_net_init);
        tcase_add_test(net_tests, kds_s2000w_net_get_devices_only_remote);
        tcase_add_test(net_tests, kds_s2000w_net_set_io_mode);
        tcase_add_test(net_tests, kds_s2000w_net_get_select_fd);
index 3dd4a45aa34c065292311c6783b7536eb1a2f8e7..25ce35960fc5d22690657ff3507f7e0a7da2e71b 100644 (file)
@@ -10,6 +10,7 @@
 
 void kds_s2000w_net_get_parameters_with_image_data();
 void kds_s2000w_net_get_devices();
+void kds_s2000w_net_init();
 Suite* net_tests();
 
 #endif
\ No newline at end of file
index 3890108cb1e5d987e8546e8664543c1ea8024820..b03bd1e95219fa429aa08d8af079a143c3a1289f 100644 (file)
@@ -46,7 +46,8 @@ int run_cmocka_tests()
 
        const struct CMUnitTest net_tests[] = {
                cmocka_unit_test(kds_s2000w_net_get_parameters_with_image_data),
-               cmocka_unit_test(kds_s2000w_net_get_devices)
+               cmocka_unit_test(kds_s2000w_net_get_devices),
+               cmocka_unit_test(kds_s2000w_net_init)
        };
 
        result = cmocka_run_group_tests(net_read_tests, NULL, NULL);