From 8e4d0eca72b5a528f5b2707f2a16e70b9332e8f7 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 21 May 2024 21:38:56 -0500 Subject: [PATCH] Cleanup: Warning in unit f_utf tests under GCC 14 regarding type. The string comparison of an integer based value is correct. Add an explicit cast to make this intent clear and to silence the warnings. --- level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c | 6 +++--- .../f_utf/tests/unit/c/test-utf-map_multis_append_all.c | 12 ++++++------ level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c | 14 +++++++------- .../f_utf/tests/unit/c/test-utf-map_multiss_append_all.c | 12 ++++++------ level_0/f_utf/tests/unit/c/test-utf-maps_append.c | 8 ++++---- level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c | 8 ++++---- level_0/f_utf/tests/unit/c/test-utf-mapss_append.c | 12 ++++++------ level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c | 8 ++++---- level_0/f_utf/tests/unit/c/test-utf-triples_append.c | 6 +++--- level_0/f_utf/tests/unit/c/test-utf-triples_append_all.c | 6 +++--- level_0/f_utf/tests/unit/c/test-utf-tripless_append.c | 6 +++--- level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.c | 6 +++--- 12 files changed, 52 insertions(+), 52 deletions(-) diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c index 59c1713..ef1faef 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c @@ -55,9 +55,9 @@ void test__f_utf_map_multis_append__works(void **state) { assert_int_equal(destination.array[0].value.array[0].used, source.value.array[0].used); assert_int_equal(destination.array[0].value.array[1].used, source.value.array[1].used); - assert_string_equal(destination.array[0].name.string, source.name.string); - assert_string_equal(destination.array[0].value.array[0].string, source.value.array[0].string); - assert_string_equal(destination.array[0].value.array[1].string, source.value.array[1].string); + assert_string_equal((const char * const) destination.array[0].name.string, (const char * const) source.name.string); + assert_string_equal((const char * const) destination.array[0].value.array[0].string, (const char * const) source.value.array[0].string); + assert_string_equal((const char * const) destination.array[0].value.array[1].string, (const char * const) source.value.array[1].string); for (f_array_length_t j = 0; j < destination.array[0].name.used; ++j) { assert_int_equal(destination.array[0].name.string[j], source.name.string[j]); diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.c index d9c9f29..04b9850 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.c @@ -31,7 +31,7 @@ void test__f_utf_map_multis_append_all__works(void **state) { status = f_utf_string_dynamic_append(test_name, &source.array[source.used].name); assert_int_equal(status, F_none); - assert_string_equal(source.array[source.used].name.string, test_name.string); + assert_string_equal((const char * const) source.array[source.used].name.string, (const char * const) test_name.string); assert_int_equal(source.array[source.used].name.used, test_name.used); status = f_utf_string_dynamics_append_all(test_value, &source.array[source.used].value); @@ -39,8 +39,8 @@ void test__f_utf_map_multis_append_all__works(void **state) { assert_int_equal(status, F_none); assert_int_equal(source.array[source.used].value.array[0].used, test_value.array[0].used); assert_int_equal(source.array[source.used].value.array[1].used, test_value.array[1].used); - assert_string_equal(source.array[source.used].value.array[0].string, test_value.array[0].string); - assert_string_equal(source.array[source.used].value.array[1].string, test_value.array[1].string); + assert_string_equal((const char * const) source.array[source.used].value.array[0].string, (const char * const) test_value.array[0].string); + assert_string_equal((const char * const) source.array[source.used].value.array[1].string, (const char * const) test_value.array[1].string); } // for } @@ -58,9 +58,9 @@ void test__f_utf_map_multis_append_all__works(void **state) { assert_int_equal(destination.array[i].value.array[0].used, source.array[i].value.array[0].used); assert_int_equal(destination.array[i].value.array[1].used, source.array[i].value.array[1].used); - assert_string_equal(destination.array[i].name.string, source.array[i].name.string); - assert_string_equal(destination.array[i].value.array[0].string, source.array[i].value.array[0].string); - assert_string_equal(destination.array[i].value.array[1].string, source.array[i].value.array[1].string); + assert_string_equal((const char * const) destination.array[i].name.string, (const char * const) source.array[i].name.string); + assert_string_equal((const char * const) destination.array[i].value.array[0].string, (const char * const) source.array[i].value.array[0].string); + assert_string_equal((const char * const) destination.array[i].value.array[1].string, (const char * const) source.array[i].value.array[1].string); } // for } diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c index 08cb2ec..32096c0 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c @@ -43,8 +43,8 @@ void test__f_utf_map_multiss_append__works(void **state) { status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].name); assert_int_equal(status, F_none); - assert_string_equal(source.array[source.used].name.string, test_names[source.used].string); - assert_int_equal(source.array[source.used].name.used, test_names[source.used].used); + assert_string_equal((const char * const) source.array[source.used].name.string, (const char * const) test_names[source.used].string); + assert_int_equal((const char * const) source.array[source.used].name.used, (const char * const) test_names[source.used].used); status = f_utf_string_dynamics_append_all(test_values[source.used], &source.array[source.used].value); @@ -53,8 +53,8 @@ void test__f_utf_map_multiss_append__works(void **state) { assert_int_equal(source.array[source.used].value.array[0].used, test_values[source.used].array[0].used); assert_int_equal(source.array[source.used].value.array[1].used, test_values[source.used].array[1].used); - assert_string_equal(source.array[source.used].value.array[0].string, test_values[source.used].array[0].string); - assert_string_equal(source.array[source.used].value.array[1].string, test_values[source.used].array[1].string); + assert_string_equal((const char * const) source.array[source.used].value.array[0].string, (const char * const) test_values[source.used].array[0].string); + assert_string_equal((const char * const) source.array[source.used].value.array[1].string, (const char * const) test_values[source.used].array[1].string); } // for } @@ -71,9 +71,9 @@ void test__f_utf_map_multiss_append__works(void **state) { assert_int_equal(destination.array[0].array[i].value.array[0].used, test_values[i].array[0].used); assert_int_equal(destination.array[0].array[i].value.array[1].used, test_values[i].array[1].used); - assert_string_equal(destination.array[0].array[i].name.string, test_names[i].string); - assert_string_equal(destination.array[0].array[i].value.array[0].string, test_values[i].array[0].string); - assert_string_equal(destination.array[0].array[i].value.array[1].string, test_values[i].array[1].string); + assert_string_equal((const char * const) destination.array[0].array[i].name.string, (const char * const) test_names[i].string); + assert_string_equal((const char * const) destination.array[0].array[i].value.array[0].string, (const char * const) test_values[i].array[0].string); + assert_string_equal((const char * const) destination.array[0].array[i].value.array[1].string, (const char * const) test_values[i].array[1].string); } // for } diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.c index a729aec..f730d9a 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.c @@ -56,7 +56,7 @@ void test__f_utf_map_multiss_append_all__works(void **state) { assert_int_equal(status, F_none); assert_int_equal(source.array[source.used].array[i].name.used, test_names[i].used); - assert_string_equal(source.array[source.used].array[i].name.string, test_names[i].string); + assert_string_equal((const char * const) source.array[source.used].array[i].name.string, (const char * const) test_names[i].string); status = f_utf_string_dynamics_append_all(test_values[i], &source.array[source.used].array[i].value); @@ -65,8 +65,8 @@ void test__f_utf_map_multiss_append_all__works(void **state) { assert_int_equal(source.array[source.used].array[i].value.array[0].used, test_values[i].array[0].used); assert_int_equal(source.array[source.used].array[i].value.array[1].used, test_values[i].array[1].used); - assert_string_equal(source.array[source.used].array[i].value.array[0].string, test_values[i].array[0].string); - assert_string_equal(source.array[source.used].array[i].value.array[1].string, test_values[i].array[1].string); + assert_string_equal((const char * const) source.array[source.used].array[i].value.array[0].string, (const char * const) test_values[i].array[0].string); + assert_string_equal((const char * const) source.array[source.used].array[i].value.array[1].string, (const char * const) test_values[i].array[1].string); } // for source.array[source.used].used = length_inner; @@ -88,9 +88,9 @@ void test__f_utf_map_multiss_append_all__works(void **state) { assert_int_equal(destination.array[j].array[i].value.array[0].used, test_values[i].array[0].used); assert_int_equal(destination.array[j].array[i].value.array[1].used, test_values[i].array[1].used); - assert_string_equal(destination.array[j].array[i].name.string, test_names[i].string); - assert_string_equal(destination.array[j].array[i].value.array[0].string, test_values[i].array[0].string); - assert_string_equal(destination.array[j].array[i].value.array[1].string, test_values[i].array[1].string); + assert_string_equal((const char * const) destination.array[j].array[i].name.string, (const char * const) test_names[i].string); + assert_string_equal((const char * const) destination.array[j].array[i].value.array[0].string, (const char * const) test_values[i].array[0].string); + assert_string_equal((const char * const) destination.array[j].array[i].value.array[1].string, (const char * const) test_values[i].array[1].string); } // for } // for } diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_append.c b/level_0/f_utf/tests/unit/c/test-utf-maps_append.c index de5ca2b..5ab396b 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_append.c @@ -17,13 +17,13 @@ void test__f_utf_maps_append__works(void **state) { f_status_t status = f_utf_string_dynamic_append(test_name, &source.name); assert_int_equal(status, F_none); - assert_string_equal(source.name.string, test_name.string); + assert_string_equal((const char * const) source.name.string, (const char * const) test_name.string); assert_int_equal(source.name.used, test_name.used); status = f_utf_string_dynamic_append(test_value, &source.value); assert_int_equal(status, F_none); - assert_string_equal(source.value.string, test_value.string); + assert_string_equal((const char * const) source.value.string, (const char * const) test_value.string); assert_int_equal(source.value.used, test_value.used); } @@ -34,8 +34,8 @@ void test__f_utf_maps_append__works(void **state) { assert_int_equal(destination.used, 1); assert_int_equal(destination.array[0].name.used, source.name.used); assert_int_equal(destination.array[0].value.used, source.value.used); - assert_string_equal(destination.array[0].name.string, source.name.string); - assert_string_equal(destination.array[0].value.string, source.value.string); + assert_string_equal((const char * const) destination.array[0].name.string, (const char * const) source.name.string); + assert_string_equal((const char * const) destination.array[0].value.string, (const char * const) source.value.string); } free((void *) source.name.string); diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c index 12ccf8a..c00b1f2 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c @@ -25,13 +25,13 @@ void test__f_utf_maps_append_all__works(void **state) { status = f_utf_string_dynamic_append(test_name, &source.array[source.used].name); assert_int_equal(status, F_none); - assert_string_equal(source.array[source.used].name.string, test_name.string); + assert_string_equal((const char * const) source.array[source.used].name.string, (const char * const) test_name.string); assert_int_equal(source.array[source.used].name.used, test_name.used); status = f_utf_string_dynamic_append(test_value, &source.array[source.used].value); assert_int_equal(status, F_none); - assert_string_equal(source.array[source.used].value.string, test_value.string); + assert_string_equal((const char * const) source.array[source.used].value.string, (const char * const) test_value.string); assert_int_equal(source.array[source.used].value.used, test_value.used); } // for } @@ -48,8 +48,8 @@ void test__f_utf_maps_append_all__works(void **state) { assert_int_equal(destination.array[i].name.used, source.array[i].name.used); assert_int_equal(destination.array[i].value.used, source.array[i].value.used); - assert_string_equal(destination.array[i].name.string, source.array[i].name.string); - assert_string_equal(destination.array[i].value.string, source.array[i].value.string); + assert_string_equal((const char * const) destination.array[i].name.string, (const char * const) source.array[i].name.string); + assert_string_equal((const char * const) destination.array[i].value.string, (const char * const) source.array[i].value.string); } // for } diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_append.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_append.c index 6b7eb41..b6ec343 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-mapss_append.c @@ -32,14 +32,14 @@ void test__f_utf_mapss_append__works(void **state) { status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].name); assert_int_equal(status, F_none); - assert_string_equal(source.array[source.used].name.string, test_names[source.used].string); - assert_int_equal(source.array[source.used].name.used, test_names[source.used].used); + assert_string_equal((const char * const) source.array[source.used].name.string, (const char * const) test_names[source.used].string); + assert_int_equal((const char * const) source.array[source.used].name.used, (const char * const) test_names[source.used].used); status = f_utf_string_dynamic_append(test_values[source.used], &source.array[source.used].value); assert_int_equal(status, F_none); - assert_string_equal(source.array[source.used].value.string, test_values[source.used].string); - assert_int_equal(source.array[source.used].value.used, test_values[source.used].used); + assert_string_equal((const char * const) source.array[source.used].value.string, (const char * const) test_values[source.used].string); + assert_int_equal((const char * const) source.array[source.used].value.used, (const char * const) test_values[source.used].used); } // for } @@ -54,8 +54,8 @@ void test__f_utf_mapss_append__works(void **state) { assert_int_equal(destination.array[0].array[i].name.used, test_names[i].used); assert_int_equal(destination.array[0].array[i].value.used, test_values[i].used); - assert_string_equal(destination.array[0].array[i].name.string, test_names[i].string); - assert_string_equal(destination.array[0].array[i].value.string, test_values[i].string); + assert_string_equal((const char * const) destination.array[0].array[i].name.string, (const char * const) test_names[i].string); + assert_string_equal((const char * const) destination.array[0].array[i].value.string, (const char * const) test_values[i].string); } // for } diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c index f7f1e11..fe38257 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c @@ -44,13 +44,13 @@ void test__f_utf_mapss_append_all__works(void **state) { status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].name); assert_int_equal(status, F_none); - assert_string_equal(source.array[source.used].array[i].name.string, test_names[i].string); + assert_string_equal((const char * const) source.array[source.used].array[i].name.string, (const char * const) test_names[i].string); assert_int_equal(source.array[source.used].array[i].name.used, test_names[i].used); status = f_utf_string_dynamic_append(test_values[i], &source.array[source.used].array[i].value); assert_int_equal(status, F_none); - assert_string_equal(source.array[source.used].array[i].value.string, test_values[i].string); + assert_string_equal((const char * const) source.array[source.used].array[i].value.string, (const char * const) test_values[i].string); assert_int_equal(source.array[source.used].array[i].value.used, test_values[i].used); } // for @@ -71,8 +71,8 @@ void test__f_utf_mapss_append_all__works(void **state) { assert_int_equal(destination.array[j].array[i].name.used, test_names[i].used); assert_int_equal(destination.array[j].array[i].value.used, test_values[i].used); - assert_string_equal(destination.array[j].array[i].name.string, test_names[i].string); - assert_string_equal(destination.array[j].array[i].value.string, test_values[i].string); + assert_string_equal((const char * const) destination.array[j].array[i].name.string, (const char * const) test_names[i].string); + assert_string_equal((const char * const) destination.array[j].array[i].value.string, (const char * const) test_values[i].string); } // for } // for } diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_append.c b/level_0/f_utf/tests/unit/c/test-utf-triples_append.c index ead9e96..d9436d4 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-triples_append.c @@ -23,9 +23,9 @@ void test__f_utf_triples_append__works(void **state) { assert_int_equal(destination.array[0].b.used, source.b.used); assert_int_equal(destination.array[0].c.used, source.c.used); - assert_string_equal(destination.array[0].a.string, source.a.string); - assert_string_equal(destination.array[0].b.string, source.b.string); - assert_string_equal(destination.array[0].c.string, source.c.string); + assert_string_equal((const char * const) destination.array[0].a.string, (const char * const) source.a.string); + assert_string_equal((const char * const) destination.array[0].b.string, (const char * const) source.b.string); + assert_string_equal((const char * const) destination.array[0].c.string, (const char * const) source.c.string); } free((void *) destination.array[0].a.string); diff --git a/level_0/f_utf/tests/unit/c/test-utf-triples_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-triples_append_all.c index 663e240..c525d22 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-triples_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-triples_append_all.c @@ -38,9 +38,9 @@ void test__f_utf_triples_append_all__works(void **state) { assert_int_equal(destination.array[i].b.used, source.array[i].b.used); assert_int_equal(destination.array[i].c.used, source.array[i].c.used); - assert_string_equal(destination.array[i].a.string, source.array[i].a.string); - assert_string_equal(destination.array[i].b.string, source.array[i].b.string); - assert_string_equal(destination.array[i].c.string, source.array[i].c.string); + assert_string_equal((const char * const) destination.array[i].a.string, (const char * const) source.array[i].a.string); + assert_string_equal((const char * const) destination.array[i].b.string, (const char * const) source.array[i].b.string); + assert_string_equal((const char * const) destination.array[i].c.string, (const char * const) source.array[i].c.string); } // for } diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_append.c b/level_0/f_utf/tests/unit/c/test-utf-tripless_append.c index 92ebbf1..bb1a733 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-tripless_append.c @@ -37,9 +37,9 @@ void test__f_utf_tripless_append__works(void **state) { assert_int_equal(destination.array[0].array[i].b.used, sources_array[i].b.used); assert_int_equal(destination.array[0].array[i].c.used, sources_array[i].c.used); - assert_string_equal(destination.array[0].array[i].a.string, sources_array[i].a.string); - assert_string_equal(destination.array[0].array[i].b.string, sources_array[i].b.string); - assert_string_equal(destination.array[0].array[i].c.string, sources_array[i].c.string); + assert_string_equal((const char * const) destination.array[0].array[i].a.string, (const char * const) sources_array[i].a.string); + assert_string_equal((const char * const) destination.array[0].array[i].b.string, (const char * const) sources_array[i].b.string); + assert_string_equal((const char * const) destination.array[0].array[i].c.string, (const char * const) sources_array[i].c.string); } // for } diff --git a/level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.c index 8d8cb24..fd484fd 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-tripless_append_all.c @@ -58,9 +58,9 @@ void test__f_utf_tripless_append_all__works(void **state) { assert_int_equal(destination.array[j].array[i].b.used, sources_set_array[j].array[i].b.used); assert_int_equal(destination.array[j].array[i].c.used, sources_set_array[j].array[i].c.used); - assert_string_equal(destination.array[j].array[i].a.string, sources_set_array[j].array[i].a.string); - assert_string_equal(destination.array[j].array[i].b.string, sources_set_array[j].array[i].b.string); - assert_string_equal(destination.array[j].array[i].c.string, sources_set_array[j].array[i].c.string); + assert_string_equal((const char * const) destination.array[j].array[i].a.string, (const char * const) sources_set_array[j].array[i].a.string); + assert_string_equal((const char * const) destination.array[j].array[i].b.string, (const char * const) sources_set_array[j].array[i].b.string); + assert_string_equal((const char * const) destination.array[j].array[i].c.string, (const char * const) sources_set_array[j].array[i].c.string); } // for } // for } -- 1.8.3.1