#include "kds_s2000w_option_descriptors.h"
#include "kds_s2000w_debug.h"
-#define MAX_OPTION_COUNT 34
+#define MAX_OPTION_COUNT 35
SANE_Option_Descriptor* descriptor_array = NULL;
{
kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_hole_fill");
-
SANE_Option_Descriptor descriptor = {
"hole-fill",
"Hole Fill",
return descriptor;
}
+SANE_Option_Descriptor _kds_s2000w_option_descriptor_skip_blank_page_content()
+{
+ kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_skip_blank_page_content");
+
+ SANE_Range* constraint = malloc(sizeof(SANE_Range));
+ constraint->min = 0;
+ constraint->max = 100;
+ constraint->quant = 1;
+
+ SANE_Option_Descriptor descriptor = {
+ "skip-blank-page-content",
+ "skip blank page content",
+ "skip blank page content",
+ SANE_TYPE_INT,
+ SANE_UNIT_PERCENT,
+ sizeof(SANE_Int),
+ SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT,
+ SANE_CONSTRAINT_RANGE,
+ {.range = constraint}
+ };
+
+ return descriptor;
+}
+
void kds_s2000w_option_descriptors_init()
{
kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_init_option_descriptors");
descriptor_array[30] = _kds_s2000w_option_descriptor_hole_fill();
descriptor_array[31] = _kds_s2000w_option_descriptor_cropping_mode();
descriptor_array[32] = _kds_s2000w_option_descriptor_cropping_image();
- descriptor_array[33] = _kds_s2000w_option_descriptor_config_reset();
+ descriptor_array[33] = _kds_s2000w_option_descriptor_skip_blank_page_content();
+ descriptor_array[34] = _kds_s2000w_option_descriptor_config_reset();
}
void kds_s2000w_option_descriptors_free()
#include "kds_s2000w_client_mock.h"
#include "../src/kds_s2000w_option_descriptors.h"
-#define MAX_OPTION_COUNT 34
+#define MAX_OPTION_COUNT 35
int setup(void** state)
{
{
SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(33);
+ assert_string_equal("skip-blank-page-content", option->name);
+ assert_string_equal("skip blank page content", option->title);
+ assert_string_equal("skip blank page content", option->desc);
+ assert_int_equal(SANE_TYPE_INT, option->type);
+ assert_int_equal(SANE_UNIT_PERCENT, option->unit);
+ assert_int_equal(sizeof(SANE_Int), option->size);
+ assert_int_equal(SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT, option->cap);
+ assert_int_equal(SANE_CONSTRAINT_RANGE, option->constraint_type);
+ assert_int_equal(option->constraint.range->min, 0);
+ assert_int_equal(option->constraint.range->max, 100);
+ assert_int_equal(option->constraint.range->quant, 1);
+}
+
+void kds_s2000w_option_get_descriptor_thirdyfour_test()
+{
+ SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(34);
+
assert_string_equal("config-reset", option->name);
assert_string_equal("reset config", option->title);
assert_string_equal("load default configuration from scanner", option->desc);
void kds_s2000w_option_get_descriptor_thirdyone_test();
void kds_s2000w_option_get_descriptor_thirdytwo_test();
void kds_s2000w_option_get_descriptor_thirdythree_test();
+void kds_s2000w_option_get_descriptor_thirdyfour_test();
void kds_s2000w_option_get_descriptor_over_max_options_test();
#endif
\ No newline at end of file
cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_thirdyone_test, setup, teardown),
cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_thirdytwo_test, setup, teardown),
cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_thirdythree_test, setup, teardown),
+ cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_thirdyfour_test, setup, teardown),
cmocka_unit_test_setup_teardown(kds_s2000w_option_get_descriptor_over_max_options_test, setup, teardown),
};