#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)
{
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;
}
_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);
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()
#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();
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;
-}
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
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);
{
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);
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
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);