#include "../src/kds_s2000w_handler.h"
#include "../src/kds_s2000w_net.h"
-void __wrap_load_config(program_config* config, const char* config_stream)
-{
- config->scanner_url = malloc(sizeof(char) * 28);
- config->username = malloc(sizeof(char) * 4);
-
- config->scanner_url = "https://scanner.example.com\0";
- config->username = "Max\0";
-}
-
-int __wrap_kds_s2000w_client_get_option(int64_t sessionid, response* response)
-{
- response->data = realloc(response->data, 918);
- const char* responsedata = "{ \
- \"Status\": { \
- \"NumImagesScanned\": 0, \
- \"NumImagesStored\": 0, \
- \"State\": \"In Session\", \
- \"ErrorNum\": 0, \
- \"LastError\": \"Status: 200 Success\", \
- \"PaperDetected\": \"0\", \
- \"PercentAvailable\": 99 \
- }, \
- \"Configuration\": { \
- \"DPI\": 200, \
- \"ScanSide\": \"Duplex\", \
- \"ColorMode\": \"Color\", \
- \"SkipBlankPages\": 0, \
- \"AutoStart\": 0, \
- \"ColorDropOut\": \"None\", \
- \"ColorDropOutAggressiveness\": 0, \
- \"OutputType\": \"Images\", \
- \"ColorAutoBrightnessMode\": \"Automatic\", \
- \"ColorBalanceMode\": \"Automatic\", \
- \"ColorBalanceAggressiveness\": 0, \
- \"ColorBalanceRed\": 0, \
- \"ColorBalanceGreen\": 0, \
- \"ColorBalanceBlue\": 0, \
- \"ForegroundBoldnessMode\": \"None\", \
- \"ForegroundBoldnessAggressiveness\": 0, \
- \"BackgroundSmoothingMode\": \"None\", \
- \"BackgroundSmoothingAggressiveness\": 0, \
- \"BinarizationMode\": \"iThresholding\", \
- \"BinarizationContrast\": 0, \
- \"MaxDocumentLength\": 140, \
- \"ScanSource\": \"DocumentFeeder\" \
- } \
- }\0";
-
- memcpy(response->data, responsedata, 918);
-
- response->code = 200;
- response->size = sizeof(response->data);
-
- return mock_type(int);
-}
-
-int __wrap_kds_s2000w_client_stop_scan(int64_t sessionid, response* response)
-{
- return mock_type(int);
-}
-
-int __wrap_kds_s2000w_client_open_session(response* response)
-{
- response->data = realloc(response->data, 27);
- const char* responsedata = "{\"SessionId\":\"1251877821\"}\0";
-
- memcpy(response->data, responsedata, 27);
-
- response->code = 200;
- response->size = sizeof(response->data);
-
- return mock_type(int);
-}
-
void sane_kds_s2000w_net_read_cancel_test()
{
handler* h = init_handler();