From: Bastian Dehn Date: Tue, 30 Jul 2024 10:34:18 +0000 (+0200) Subject: remove max document length option X-Git-Tag: v1.0.4^2~13 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=6a907a50b81301d281fd52ba2f11e90b8a38610e;p=sane-kds-s2000w-net.git remove max document length option --- diff --git a/src/kds_s2000w_handler_opts.c b/src/kds_s2000w_handler_opts.c index 7360420..15d7b2c 100644 --- a/src/kds_s2000w_handler_opts.c +++ b/src/kds_s2000w_handler_opts.c @@ -6,7 +6,7 @@ #include "kds_s2000w_debug.h" #define AUTOSTART_ALWAYS_ON 1 -#define COUNT_CUSTOM_OPTIONS 1 +#define COUNT_CUSTOM_OPTIONS 0 void _write_string_value(json_object* value_object, void* value) { @@ -159,10 +159,6 @@ void kds_s2000w_handler_get_option(handler* h, int option, void* value, int* inf value_object = json_object_object_get(config, "BinarizationContrast"); _write_int_value(value_object, value); break; - case 21: - value_object = json_object_object_get(config, "MaxDocumentLength"); - _write_int_value(value_object, value); - break; default: break; } @@ -299,10 +295,6 @@ void kds_s2000w_handler_set_option(handler* h, int option, void* value, int* inf _write_int_value_to_json(value_object, value); break; case 21: - value_object = json_object_object_get(config, "MaxDocumentLength"); - _write_int_value_to_json(value_object, value); - break; - case 22: resp = kds_s2000w_client_response_init(); kds_s2000w_client_get_capabilities(resp); capabilities = json_tokener_parse(resp->data); diff --git a/src/kds_s2000w_option_descriptors.c b/src/kds_s2000w_option_descriptors.c index d2ce7b4..2bcfd49 100644 --- a/src/kds_s2000w_option_descriptors.c +++ b/src/kds_s2000w_option_descriptors.c @@ -537,8 +537,7 @@ void kds_s2000w_option_descriptor_init_option_descriptors() descriptor_array[18] = _kds_s2000w_option_descriptor_background_smoothing_mode(); descriptor_array[19] = _kds_s2000w_option_descriptor_background_smoothing_aggressiveness(); descriptor_array[20] = _kds_s2000w_option_descriptor_binarization_contrast(); - descriptor_array[21] = _kds_s2000w_option_descriptor_max_document_length(); - descriptor_array[22] = _kds_s2000w_option_descriptor_config_reset(); + descriptor_array[21] = _kds_s2000w_option_descriptor_config_reset(); } void kds_s2000w_option_descriptor_free_option_descriptors() diff --git a/src/kds_s2000w_option_descriptors.h b/src/kds_s2000w_option_descriptors.h index cede6bd..a7fda6e 100644 --- a/src/kds_s2000w_option_descriptors.h +++ b/src/kds_s2000w_option_descriptors.h @@ -2,7 +2,7 @@ #define KDS_S2000W_OPTION_DESCRIPTORS_H #include -#define MAX_OPTION_COUNT 23 +#define MAX_OPTION_COUNT 22 void kds_s2000w_option_descriptor_init_option_descriptors(); void kds_s2000w_option_descriptor_free_option_descriptors(); diff --git a/tests/kds_s2000w_net_get_opt_tests.c b/tests/kds_s2000w_net_get_opt_tests.c index 19d0eb9..a28ae4a 100644 --- a/tests/kds_s2000w_net_get_opt_tests.c +++ b/tests/kds_s2000w_net_get_opt_tests.c @@ -348,20 +348,3 @@ void sane_kds_s2000w_net_control_get_option_twenty(void** state) free_handler(h); h = NULL; } - -void sane_kds_s2000w_net_control_get_option_twentyone(void** state) -{ - response* resp = (response*) *state; - will_return(mock_response, resp); - will_return(__wrap_kds_s2000w_client_get_option, 0); - expect_function_call(__wrap_kds_s2000w_client_get_option); - handler* h = init_handler(); - int value = -1; - - _sane_kds_s2000w_net_control_option(h, 21, SANE_ACTION_GET_VALUE, &value, NULL); - - assert_int_equal(value, 140); - - free_handler(h); - h = NULL; -} diff --git a/tests/kds_s2000w_net_get_opt_tests.h b/tests/kds_s2000w_net_get_opt_tests.h index 84fa4e2..3947679 100644 --- a/tests/kds_s2000w_net_get_opt_tests.h +++ b/tests/kds_s2000w_net_get_opt_tests.h @@ -25,6 +25,5 @@ void sane_kds_s2000w_net_control_get_option_seventeen(void** state); void sane_kds_s2000w_net_control_get_option_eightteen(void** state); void sane_kds_s2000w_net_control_get_option_nineteen(void** state); void sane_kds_s2000w_net_control_get_option_twenty(void** state); -void sane_kds_s2000w_net_control_get_option_twentyone(void** state); #endif \ No newline at end of file diff --git a/tests/kds_s2000w_net_get_opt_tests_run.c b/tests/kds_s2000w_net_get_opt_tests_run.c index f9c93e3..24179cc 100644 --- a/tests/kds_s2000w_net_get_opt_tests_run.c +++ b/tests/kds_s2000w_net_get_opt_tests_run.c @@ -79,7 +79,6 @@ int main() cmocka_unit_test_setup_teardown(sane_kds_s2000w_net_control_get_option_eightteen, setup_default_get_option, teardown_default_get_option), cmocka_unit_test_setup_teardown(sane_kds_s2000w_net_control_get_option_nineteen, setup_default_get_option, teardown_default_get_option), cmocka_unit_test_setup_teardown(sane_kds_s2000w_net_control_get_option_twenty, setup_default_get_option, teardown_default_get_option), - cmocka_unit_test_setup_teardown(sane_kds_s2000w_net_control_get_option_twentyone, setup_default_get_option, teardown_default_get_option), }; return cmocka_run_group_tests(net_tests, NULL, NULL); diff --git a/tests/kds_s2000w_option_descriptor_tests.c b/tests/kds_s2000w_option_descriptor_tests.c index 40021b1..c8e9872 100644 --- a/tests/kds_s2000w_option_descriptor_tests.c +++ b/tests/kds_s2000w_option_descriptor_tests.c @@ -393,22 +393,6 @@ void kds_s2000w_option_get_descriptor_twentyone() { SANE_Option_Descriptor* option = kds_s2000w_option_get_descriptor(21); - assert_string_equal("maxdocumentlength", option->name); - assert_string_equal("maxdocumentlength", option->title); - assert_string_equal("maxdocumentlength", option->desc); - assert_int_equal(SANE_TYPE_INT, option->type); - assert_int_equal(SANE_UNIT_NONE, option->unit); - assert_int_equal(sizeof(SANE_Int), option->size); - assert_int_equal(SANE_CAP_SOFT_DETECT, option->cap); - assert_int_equal(SANE_CONSTRAINT_STRING_LIST, option->constraint_type); - assert_string_equal("#NoPrimaryControl#", option->constraint.string_list[0]); - assert_null(option->constraint.string_list[1]); -} - -void kds_s2000w_option_get_descriptor_twentytwo() -{ - SANE_Option_Descriptor* option = kds_s2000w_option_get_descriptor(22); - assert_string_equal("config-reset", option->name); assert_string_equal("Konfiguration zuruecksetzen", option->title); assert_string_equal("Laedt die default Konfiguration des Scanners", option->desc); diff --git a/tests/kds_s2000w_option_descriptor_tests.h b/tests/kds_s2000w_option_descriptor_tests.h index 2cddea1..8fe9564 100644 --- a/tests/kds_s2000w_option_descriptor_tests.h +++ b/tests/kds_s2000w_option_descriptor_tests.h @@ -30,5 +30,4 @@ void kds_s2000w_option_get_descriptor_eightteen(); void kds_s2000w_option_get_descriptor_nineteen(); void kds_s2000w_option_get_descriptor_twenty(); void kds_s2000w_option_get_descriptor_twentyone(); -void kds_s2000w_option_get_descriptor_twentytwo(); #endif \ No newline at end of file diff --git a/tests/kds_s2000w_option_descriptor_tests_run.c b/tests/kds_s2000w_option_descriptor_tests_run.c index aeb089d..7f6e1de 100644 --- a/tests/kds_s2000w_option_descriptor_tests_run.c +++ b/tests/kds_s2000w_option_descriptor_tests_run.c @@ -24,8 +24,7 @@ int main() cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_eightteen, setup, teardown), cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_nineteen, setup, teardown), cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_twenty, setup, teardown), - cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_twentyone, setup, teardown), - cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_twentytwo, setup, teardown) + cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_twentyone, setup, teardown) }; return cmocka_run_group_tests(option_descriptor_tests, NULL, NULL);