[RFC PATCH 3/6] libsepol/tests: rename bool indentifiers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoid using the identifier `bool` to improve support with future C
standards.  C23 is about to make `bool` a predefined macro (see N2654).

Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>
---
 libsepol/tests/test-linker-cond-map.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/libsepol/tests/test-linker-cond-map.c b/libsepol/tests/test-linker-cond-map.c
index 6ea0e4c2..14206666 100644
--- a/libsepol/tests/test-linker-cond-map.c
+++ b/libsepol/tests/test-linker-cond-map.c
@@ -51,7 +51,7 @@
  */
 
 typedef struct test_cond_expr {
-	const char *bool;
+	const char *boolean;
 	uint32_t expr_type;
 } test_cond_expr_t;
 
@@ -69,18 +69,18 @@ static void test_cond_expr_mapping(policydb_t * p, avrule_decl_t * d, test_cond_
 		CU_ASSERT_FATAL(expr != NULL);
 
 		CU_ASSERT(expr->expr_type == bools[i].expr_type);
-		if (bools[i].bool) {
-			CU_ASSERT(strcmp(p->sym_val_to_name[SYM_BOOLS][expr->boolean - 1], bools[i].bool) == 0);
+		if (bools[i].boolean) {
+			CU_ASSERT(strcmp(p->sym_val_to_name[SYM_BOOLS][expr->boolean - 1], bools[i].boolean) == 0);
 		}
 		expr = expr->next;
 	}
 }
 
-static void test_bool_state(policydb_t * p, const char *bool, int state)
+static void test_bool_state(policydb_t * p, const char *boolean, int state)
 {
 	cond_bool_datum_t *b;
 
-	b = hashtab_search(p->p_bools.table, bool);
+	b = hashtab_search(p->p_bools.table, boolean);
 	CU_ASSERT_FATAL(b != NULL);
 	CU_ASSERT(b->state == state);
 }
@@ -100,7 +100,7 @@ void base_cond_tests(policydb_t * base)
 	test_sym_presence(base, "g_b_bool_1", SYM_BOOLS, SCOPE_DECL, decls, 1);
 	test_bool_state(base, "g_b_bool_1", 0);
 	/* conditional expression mapped correctly */
-	bools[0].bool = "g_b_bool_1";
+	bools[0].boolean = "g_b_bool_1";
 	bools[0].expr_type = COND_BOOL;
 	test_cond_expr_mapping(base, d, bools, 1);
 
@@ -110,7 +110,7 @@ void base_cond_tests(policydb_t * base)
 	test_sym_presence(base, "o1_b_bool_1", SYM_BOOLS, SCOPE_DECL, decls, 1);
 	test_bool_state(base, "o1_b_bool_1", 1);
 	/* conditional expression mapped correctly */
-	bools[0].bool = "o1_b_bool_1";
+	bools[0].boolean = "o1_b_bool_1";
 	bools[0].expr_type = COND_BOOL;
 	test_cond_expr_mapping(base, d, bools, 1);
 
@@ -128,7 +128,7 @@ void module_cond_tests(policydb_t * base)
 	test_sym_presence(base, "g_m1_bool_1", SYM_BOOLS, SCOPE_DECL, decls, 1);
 	test_bool_state(base, "g_m1_bool_1", 1);
 	/* conditional expression mapped correctly */
-	bools[0].bool = "g_m1_bool_1";
+	bools[0].boolean = "g_m1_bool_1";
 	bools[0].expr_type = COND_BOOL;
 	test_cond_expr_mapping(base, d, bools, 1);
 
@@ -138,7 +138,7 @@ void module_cond_tests(policydb_t * base)
 	test_sym_presence(base, "o1_m1_bool_1", SYM_BOOLS, SCOPE_DECL, decls, 1);
 	test_bool_state(base, "o1_m1_bool_1", 0);
 	/* conditional expression mapped correctly */
-	bools[0].bool = "o1_m1_bool_1";
+	bools[0].boolean = "o1_m1_bool_1";
 	bools[0].expr_type = COND_BOOL;
 	test_cond_expr_mapping(base, d, bools, 1);
 
@@ -150,11 +150,11 @@ void module_cond_tests(policydb_t * base)
 	test_bool_state(base, "g_m2_bool_1", 1);
 	test_bool_state(base, "g_m2_bool_2", 0);
 	/* conditional expression mapped correctly */
-	bools[0].bool = "g_m2_bool_1";
+	bools[0].boolean = "g_m2_bool_1";
 	bools[0].expr_type = COND_BOOL;
-	bools[1].bool = "g_m2_bool_2";
+	bools[1].boolean = "g_m2_bool_2";
 	bools[1].expr_type = COND_BOOL;
-	bools[2].bool = NULL;
+	bools[2].boolean = NULL;
 	bools[2].expr_type = COND_AND;
 	test_cond_expr_mapping(base, d, bools, 3);
 }
-- 
2.38.1




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux