void sane_kds_s2000w_net_control_get_option_zero_test(void** state)
{
response_t* resp = (response_t*) *state;
+ handler_t* h = kds_s2000w_handler_init();
+ int32_t value = 0;
+
will_return(mock_response, resp);
will_return(__wrap_kds_s2000w_client_get_option, 0);
will_return(mock_response, resp);
will_return(__wrap_kds_s2000w_client_set_option, 0);
expect_function_call(__wrap_kds_s2000w_client_get_option);
expect_function_call(__wrap_kds_s2000w_client_set_option);
- handler_t* h = kds_s2000w_handler_init();
- int32_t value = 0;
sane_kds_s2000w_net_control_option(h, 0, SANE_ACTION_GET_VALUE, &value, NULL);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 2, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "DocumentFeeder");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 3, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "Color");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
int32_t value = 0;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 4, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 200);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 5, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "Duplex");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 7, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "AutomaticStraighten");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 8, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "EntireDocument");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
uint32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 9, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
uint32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 10, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
uint32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 11, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 300);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
uint32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 12, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 300);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 14, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "None");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
int32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 15, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 16, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "None");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
int32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 17, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 19, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "None");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
int32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 20, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 21, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "Automatic");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
uint32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 22, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
uint32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 23, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 24, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "Automatic");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
int32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 25, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
int32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 26, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
int32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 27, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
int32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 28, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 29, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "Normal");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
int32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 30, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
int32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 33, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
uint32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 34, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 5);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
uint32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 35, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 0);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 36, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "Automatic");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 37, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "Automatic");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 38, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "None");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 39, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "Good");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
uint32_t value = 0;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 41, SANE_ACTION_GET_VALUE, &value, NULL);
- assert_int_equal(value, 0);
+ assert_int_equal(value, 1);
kds_s2000w_handler_free(h);
h = NULL;
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
uint32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 42, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 140);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 43, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "Normal");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 44, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "None");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 45, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "Stop");
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
uint32_t value = -1;
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 46, SANE_ACTION_GET_VALUE, &value, NULL);
assert_int_equal(value, 2);
{
handler_t* h = kds_s2000w_handler_init();
response_t* resp = (response_t*) *state;
- h->scanner_config = json_tokener_parse(resp->data);
char value[50] = {0};
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_get_option, 0);
+ will_return(mock_response, resp);
+ will_return(__wrap_kds_s2000w_client_set_option, 0);
+ expect_function_call(__wrap_kds_s2000w_client_get_option);
+ expect_function_call(__wrap_kds_s2000w_client_set_option);
+
sane_kds_s2000w_net_control_option(h, 47, SANE_ACTION_GET_VALUE, &value, NULL);
assert_string_equal(value, "Stop");
SANE_Status status = sane_kds_s2000w_net_control_option(h, 3, SANE_ACTION_SET_VALUE, "Gray", info);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, COLOR_MODE);
+ json_object* value_object = json_object_object_get(h->scanner_config, COLOR_MODE);
const char* value = json_object_get_string(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 15, SANE_ACTION_SET_VALUE, set_value, NULL);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, FOREGROUND_BOLDNESS_AGGRESSIVENESS);
+ json_object* value_object = json_object_object_get(h->scanner_config, FOREGROUND_BOLDNESS_AGGRESSIVENESS);
int32_t value = json_object_get_int(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 31, SANE_ACTION_SET_VALUE, set_value, info);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, DPI);
+ json_object* value_object = json_object_object_get(h->scanner_config, DPI);
int32_t value = json_object_get_int(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 11, SANE_ACTION_SET_VALUE, set_value, NULL);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, IMAGE_WIDTH);
+ json_object* value_object = json_object_object_get(h->scanner_config, IMAGE_WIDTH);
int32_t value = json_object_get_int(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 11, SANE_ACTION_SET_VALUE, set_value, NULL);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, IMAGE_WIDTH);
+ json_object* value_object = json_object_object_get(h->scanner_config, IMAGE_WIDTH);
int32_t value = json_object_get_int(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 12, SANE_ACTION_SET_VALUE, set_value, NULL);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, IMAGE_WIDTH);
+ json_object* value_object = json_object_object_get(h->scanner_config, IMAGE_WIDTH);
int32_t value = json_object_get_int(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 4, SANE_ACTION_SET_VALUE, set_value, NULL);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, DPI);
+ json_object* value_object = json_object_object_get(h->scanner_config, DPI);
int32_t value = json_object_get_int(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 7, SANE_ACTION_SET_VALUE, "Automatic", info);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, CROPPING_MODE);
+ json_object* value_object = json_object_object_get(h->scanner_config, CROPPING_MODE);
const char* value = json_object_get_string(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 8, SANE_ACTION_SET_VALUE, "PartialDocument", info);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, CROPPING_IMAGE);
+ json_object* value_object = json_object_object_get(h->scanner_config, CROPPING_IMAGE);
const char* value = json_object_get_string(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 14, SANE_ACTION_SET_VALUE, "AutomaticAdvanced", info);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, FOREGROUND_BOLDNESS_MODE);
+ json_object* value_object = json_object_object_get(h->scanner_config, FOREGROUND_BOLDNESS_MODE);
const char* value = json_object_get_string(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 16, SANE_ACTION_SET_VALUE, "AutomaticAdvanced", info);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, BACKGROUND_SMOOTHING_MODE);
+ json_object* value_object = json_object_object_get(h->scanner_config, BACKGROUND_SMOOTHING_MODE);
const char* value = json_object_get_string(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 24, SANE_ACTION_SET_VALUE, "AutomaticAdvanced", info);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, COLOR_BALANCE_MODE);
+ json_object* value_object = json_object_object_get(h->scanner_config, COLOR_BALANCE_MODE);
const char* value = json_object_get_string(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 21, SANE_ACTION_SET_VALUE, "Automatic", info);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, COLOR_AUTO_BRIGHTNESS_MODE);
+ json_object* value_object = json_object_object_get(h->scanner_config, COLOR_AUTO_BRIGHTNESS_MODE);
const char* value = json_object_get_string(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);
SANE_Status status = sane_kds_s2000w_net_control_option(h, 19, SANE_ACTION_SET_VALUE, "Green", info);
- json_object* config = json_object_object_get(h->scanner_config, "Configuration");
- json_object* value_object = json_object_object_get(config, COLOR_DROP_OUT);
+ json_object* value_object = json_object_object_get(h->scanner_config, COLOR_DROP_OUT);
const char* value = json_object_get_string(value_object);
assert_int_equal(status, SANE_STATUS_GOOD);