From 9c380afe8d3ed557b771ddcd9777cd6c66e67212 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 +++--- level_0/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 | 12 ++++++------ level_0/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 | 8 ++++---- 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, 49 insertions(+), 49 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 2aa8e20..21f5fba 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_string_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].key.string, source.key.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].key.string, (const char * const) source.key.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_number_unsigned_t j = 0; j < destination.array[0].key.used; ++j) { assert_int_equal(destination.array[0].key.string[j], source.key.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 03b97d5..5614a72 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_string_map_multis_append_all__works(void **state) { status = f_utf_string_dynamic_append(test_key, &source.array[source.used].key); assert_int_equal(status, F_okay); - assert_string_equal(source.array[source.used].key.string, test_key.string); + assert_string_equal((const char * const) source.array[source.used].key.string, (const char * const) test_key.string); assert_int_equal(source.array[source.used].key.used, test_key.used); status = f_utf_string_dynamics_append_all(test_value, &source.array[source.used].value); @@ -39,8 +39,8 @@ void test__f_utf_string_map_multis_append_all__works(void **state) { assert_int_equal(status, F_okay); 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_string_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].key.string, source.array[i].key.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].key.string, (const char * const) source.array[i].key.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 cf3d8d1..f4b4dd0 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,7 +43,7 @@ void test__f_utf_string_map_multiss_append__works(void **state) { status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].key); assert_int_equal(status, F_okay); - assert_string_equal(source.array[source.used].key.string, test_names[source.used].string); + assert_string_equal((const char * const) source.array[source.used].key.string, (const char * const) test_names[source.used].string); assert_int_equal(source.array[source.used].key.used, 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_string_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_string_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].key.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].key.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 09f1e35..144597f 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_string_map_multiss_append_all__works(void **state) { assert_int_equal(status, F_okay); assert_int_equal(source.array[source.used].array[i].key.used, test_names[i].used); - assert_string_equal(source.array[source.used].array[i].key.string, test_names[i].string); + assert_string_equal((const char * const) source.array[source.used].array[i].key.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_string_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_string_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].key.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].key.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 b9d7b91..6bf5e96 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_string_maps_append__works(void **state) { f_status_t status = f_utf_string_dynamic_append(test_key, &source.key); assert_int_equal(status, F_okay); - assert_string_equal(source.key.string, test_key.string); + assert_string_equal((const char * const) source.key.string, (const char * const) test_key.string); assert_int_equal(source.key.used, test_key.used); status = f_utf_string_dynamic_append(test_value, &source.value); assert_int_equal(status, F_okay); - 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_string_maps_append__works(void **state) { assert_int_equal(destination.used, 1); assert_int_equal(destination.array[0].key.used, source.key.used); assert_int_equal(destination.array[0].value.used, source.value.used); - assert_string_equal(destination.array[0].key.string, source.key.string); - assert_string_equal(destination.array[0].value.string, source.value.string); + assert_string_equal((const char * const) destination.array[0].key.string, (const char * const) source.key.string); + assert_string_equal((const char * const) destination.array[0].value.string, (const char * const) source.value.string); } free((void *) source.key.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 e397e24..624893b 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_string_maps_append_all__works(void **state) { status = f_utf_string_dynamic_append(test_key, &source.array[source.used].key); assert_int_equal(status, F_okay); - assert_string_equal(source.array[source.used].key.string, test_key.string); + assert_string_equal((const char * const) source.array[source.used].key.string, (const char * const) test_key.string); assert_int_equal(source.array[source.used].key.used, test_key.used); status = f_utf_string_dynamic_append(test_value, &source.array[source.used].value); assert_int_equal(status, F_okay); - 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_string_maps_append_all__works(void **state) { assert_int_equal(destination.array[i].key.used, source.array[i].key.used); assert_int_equal(destination.array[i].value.used, source.array[i].value.used); - assert_string_equal(destination.array[i].key.string, source.array[i].key.string); - assert_string_equal(destination.array[i].value.string, source.array[i].value.string); + assert_string_equal((const char * const) destination.array[i].key.string, (const char * const) source.array[i].key.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 eccbb10..be6aa47 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,13 +32,13 @@ void test__f_utf_string_mapss_append__works(void **state) { status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].key); assert_int_equal(status, F_okay); - assert_string_equal(source.array[source.used].key.string, test_names[source.used].string); + assert_string_equal((const char * const) source.array[source.used].key.string, (const char * const) test_names[source.used].string); assert_int_equal(source.array[source.used].key.used, 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_okay); - assert_string_equal(source.array[source.used].value.string, test_values[source.used].string); + assert_string_equal((const char * const) source.array[source.used].value.string, (const char * const) test_values[source.used].string); assert_int_equal(source.array[source.used].value.used, test_values[source.used].used); } // for } @@ -54,8 +54,8 @@ void test__f_utf_string_mapss_append__works(void **state) { assert_int_equal(destination.array[0].array[i].key.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].key.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].key.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 a3d9656..4509cba 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_string_mapss_append_all__works(void **state) { status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].key); assert_int_equal(status, F_okay); - assert_string_equal(source.array[source.used].array[i].key.string, test_names[i].string); + assert_string_equal((const char * const) source.array[source.used].array[i].key.string, (const char * const) test_names[i].string); assert_int_equal(source.array[source.used].array[i].key.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_okay); - 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_string_mapss_append_all__works(void **state) { assert_int_equal(destination.array[j].array[i].key.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].key.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].key.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 ccc1129..6df4199 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_string_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 84da244..f9ac703 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_string_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 7606394..45be389 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_string_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 8b42071..a074ed5 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_string_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