will_return(mock_response, response_list[0]);
will_return(__wrap_kds_s2000w_client_start_scan, 0);
response* resp_status = kds_s2000w_client_response_init();
- resp_status->data = realloc(resp_status->data, 205);
const char* status = "{ \
\"Status\": { \
\"NumImagesScanned\": 2, \
\"LastError\": \"Status: 200 Success\", \
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
- }}\0";
- memcpy(resp_status->data, status, 205);
+ }}";
+ resp_status->data = strdup(status);
resp_status->code = 200;
- resp_status->size = 205;
+ resp_status->size = 204;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
will_return(mock_response, response_list[2]);
will_return(mock_response, response_list[0]);
will_return(__wrap_kds_s2000w_client_start_scan, 0);
response* resp_status = kds_s2000w_client_response_init();
- resp_status->data = realloc(resp_status->data, 205);
const char* status = "{ \
\"Status\": { \
\"NumImagesScanned\": 1, \
\"LastError\": \"Status: 200 Success\", \
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
- }}\0";
- memcpy(resp_status->data, status, 205);
+ }}";
+ resp_status->data = strdup(status);
resp_status->code = 200;
- resp_status->size = 205;
+ resp_status->size = 204;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
will_return(mock_response, response_list[2]);
will_return(mock_response, response_list[0]);
will_return(__wrap_kds_s2000w_client_start_scan, 0);
response* resp_status = kds_s2000w_client_response_init();
- resp_status->data = realloc(resp_status->data, 210);
const char* status = "{ \
\"Status\": { \
\"NumImagesScanned\": 1, \
\"LastError\": \"Status: 200 Success\", \
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
- }}\0";
- memcpy(resp_status->data, status, 210);
+ }}";
+ resp_status->data = strdup(status);
resp_status->code = 200;
- resp_status->size = 210;
+ resp_status->size = 209;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
will_return(mock_response, response_list[2]);
will_return(mock_response, response_list[0]);
will_return(__wrap_kds_s2000w_client_start_scan, 0);
response* resp_status = kds_s2000w_client_response_init();
- resp_status->data = realloc(resp_status->data, 210);
const char* status = "{ \
\"Status\": { \
\"NumImagesScanned\": 2, \
\"LastError\": \"Status: 200 Success\", \
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
- }}\0";
- memcpy(resp_status->data, status, 210);
+ }}";
+ resp_status->data = strdup(status);
resp_status->code = 200;
- resp_status->size = 210;
+ resp_status->size = 209;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
will_return(mock_response, response_list[2]);
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
}}\0";
- memcpy(resp_status->data, status2, 210);
+ free(resp_status->data);
+ resp_status->data = NULL;
+ resp_status->data = strdup(status2);
resp_status->code = 200;
- resp_status->size = 210;
+ resp_status->size = 209;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
will_return(mock_response, response_list[2]);
void sane_kds_s2000w_net_cancel_test()
{
response* resp_status = kds_s2000w_client_response_init();
- resp_status->data = realloc(resp_status->data, 205);
const char* status = "{ \
\"Status\": { \
\"NumImagesScanned\": 2, \
\"LastError\": \"Status: 200 Success\", \
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
- }}\0";
- memcpy(resp_status->data, status, 205);
+ }}";
+ resp_status->data = strdup(status);
resp_status->code = 200;
- resp_status->size = 205;
+ resp_status->size = 204;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
response* resp = kds_s2000w_client_response_init();
void sane_kds_s2000w_net_cancel_canceled_test()
{
response* resp_status = kds_s2000w_client_response_init();
- resp_status->data = realloc(resp_status->data, 27);
const char* status = "{\"SessionId\":\"1251877821\"}";
- memcpy(resp_status->data, status, 27);
+ resp_status->data = strdup(status);
resp_status->code = 200;
resp_status->size = 27;
will_return(mock_response, resp_status);
void sane_kds_s2000w_net_cancel_completed_scan_feeder_test()
{
response* resp_status = kds_s2000w_client_response_init();
- resp_status->data = realloc(resp_status->data, 210);
const char* status = "{ \
\"Status\": { \
\"NumImagesScanned\": 2, \
\"LastError\": \"Status: 200 Success\", \
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
- }}\0";
- memcpy(resp_status->data, status, 210);
+ }}";
+ resp_status->data = strdup(status);
resp_status->code = 200;
- resp_status->size = 210;
+ resp_status->size = 209;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
expect_function_call(__wrap_kds_s2000w_client_status_session);
void sane_kds_s2000w_net_cancel_completed_scan_flatbed_test()
{
response* resp_status = kds_s2000w_client_response_init();
- resp_status->data = realloc(resp_status->data, 205);
const char* status = "{ \
\"Status\": { \
\"NumImagesScanned\": 2, \
\"LastError\": \"Status: 200 Success\", \
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
- }}\0";
- memcpy(resp_status->data, status, 205);
+ }}";
+ resp_status->data = strdup(status);
resp_status->code = 200;
- resp_status->size = 205;
+ resp_status->size = 204;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
response* resp_session = kds_s2000w_client_response_init();
- resp_session->data = realloc(resp_session->data, 27);
const char* responsedata = "{\"SessionId\":\"1251877821\"}";
- memcpy(resp_session->data, responsedata, 27);
+ resp_session->data = strdup(responsedata);
resp_session->code = 200;
resp_session->size = 27;
will_return(mock_response, resp_session);