#include "kds_s2000w_debug.h"
#include "kds_s2000w_config.h"
+#ifndef TEST
program_config p_config;
void _kds_s2000w_client_load_config()
if (response == NULL)
return;
- free(response->data);
- response->data = NULL;
free(response);
response = NULL;
}
curl = NULL;
return result;
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
config = json_object_object_get(resp_config, "Configuration");
int* int_value_ptr = (int*) value;
*int_value_ptr = json_object_object_length(config) + COUNT_CUSTOM_OPTIONS;
+ debug_printf_int(DEBUG, "option numbers", *int_value_ptr);
break;
case 2:
value_object = json_object_object_get(config, "ScanSource");
+#define TEST
#include <stdlib.h>
#include <sane/sane.h>
#include "kds_s2000w_net_tests.h"
+#include "../src/kds_s2000w_client.h"
#include "../src/kds_s2000w_net.h"
#include "../src/kds_s2000w_handler.h"
+int kds_s2000w_client_get_option(int64_t sessionid, response* response)
+{
+ response->data = "{\"Configuration\":{\"testproperty\": 0, \"testproperty2\": 0}}";
+ response->code = 200;
+ response->size = sizeof(response->data);
+
+ return 0;
+}
+
START_TEST(kds_s2000w_net_get_parameters_with_image_data)
{
handler* h = init_handler();
}
END_TEST
+START_TEST(sane_kds_s2000w_net_control_option_zero)
+{
+ handler* h = init_handler();
+ int value = 0;
+
+ _sane_kds_s2000w_net_control_option(h, 0, SANE_ACTION_GET_VALUE, &value, NULL);
+
+ ck_assert_int_eq(value, 4);
+ free_handler(h);
+ h = NULL;
+}
+END_TEST
+
Suite* net_tests()
{
Suite* net_tests_suite = suite_create("kds_s2000w_net");
tcase_add_test(net_tests, kds_s2000w_net_get_parameters_with_image_data);
tcase_add_test(net_tests, kds_s2000w_net_set_io_mode);
tcase_add_test(net_tests, kds_s2000w_net_get_select_fd);
+ tcase_add_test(net_tests, sane_kds_s2000w_net_control_option_zero);
suite_add_tcase(net_tests_suite, net_tests);
return net_tests_suite;
}
\ No newline at end of file