From: Bastian Dehn Date: Tue, 24 Dec 2024 08:50:36 +0000 (+0100) Subject: fix simple scan reinit options X-Git-Tag: v1.0.12^2~3 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=c37fcbd735378154295de0166867838935976384;p=sane-kds-s2000w-net.git fix simple scan reinit options --- diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index eb5731e..6fa9159 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -46,7 +46,6 @@ SANE_Status _sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback #endif *version_code = SANE_VERSION_CODE(MAJOR, MINOR, PATCH); - kds_s2000w_option_descriptor_init_option_descriptors(); return SANE_STATUS_GOOD; } @@ -91,6 +90,7 @@ SANE_Status _sane_kds_s2000w_net_open(SANE_String_Const devicename, if (strcmp(devicename, "kds_s2000w_net") != 0) return SANE_STATUS_INVAL; + kds_s2000w_option_descriptor_init_option_descriptors(); kds_s2000w_handler_open(devicename, handle); handler* h = (handler*) *handle; if (h->state == BUSY) diff --git a/tests/kds_s2000w_net_tests.c b/tests/kds_s2000w_net_tests.c index 271578f..0796e54 100644 --- a/tests/kds_s2000w_net_tests.c +++ b/tests/kds_s2000w_net_tests.c @@ -5,6 +5,7 @@ #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" @@ -432,6 +433,7 @@ void sane_kds_s2000w_net_open() assert_int_equal(h->sessionid, 1251877821); assert_int_equal(status, SANE_STATUS_GOOD); + kds_s2000w_option_descriptor_free_option_descriptors(); free_handler(h); h = NULL; kds_s2000w_client_response_free(resp); @@ -456,6 +458,7 @@ void sane_kds_s2000w_net_open_busy_device() assert_int_equal(h->state, BUSY); assert_int_equal(status, SANE_STATUS_DEVICE_BUSY); + kds_s2000w_option_descriptor_free_option_descriptors(); free_handler(h); h = NULL; kds_s2000w_client_response_free(resp);