]> Kevux Git Server - fll/commitdiff
Bugfix: Incorrect variable type used for capability flag.
authorKevin Day <thekevinday@gmail.com>
Fri, 4 Mar 2022 04:56:07 +0000 (22:56 -0600)
committerKevin Day <thekevinday@gmail.com>
Fri, 4 Mar 2022 04:56:07 +0000 (22:56 -0600)
CLang properly identifies this problem but GCC does not.

level_0/f_capability/tests/unit/c/test-capability-clear_flag.c

index f2bf87e128fc47026e4c134773f5eaf42450e9b1..e8dd3b171734b27acffe2f6286c49af6dc3a7c90 100644 (file)
@@ -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