]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add get option multifeed sensitivity
authorBastian Dehn <hhaalo@arcor.de>
Sat, 15 Feb 2025 20:37:04 +0000 (21:37 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 15 Feb 2025 20:37:04 +0000 (21:37 +0100)
src/kds_s2000w_handler_opts.c
tests/kds_s2000w_net_get_opt_tests.c
tests/kds_s2000w_net_get_opt_tests.h
tests/kds_s2000w_net_get_opt_tests_run.c

index da1a42d38bb937e11c2e44af8639d443147b915d..125b8fa3153e0c919c3252145f19951ee9823cb5 100644 (file)
@@ -5,7 +5,7 @@
 #include "kds_s2000w_debug.h"
 
 #define AUTOSTART_ON 1
-#define OPTION_COUNT 23
+#define OPTION_COUNT 24
 
 void _kds_s2000w_handler_opts_write_string_value(json_object* value_object, void* value)
 {
@@ -201,6 +201,10 @@ void kds_s2000w_handler_opts_get_option(handler* h, uint32_t option, void* value
                        value_object = json_object_object_get(config, "BinarizationContrast");
                        _kds_s2000w_handler_opts_write_int_value(value_object, value);
                        break;
+               case 22:
+                       value_object = json_object_object_get(config, "MultifeedSensitivity");
+                       _kds_s2000w_handler_opts_write_string_value(value_object, value);
+                       break;
                default:
                        break;
        }
@@ -312,7 +316,7 @@ void kds_s2000w_handler_opts_set_option(handler* h, uint32_t option, void* value
                        value_object = json_object_object_get(config, "BinarizationContrast");
                        _kds_s2000w_handler_opts_write_int_value_to_json(value_object, value);
                        break;
-               case 22:
+               case 23:
                        _kds_s2000w_handler_opts_set_option_to_default(h);
                        _kds_s2000w_handler_opts_set_autostart_on(h);
 
index 00fbf46f9f2a3a9054e63d476c047e2f2a71ede4..6139e487deab1d24f61cc5e927585f15f054fea8 100644 (file)
@@ -22,7 +22,7 @@ void sane_kds_s2000w_net_control_get_option_zero_test(void** state)
 
        sane_kds_s2000w_net_control_option(h, 0, SANE_ACTION_GET_VALUE, &value, NULL);
 
-       assert_int_equal(value, 23);
+       assert_int_equal(value, 24);
 
        kds_s2000w_handler_free(h);
        h = NULL;
@@ -313,3 +313,18 @@ void sane_kds_s2000w_net_control_get_option_twentyone_test(void** state)
        kds_s2000w_handler_free(h);
        h = NULL;
 }
+
+void sane_kds_s2000w_net_control_get_option_twentytwo_test(void** state)
+{
+       handler* h = kds_s2000w_handler_init();
+       response* resp = (response*) *state;
+       h->current_scanner_config = json_tokener_parse(resp->data);
+       char* value[50] = {0};
+
+       sane_kds_s2000w_net_control_option(h, 22, SANE_ACTION_GET_VALUE, &value, NULL);
+
+       assert_string_equal(value, "None");
+
+       kds_s2000w_handler_free(h);
+       h = NULL;
+}
index f8b485c691422ed09b5665d03575eb60f25bd37c..034b5aacb3b327487c4844e0eba7543afc09353b 100644 (file)
@@ -26,5 +26,6 @@ void sane_kds_s2000w_net_control_get_option_eightteen_test(void** state);
 void sane_kds_s2000w_net_control_get_option_nineteen_test(void** state);
 void sane_kds_s2000w_net_control_get_option_twenty_test(void** state);
 void sane_kds_s2000w_net_control_get_option_twentyone_test(void** state);
+void sane_kds_s2000w_net_control_get_option_twentytwo_test(void** state);
 
 #endif
\ No newline at end of file
index 1729d2c8c471e0628ca233877cd91c3032177e3a..75d89acfaf90a4efd8c9d16be290d068576c9830 100644 (file)
@@ -95,7 +95,8 @@ int main()
                cmocka_unit_test_setup_teardown(sane_kds_s2000w_net_control_get_option_eightteen_test, setup_default_get_option, teardown_default_get_option),
                cmocka_unit_test_setup_teardown(sane_kds_s2000w_net_control_get_option_nineteen_test, setup_default_get_option, teardown_default_get_option),
                cmocka_unit_test_setup_teardown(sane_kds_s2000w_net_control_get_option_twenty_test, setup_default_get_option, teardown_default_get_option),
-               cmocka_unit_test_setup_teardown(sane_kds_s2000w_net_control_get_option_twentyone_test, setup_default_get_option, teardown_default_get_option)
+               cmocka_unit_test_setup_teardown(sane_kds_s2000w_net_control_get_option_twentyone_test, setup_default_get_option, teardown_default_get_option),
+               cmocka_unit_test_setup_teardown(sane_kds_s2000w_net_control_get_option_twentytwo_test, setup_default_get_option, teardown_default_get_option)
        };
 
        return cmocka_run_group_tests(net_tests, NULL, NULL);