void sane_kds_s2000w_net_cancel()
{
+ response* resp_status = kds_s2000w_client_response_init();
+ resp_status->data = realloc(resp_status->data, 205);
+ const char* status = "{ \
+ \"Status\": { \
+ \"NumImagesScanned\": 2, \
+ \"NumImagesStored\": 2, \
+ \"State\": \"Scanning\", \
+ \"ErrorNum\": 0, \
+ \"LastError\": \"Status: 200 Success\", \
+ \"PaperDetected\": \"0\", \
+ \"PercentAvailable\": 99 \
+ }}\0";
+ memcpy(resp_status->data, status, 205);
+ resp_status->code = 200;
+ resp_status->size = 205;
+ will_return(mock_response, resp_status);
+ will_return(__wrap_kds_s2000w_client_status_session, 0);
response* resp = kds_s2000w_client_response_init();
resp->code = 200;
resp->size = 0;
will_return(mock_response, resp);
will_return(__wrap_kds_s2000w_client_stop_scan, 0);
+ expect_function_call(__wrap_kds_s2000w_client_status_session);
expect_function_call(__wrap_kds_s2000w_client_stop_scan);
handler* h = init_handler();
h->current_scan_status->available_images = 1;
kds_s2000w_client_response_free(resp);
resp = NULL;
+ kds_s2000w_client_response_free(resp_status);
+ resp_status = NULL;
free_handler(h);
h = NULL;
}