From: Kevin Day Date: Fri, 4 Mar 2022 04:56:07 +0000 (-0600) Subject: Bugfix: Incorrect variable type used for capability flag. X-Git-Tag: 0.5.9~95 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=02289af5ea0087a9f597c104b4cbaed71f68f482;p=fll Bugfix: Incorrect variable type used for capability flag. CLang properly identifies this problem but GCC does not. --- diff --git a/level_0/f_capability/tests/unit/c/test-capability-clear_flag.c b/level_0/f_capability/tests/unit/c/test-capability-clear_flag.c index f2bf87e..e8dd3b1 100644 --- a/level_0/f_capability/tests/unit/c/test-capability-clear_flag.c +++ b/level_0/f_capability/tests/unit/c/test-capability-clear_flag.c @@ -8,10 +8,10 @@ extern "C" { #ifndef _di_level_0_parameter_checking_ void test__f_capability_clear_flag__parameter_checking(void **state) { - const f_capability_flag_value_t flag_value = f_capability_flag_value_t_initialize; + const f_capability_flag_t flag = f_capability_flag_t_initialize; { - const f_status_t status = f_capability_clear_flag(flag_value, 0); + const f_status_t status = f_capability_clear_flag(flag, 0); assert_int_equal(F_status_set_fine(status), F_parameter); } @@ -21,7 +21,7 @@ extern "C" { void test__f_capability_clear_flag__works(void **state) { f_capability_t capability = f_capability_t_initialize; - const f_capability_flag_value_t flag_value = f_capability_flag_value_t_initialize; + const f_capability_flag_t flag = f_capability_flag_t_initialize; #if defined(_di_libcap_) printf("[ WARN ] f_capability_clear_flag() is not implemented and cannot be fully tested.\n"); @@ -30,7 +30,7 @@ void test__f_capability_clear_flag__works(void **state) { #endif // defined(_di_libcap_) { - const f_status_t status = f_capability_clear_flag(flag_value, &capability); + const f_status_t status = f_capability_clear_flag(flag, &capability); #if defined(_di_libcap_) assert_int_equal(F_status_set_fine(status), F_implemented_not); @@ -44,7 +44,7 @@ void test__f_capability_clear_flag__fails(void **state) { #if !defined(_di_libcap_) f_capability_t capability = f_capability_t_initialize; - const f_capability_flag_value_t flag_value = f_capability_flag_value_t_initialize; + const f_capability_flag_t flag = f_capability_flag_t_initialize; int errnos[] = { EINVAL, @@ -61,7 +61,7 @@ void test__f_capability_clear_flag__fails(void **state) { will_return(__wrap_cap_clear_flag, true); will_return(__wrap_cap_clear_flag, errnos[i]); - const f_status_t status = f_capability_clear_flag(flag_value, &capability); + const f_status_t status = f_capability_clear_flag(flag, &capability); assert_int_equal(F_status_set_fine(status), statuss[i]); } // for