]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
remove max document length option
authorBastian Dehn <hhaalo@arcor.de>
Tue, 30 Jul 2024 10:34:18 +0000 (12:34 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 30 Jul 2024 10:36:10 +0000 (12:36 +0200)
src/kds_s2000w_handler_opts.c
src/kds_s2000w_option_descriptors.c
src/kds_s2000w_option_descriptors.h
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
tests/kds_s2000w_option_descriptor_tests.c
tests/kds_s2000w_option_descriptor_tests.h
tests/kds_s2000w_option_descriptor_tests_run.c

index 7360420e6f7d8538442034a88ff0c6e3ce492089..15d7b2c1c4801c4eab6d61b540ab5955207286fb 100644 (file)
@@ -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);
index d2ce7b4c41a0ab83b33afe267e38da7f64566a32..2bcfd491152d0819ad469e54f2b10aa99d490e43 100644 (file)
@@ -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()
index cede6bddd8a3305d278fad6815edd33395a17b3b..a7fda6e6c86188eb4638b05cac67d47fd62df01e 100644 (file)
@@ -2,7 +2,7 @@
 #define KDS_S2000W_OPTION_DESCRIPTORS_H
 #include <sane/sane.h>
 
-#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();
index 19d0eb963f976901a84fb72ca34de126031aef41..a28ae4ab7c5d589978ad47e5db0622d6f249ccf1 100644 (file)
@@ -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;
-}
index 84fa4e29f2f18bb5027da818eb85619dbe2a3a00..394767911726562e8dd1acaf95a1e8d526019968 100644 (file)
@@ -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
index f9c93e3a006ccc04dbd321736e35e02a9a24dbd9..24179cca953fd2727949a10724c789b445d51333 100644 (file)
@@ -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);
index 40021b12f9f3b5283eeab7ed82f98c63eacc3ddb..c8e9872a61fc17a48e499e98de10fddcd577c1ff 100644 (file)
@@ -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);
index 2cddea1f66f21c97cd020b09cd012b1343e47262..8fe956421368775269df8fe39ce5c441e79e1249 100644 (file)
@@ -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
index aeb089d57a07f1c78c789acd6b3405cee358fd04..7f6e1de6701ad4e649fe8533bd86568d70818124 100644 (file)
@@ -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);