]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add tests status assert
authorBastian Dehn <hhaalo@arcor.de>
Sat, 25 Oct 2025 16:46:22 +0000 (18:46 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 25 Oct 2025 16:46:22 +0000 (18:46 +0200)
tests/kds_s2000w_net_set_opt_tests.c

index e6bea79e8b3ba64741ea16178cfd12df2224433b..ef00a546f668dd6b8b35252b3dd783a4041d13e9 100644 (file)
@@ -109,12 +109,13 @@ void kds_s2000w_net_set_option_string(void** state)
        expect_function_call(__wrap_kds_s2000w_client_set_option);
        expect_function_call(__wrap_kds_s2000w_client_set_option);
 
-       sane_kds_s2000w_net_control_option(h, 3, SANE_ACTION_SET_VALUE, "Gray", info);
+       SANE_Status status = sane_kds_s2000w_net_control_option(h, 3, SANE_ACTION_SET_VALUE, "Gray", info);
 
        json_object* config = json_object_object_get(h->scanner_config, "Configuration");
        json_object* value_object = json_object_object_get(config, COLOR_MODE);
        const char* value = json_object_get_string(value_object);
 
+       assert_int_equal(status, SANE_STATUS_GOOD);
        assert_string_equal(value, "Gray");
        assert_int_equal(*info, SANE_INFO_RELOAD_PARAMS);
 
@@ -148,12 +149,13 @@ void kds_s2000w_net_set_option_int(void** state)
        expect_function_call(__wrap_kds_s2000w_client_set_option);
        expect_function_call(__wrap_kds_s2000w_client_set_option);
 
-       sane_kds_s2000w_net_control_option(h, 15, SANE_ACTION_SET_VALUE, set_value, NULL);
+       SANE_Status status = sane_kds_s2000w_net_control_option(h, 15, SANE_ACTION_SET_VALUE, set_value, NULL);
 
        json_object* config = json_object_object_get(h->scanner_config, "Configuration");
        json_object* value_object = json_object_object_get(config, FOREGROUND_BOLDNESS_AGGRESSIVENESS);
        const char* value = json_object_get_string(value_object);
 
+       assert_int_equal(status, SANE_STATUS_GOOD);
        assert_int_equal(value, 5);
 
        kds_s2000w_client_response_free(set_opt_resp);