From: Bastian Dehn Date: Tue, 12 Mar 2024 20:43:12 +0000 (+0100) Subject: add tests for option twenty to twentytwo X-Git-Tag: v1.0.0^2~85 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=5f25941e7229e4c1d7cd534e788b927535f91ef2;p=sane-kds-s2000w-net.git add tests for option twenty to twentytwo --- diff --git a/tests/kds_s2000w_net_tests.c b/tests/kds_s2000w_net_tests.c index 608e60b..699c45e 100644 --- a/tests/kds_s2000w_net_tests.c +++ b/tests/kds_s2000w_net_tests.c @@ -409,6 +409,55 @@ START_TEST(sane_kds_s2000w_net_control_get_option_nineteen) } END_TEST +START_TEST(sane_kds_s2000w_net_control_get_option_twenty) +{ + handler* h = init_handler(); + int option_num = 0; + int value = -1; + + _sane_kds_s2000w_net_control_option(h, 0, SANE_ACTION_GET_VALUE, &option_num, NULL); + _sane_kds_s2000w_net_control_option(h, 20, SANE_ACTION_GET_VALUE, &value, NULL); + + ck_assert_int_eq(option_num, 24); + ck_assert_int_eq(value, 0); + free_handler(h); + h = NULL; +} +END_TEST + +START_TEST(sane_kds_s2000w_net_control_get_option_twentyone) +{ + handler* h = init_handler(); + int option_num = 0; + int value = -1; + + _sane_kds_s2000w_net_control_option(h, 0, SANE_ACTION_GET_VALUE, &option_num, NULL); + _sane_kds_s2000w_net_control_option(h, 21, SANE_ACTION_GET_VALUE, &value, NULL); + + ck_assert_int_eq(option_num, 24); + ck_assert_int_eq(value, 0); + free_handler(h); + h = NULL; +} +END_TEST + + +START_TEST(sane_kds_s2000w_net_control_get_option_twentytwo) +{ + handler* h = init_handler(); + int option_num = 0; + int value = -1; + + _sane_kds_s2000w_net_control_option(h, 0, SANE_ACTION_GET_VALUE, &option_num, NULL); + _sane_kds_s2000w_net_control_option(h, 22, SANE_ACTION_GET_VALUE, &value, NULL); + + ck_assert_int_eq(option_num, 24); + ck_assert_int_eq(value, 140); + free_handler(h); + h = NULL; +} +END_TEST + Suite* net_tests() { Suite* net_tests_suite = suite_create("kds_s2000w_net"); @@ -437,6 +486,9 @@ Suite* net_tests() tcase_add_test(net_tests, sane_kds_s2000w_net_control_get_option_seventeen); tcase_add_test(net_tests, sane_kds_s2000w_net_control_get_option_eightteen); tcase_add_test(net_tests, sane_kds_s2000w_net_control_get_option_nineteen); + tcase_add_test(net_tests, sane_kds_s2000w_net_control_get_option_twenty); + tcase_add_test(net_tests, sane_kds_s2000w_net_control_get_option_twentyone); + tcase_add_test(net_tests, sane_kds_s2000w_net_control_get_option_twentytwo); suite_add_tcase(net_tests_suite, net_tests); return net_tests_suite; } \ No newline at end of file