From 02289af5ea0087a9f597c104b4cbaed71f68f482 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 3 Mar 2022 22:56:07 -0600 Subject: [PATCH] Bugfix: Incorrect variable type used for capability flag. CLang properly identifies this problem but GCC does not. --- .../f_capability/tests/unit/c/test-capability-clear_flag.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 -- 1.8.3.1