From: Bastian Dehn Date: Wed, 1 Jan 2025 18:58:52 +0000 (+0100) Subject: fix free config with free method X-Git-Tag: v1.0.22^2~6 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=b9ffa32d9e3c6b9343b887d4859702bc2662e00c;p=sane-kds-s2000w-net.git fix free config with free method --- diff --git a/CMakeLists.txt b/CMakeLists.txt index aee880d..cba6067 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,8 @@ IF (RUN_TESTS) --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,load_config,\ --wrap,wait_a_second,\ --wrap,usleep" CACHE STRING "test coverage compiler flags" FORCE) diff --git a/src/kds_s2000w_client.c b/src/kds_s2000w_client.c index 0119655..8ab2f82 100644 --- a/src/kds_s2000w_client.c +++ b/src/kds_s2000w_client.c @@ -122,7 +122,7 @@ void kds_s2000w_client_free() { debug_printf(ALL, "kds_s2000w_client_free"); - free(config); + free_config(config); config = NULL; curl_easy_cleanup(curl); curl = NULL; diff --git a/tests/kds_s2000w_client_mock.c b/tests/kds_s2000w_client_mock.c index d907327..e52a5b4 100644 --- a/tests/kds_s2000w_client_mock.c +++ b/tests/kds_s2000w_client_mock.c @@ -22,6 +22,16 @@ void mock_response(response* resp) resp->size = mock_resp->size; } +void __wrap_kds_s2000w_client_init() +{ + return; +} + +void __wrap_kds_s2000w_client_free() +{ + return; +} + int __wrap_kds_s2000w_client_get_option(int64_t sessionid, response* response) { function_called(); diff --git a/tests/kds_s2000w_net_tests.c b/tests/kds_s2000w_net_tests.c index 83f2c7a..e0476f0 100644 --- a/tests/kds_s2000w_net_tests.c +++ b/tests/kds_s2000w_net_tests.c @@ -577,7 +577,6 @@ void sane_kds_s2000w_net_open() assert_int_equal(status, SANE_STATUS_GOOD); kds_s2000w_option_descriptor_free_option_descriptors(); - kds_s2000w_client_free(); free_handler(h); h = NULL; kds_s2000w_client_response_free(resp); @@ -603,7 +602,6 @@ void sane_kds_s2000w_net_open_busy_device() assert_int_equal(status, SANE_STATUS_DEVICE_BUSY); kds_s2000w_option_descriptor_free_option_descriptors(); - kds_s2000w_client_free(); free_handler(h); h = NULL; kds_s2000w_client_response_free(resp);