]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
optimize header includes for test files
authorBastian Dehn <hhaalo@arcor.de>
Thu, 9 Jan 2025 18:11:55 +0000 (19:11 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 9 Jan 2025 18:11:55 +0000 (19:11 +0100)
CMakeLists.txt
tests/kds_s2000w_client_mock.c
tests/kds_s2000w_client_mock.h
tests/kds_s2000w_image_converter_tests.c
tests/kds_s2000w_net_get_opt_tests.c
tests/kds_s2000w_net_read_tests.c
tests/kds_s2000w_net_tests.c
tests/kds_s2000w_option_descriptor_tests.c
tests/kds_s2000w_read_config_tests.c

index 91541f1a85b8a0335fad3d9177879315e0760e31..750d770779b004e22c8fed74223975ed73e848a9 100644 (file)
@@ -29,12 +29,12 @@ IF (RUN_TESTS)
 --wrap,kds_s2000w_client_close_session,\
 --wrap,kds_s2000w_client_status_session,\
 --wrap,kds_s2000w_client_get_image,\
---wrap,kds_s2000w_convert_tiff_to_pnm,\
---wrap,kds_s2000w_convert_jpg_to_pnm_with_depth,\
 --wrap,kds_s2000w_client_delete_image,\
 --wrap,kds_s2000w_client_set_option,\
 --wrap,kds_s2000w_client_init,\
 --wrap,kds_s2000w_client_free,\
+--wrap,kds_s2000w_convert_tiff_to_pnm,\
+--wrap,kds_s2000w_convert_jpg_to_pnm_with_depth,\
 --wrap,wait_a_second,\
 --wrap,usleep" CACHE STRING "test coverage compiler flags" FORCE)
 ENDIF()
index e52a5b41d4a158237e4e7cdcae43c3b45d2676db..c4266b0ffb78931d48a2e14826cf94d7cac7a744 100644 (file)
@@ -3,11 +3,6 @@
 #include <unistd.h>
 #include "kds_s2000w_client_mock.h"
 
-int __wrap_usleep(__useconds_t usec)
-{
-       return 0;
-}
-
 void mock_response(response* resp)
 {
        response* mock_resp = mock_type(response*);
@@ -22,6 +17,16 @@ void mock_response(response* resp)
        resp->size = mock_resp->size;
 }
 
+void __wrap_wait_a_second()
+{
+       return;
+}
+
+int __wrap_usleep(__useconds_t usec)
+{
+       return 0;
+}
+
 void __wrap_kds_s2000w_client_init()
 {
        return;
index c08f7431eaa2ca05741c0cb9dd22ef1cfe4ef72b..3c519d2d6829df7d37d1f4a44896dd40d2e5b142 100644 (file)
@@ -9,6 +9,10 @@
 #include "../src/kds_s2000w_image_converter.h"
 
 void mock_response(response* resp);
+void __wrap_wait_a_second();
+int __wrap_usleep(__useconds_t usec);
+void __wrap_kds_s2000w_client_init();
+void __wrap_kds_s2000w_client_free();
 int __wrap_kds_s2000w_client_get_option(int64_t sessionid, response* response);
 int __wrap_kds_s2000w_client_set_option(int64_t sessionid, response* response);
 int __wrap_kds_s2000w_client_stop_scan(int64_t sessionid, response* response);
index 0b511842075d7afc64aa680608b9d7bc69c3e8a8..c770ed81229cc929a7081f42f188c8f5b0f9d67d 100644 (file)
@@ -4,21 +4,6 @@
 #include "kds_s2000w_client_mock.h"
 #include "kds_s2000w_image_converter_tests.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";
-}
-
-void __wrap_wait_a_second()
-{
-       return;
-}
-
-
 void get_metadata_from_image_test()
 {
        blobdata* image = malloc(sizeof(blobdata));
index 980685f0b14b9fb251cb022095ea314e0dc29e0b..48a5e839765014f4e82c4f0d5f6890e83de08730 100644 (file)
@@ -9,16 +9,6 @@
 #include "../src/kds_s2000w_handler.h"
 #include "../src/kds_s2000w_image_converter.h"
 
-void __wrap_load_config(program_config* config, const char* config_stream)
-{
-       return;
-}
-
-void __wrap_wait_a_second()
-{
-       return;
-}
-
 void sane_kds_s2000w_net_control_get_option_zero(void** state)
 {
        response* resp = (response*) *state;
index dfc184ad7dcb7ce1688f25fcd435bd84485ed5b6..a08876a445c8a25f6f1f9185895409d5aa2f5fd0 100644 (file)
@@ -9,16 +9,6 @@
 #include "../src/kds_s2000w_net.h"
 #include "../src/kds_s2000w_image_converter.h"
 
-void __wrap_load_config(program_config* config, const char* config_stream)
-{
-       return;
-}
-
-void __wrap_wait_a_second()
-{
-       return;
-}
-
 void sane_kds_s2000w_net_read_without_data()
 {
        int length = 0;
index 660fdf60f095d88a32c072c0141bc007c02e8e73..3174a3625fa035e6bf4e1552048c70daabbff76d 100644 (file)
@@ -3,21 +3,8 @@
 #include <string.h>
 #include "kds_s2000w_net_tests.h"
 #include "kds_s2000w_client_mock.h"
-#include "../src/kds_s2000w_config.h"
 #include "../src/kds_s2000w_net.h"
-#include "../src/kds_s2000w_option_descriptors.h"
 #include "../src/kds_s2000w_handler.h"
-#include "../src/kds_s2000w_image_converter.h"
-
-void __wrap_load_config(program_config* config, const char* config_stream)
-{
-       return;
-}
-
-void __wrap_wait_a_second()
-{
-       return;
-}
 
 void kds_s2000w_net_get_devices()
 {
index b97d660151891feea053869d08e64f1998ef74a5..83cb9a994a865f1385e8ac9d7a1aba5990dcb624 100644 (file)
@@ -2,17 +2,6 @@
 #include <sane/saneopts.h>
 #include "kds_s2000w_option_descriptor_tests.h"
 #include "../src/kds_s2000w_option_descriptors.h"
-#include "../src/kds_s2000w_image_converter.h"
-#include "../src/kds_s2000w_config.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 setup(void** state)
 {
index 72719ffd2a5d0b76962321e2238160b9f6ff0efe..0212b7c0924d69fdd44487a3edc0743b25bd8bda 100644 (file)
@@ -1,15 +1,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include "kds_s2000w_read_config_tests.h"
-#include "kds_s2000w_client_mock.h"
-#include "../src/kds_s2000w_client.h"
 #include "../src/kds_s2000w_config.h"
-#include "../src/kds_s2000w_image_converter.h"
-
-void __wrap_wait_a_second()
-{
-       return;
-}
 
 void kds_s2000w_config_null()
 {