]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change ssl verify config param to bool
authorBastian Dehn <hhaalo@arcor.de>
Sun, 9 Feb 2025 18:41:01 +0000 (19:41 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 9 Feb 2025 18:41:01 +0000 (19:41 +0100)
src/kds_s2000w_config.h
tests/kds_s2000w_read_config_tests.c

index c30e0f84fb3ab88ed9974949c93864c5fa023d17..fc8ea67378b07329eeff35af72cfdc3e93cd204c 100644 (file)
@@ -1,13 +1,14 @@
 #ifndef KDS_S2000W_CONFIG_H
 #define KDS_S2000W_CONFIG_H
 #include <stdint.h>
+#include <stdbool.h>
 
 typedef struct {
        char* scanner_url;
        char* username;
        uint8_t log_level;
        uint8_t heartbeat;
-       uint8_t ssl_verify;
+       bool ssl_verify;
 } program_config;
 
 // sanei use strdup it must be free static variable
index 911082e714793a8dddc9c45563e58c14fcadda68..23dc8f8ccca12bea28d342418b3d32b25883b181 100644 (file)
@@ -25,7 +25,7 @@ void kds_s2000w_config_read_empty_config_test()
        assert_string_equal(config->scanner_url, "");
        assert_string_equal(config->username, "");
        assert_int_equal(config->heartbeat, 1);
-       assert_int_equal(config->ssl_verify, 0);
+       assert_false(config->ssl_verify);
 
        kds_s2000w_config_free(config);
        config = NULL;
@@ -98,7 +98,7 @@ void kds_s2000w_config_ssl_verify_on_test()
 
        program_config* config = kds_s2000w_config_load(input_stream);
 
-       assert_int_equal(config->ssl_verify, 1);
+       assert_true(config->ssl_verify);
 
        kds_s2000w_config_free(config);
        config = NULL;