h->current_scan_status->complete_scanned = false;
h->current_scan_status->feeder = 1;
h->read_info->scan_started = false;
- h->read_info->cancel = 0;
+ h->read_info->cancel = false;
h->read_info->read_size = 0;
h->image->size = 0;
h->image->data = NULL;
h->current_scan_status->downloaded_images = 0;
h->current_scan_status->complete_scanned = false;
h->read_info->scan_started = false;
- h->read_info->cancel = 0;
+ h->read_info->cancel = false;
h->read_info->read_size = 0;
}
typedef struct {
bool scan_started;
- uint8_t cancel;
+ bool cancel;
uint64_t read_size;
} readinfo;
return SANE_STATUS_CANCELLED;
if (!h->read_info->scan_started) {
- h->read_info->cancel = 0;
+ h->read_info->cancel = false;
h->read_info->scan_started = true;
kds_s2000w_handler_start_scan(h);
}
handler* h = (handler*) handle;
- if (h->read_info->cancel > 0) {
+ if (h->read_info->cancel) {
kds_s2000w_debug_printf(DEBUG, "scan completed canceled");
kds_s2000w_handler_reset(h);
kds_s2000w_handler_recreate_session(h);
}
kds_s2000w_debug_printf(DEBUG, "scan canceled");
- h->read_info->cancel = 1;
+ h->read_info->cancel = true;
kds_s2000w_handler_stop_scan(h);
}
void sane_kds_s2000w_net_read_bytes_per_line_bigger_test()
{
handler* h = kds_s2000w_handler_init();
- h->read_info->cancel = 0;
+ h->read_info->cancel = false;
h->read_info->read_size = 0;
h->image->size = 95003;
h->image->data = malloc(sizeof(char) * 95003);
sane_kds_s2000w_net_cancel(h);
- assert_int_equal(h->read_info->cancel, 1);
+ assert_true(h->read_info->cancel);
kds_s2000w_client_response_free(resp);
resp = NULL;
void sane_kds_s2000w_net_cancel_start_test()
{
handler* h = kds_s2000w_handler_init();
- h->read_info->cancel = 1;
+ h->read_info->cancel = true;
SANE_Status status = sane_kds_s2000w_net_start(h);
expect_function_call(__wrap_kds_s2000w_client_open_session);
expect_function_call(__wrap_kds_s2000w_client_set_option);
handler* h = kds_s2000w_handler_init();
- h->read_info->cancel = 1;
+ h->read_info->cancel = true;
sane_kds_s2000w_net_cancel(h);
- assert_int_equal(h->read_info->cancel, 0);
+ assert_false(h->read_info->cancel);
kds_s2000w_client_response_free(resp_status);
resp_status = NULL;
sane_kds_s2000w_net_cancel(h);
- assert_int_equal(h->read_info->cancel, 0);
+ assert_false(h->read_info->cancel);
assert_false(h->current_scan_status->complete_scanned);
kds_s2000w_client_response_free(resp_status);
sane_kds_s2000w_net_cancel(h);
- assert_int_equal(h->read_info->cancel, 0);
+ assert_false(h->read_info->cancel);
assert_false(h->current_scan_status->complete_scanned);
kds_s2000w_client_response_free(resp_status);