]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add option descriptor for hole fill
authorBastian Dehn <hhaalo@arcor.de>
Sun, 16 Feb 2025 09:44:15 +0000 (10:44 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 16 Feb 2025 09:44:15 +0000 (10:44 +0100)
src/kds_s2000w_option_descriptors.c
tests/kds_s2000w_option_descriptor_tests.c
tests/kds_s2000w_option_descriptor_tests.h
tests/kds_s2000w_option_descriptor_tests_run.c

index df808b663e2ab6dce3df3e78adfdb332482c4abb..5453cbf5f9e8c0bdcf9f97c851f905df792d6db2 100644 (file)
@@ -3,7 +3,7 @@
 #include "kds_s2000w_option_descriptors.h"
 #include "kds_s2000w_debug.h"
 
-#define MAX_OPTION_COUNT 31
+#define MAX_OPTION_COUNT 32
 
 SANE_Option_Descriptor* descriptor_array = NULL;
 
@@ -733,6 +733,25 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_document_feeder_timeout_res
        return descriptor;
 }
 
+SANE_Option_Descriptor _kds_s2000w_option_descriptor_hole_fill()
+{
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_hole_fill");
+
+
+       SANE_Option_Descriptor descriptor = {
+               "hole-fill",
+               "Hole Fill",
+               "Hole Fill",
+               SANE_TYPE_BOOL,
+               SANE_UNIT_NONE,
+               sizeof(SANE_Bool),
+               SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT,
+               SANE_CONSTRAINT_NONE,
+       };
+
+       return descriptor;
+}
+
 void kds_s2000w_option_descriptors_init()
 {
        kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_init_option_descriptors");
@@ -768,7 +787,8 @@ void kds_s2000w_option_descriptors_init()
        descriptor_array[27] = _kds_s2000w_option_descriptor_transport_handling();
        descriptor_array[28] = _kds_s2000w_option_descriptor_jpeg_quality();
        descriptor_array[29] = _kds_s2000w_option_descriptor_document_feeder_timeout_response();
-       descriptor_array[30] = _kds_s2000w_option_descriptor_config_reset();
+       descriptor_array[30] = _kds_s2000w_option_descriptor_hole_fill();
+       descriptor_array[31] = _kds_s2000w_option_descriptor_config_reset();
 }
 
 void kds_s2000w_option_descriptors_free()
index c8f5b9c5725244c4519c3f87505cbd470bbbdcf2..1ef82a25c9b9883fa432280b0e76ac18134da0b6 100644 (file)
@@ -4,7 +4,7 @@
 #include "kds_s2000w_client_mock.h"
 #include "../src/kds_s2000w_option_descriptors.h"
 
-#define MAX_OPTION_COUNT 31
+#define MAX_OPTION_COUNT 32
 
 int setup(void** state)
 {
@@ -552,6 +552,20 @@ void kds_s2000w_option_get_descriptor_thirdy_test()
 {
        SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(30);
 
+       assert_string_equal("hole-fill", option->name);
+       assert_string_equal("Hole Fill", option->title);
+       assert_string_equal("Hole Fill", option->desc);
+       assert_int_equal(SANE_TYPE_BOOL, option->type);
+       assert_int_equal(SANE_UNIT_NONE, option->unit);
+       assert_int_equal(sizeof(SANE_Bool), option->size);
+       assert_int_equal(SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT, option->cap);
+       assert_int_equal(SANE_CONSTRAINT_NONE, option->constraint_type);
+}
+
+void kds_s2000w_option_get_descriptor_thirdyone_test()
+{
+       SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(31);
+
        assert_string_equal("config-reset", option->name);
        assert_string_equal("reset config", option->title);
        assert_string_equal("load default configuration from scanner", option->desc);
index 0c4c72ba8e7a02bc9d876d09436a27127207c3e7..c409653bdfc6cc893babecf1bace46142febccc7 100644 (file)
@@ -39,5 +39,6 @@ void kds_s2000w_option_get_descriptor_twentyseven_test();
 void kds_s2000w_option_get_descriptor_twentyeight_test();
 void kds_s2000w_option_get_descriptor_twentynine_test();
 void kds_s2000w_option_get_descriptor_thirdy_test();
+void kds_s2000w_option_get_descriptor_thirdyone_test();
 void kds_s2000w_option_get_descriptor_over_max_options_test();
 #endif
\ No newline at end of file
index f6fca739e98810c9ea6ea5fbb6c4f620bb7179fa..23c3871e2b1557cf9f0666adae8e3069d15ef1a8 100644 (file)
@@ -34,7 +34,9 @@ int main()
                cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_twentyeight_test, setup, teardown),
                cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_twentynine_test, setup, teardown),
                cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_thirdy_test, setup, teardown),
-               cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_over_max_options_test, setup, teardown)
+               cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_thirdyone_test, setup, teardown),
+               cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_over_max_options_test, setup, teardown),
+
        };
 
        return cmocka_run_group_tests(option_descriptor_tests, NULL, NULL);