From 47d4fd4d915d7da1bda90a2b63ba0a776b061c4d Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 9 May 2022 22:55:28 -0500 Subject: [PATCH] Cleanup: Add -Wall when running tests and fix problems exposed by warnings. --- level_0/f_account/data/build/settings-tests | 2 +- level_0/f_capability/data/build/settings-tests | 2 +- .../tests/unit/c/test-capability-copy.c | 12 --------- .../tests/unit/c/test-capability-owner_set.c | 2 +- .../tests/unit/c/test-capability-to_name.c | 1 + .../tests/unit/c/test-capability-to_text.c | 1 + level_0/f_color/data/build/settings-tests | 2 +- level_0/f_color/tests/unit/c/test-color-save_1.c | 1 - level_0/f_color/tests/unit/c/test-color-save_2.c | 1 - level_0/f_color/tests/unit/c/test-color-save_3.c | 1 - level_0/f_color/tests/unit/c/test-color-save_4.c | 1 - level_0/f_color/tests/unit/c/test-color-save_5.c | 1 - level_0/f_console/data/build/settings-tests | 2 +- level_0/f_control_group/data/build/settings-tests | 2 +- level_0/f_conversion/data/build/settings-tests | 2 +- .../unit/c/test-conversion-character_to_binary.c | 2 +- .../unit/c/test-conversion-character_to_decimal.c | 2 +- .../c/test-conversion-character_to_duodecimal.c | 2 +- .../c/test-conversion-character_to_hexidecimal.c | 2 +- .../unit/c/test-conversion-character_to_octal.c | 2 +- level_0/f_directory/data/build/settings-tests | 2 +- level_0/f_environment/data/build/settings-tests | 2 +- level_0/f_execute/data/build/settings-tests | 2 +- level_0/f_file/data/build/settings-tests | 2 +- level_0/f_file/tests/unit/c/test-file-clone.c | 9 ------- level_0/f_file/tests/unit/c/test-file-link_read.c | 1 - .../f_file/tests/unit/c/test-file-link_read_at.c | 2 -- level_0/f_file/tests/unit/c/test-file-size_by_id.c | 4 --- level_0/f_file/tests/unit/c/test-file-stat_by_id.c | 4 --- .../f_file/tests/unit/c/test-file-stream_close.c | 31 ---------------------- .../f_file/tests/unit/c/test-file-stream_read.c | 4 --- .../tests/unit/c/test-file-stream_read_block.c | 4 --- .../tests/unit/c/test-file-stream_read_until.c | 4 --- .../f_file/tests/unit/c/test-file-stream_reopen.c | 2 -- level_0/f_file/tests/unit/c/test-file-type.c | 4 +-- level_0/f_file/tests/unit/c/test-file-type_at.c | 2 +- level_0/f_iki/data/build/settings-tests | 2 +- level_0/f_iki/tests/unit/c/test-iki-content_is.c | 4 --- .../tests/unit/c/test-iki-content_partial_is.c | 4 --- level_0/f_iki/tests/unit/c/test-iki-object_is.c | 4 --- .../tests/unit/c/test-iki-object_partial_is.c | 4 --- level_0/f_memory/data/build/settings-tests | 2 +- level_0/f_string/data/build/settings-tests | 2 +- .../unit/c/test-string-dynamicss_append_all.c | 2 -- .../tests/unit/c/test-string-map_multiss_append.c | 1 - .../unit/c/test-string-map_multiss_append_all.c | 2 -- .../tests/unit/c/test-string-maps_append_all.c | 1 - .../tests/unit/c/test-string-mapss_append_all.c | 2 -- .../unit/c/test-string-quantitys_append_all.c | 1 - .../tests/unit/c/test-string-ranges_append.c | 1 - level_0/f_type_array/data/build/settings-tests | 2 +- .../unit/c/test-type_array-array_lengthss_append.c | 1 - .../tests/unit/c/test-type_array-fll_ids_append.c | 1 - level_0/f_utf/data/build/settings-tests | 2 +- .../tests/unit/c/test-utf-dynamicss_append_all.c | 2 -- .../tests/unit/c/test-utf-map_multiss_append.c | 1 - .../tests/unit/c/test-utf-map_multiss_append_all.c | 2 -- .../f_utf/tests/unit/c/test-utf-maps_append_all.c | 1 - .../f_utf/tests/unit/c/test-utf-mapss_append_all.c | 2 -- 59 files changed, 26 insertions(+), 142 deletions(-) diff --git a/level_0/f_account/data/build/settings-tests b/level_0/f_account/data/build/settings-tests index 9796b67..0d22771 100644 --- a/level_0/f_account/data/build/settings-tests +++ b/level_0/f_account/data/build/settings-tests @@ -47,6 +47,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_capability/data/build/settings-tests b/level_0/f_capability/data/build/settings-tests index 9b7cd03..591492d 100644 --- a/level_0/f_capability/data/build/settings-tests +++ b/level_0/f_capability/data/build/settings-tests @@ -49,6 +49,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_capability/tests/unit/c/test-capability-copy.c b/level_0/f_capability/tests/unit/c/test-capability-copy.c index c9407f9..cd0ff40 100644 --- a/level_0/f_capability/tests/unit/c/test-capability-copy.c +++ b/level_0/f_capability/tests/unit/c/test-capability-copy.c @@ -11,18 +11,6 @@ void test__f_capability_copy__fails(void **state) { const f_capability_t capability_1 = f_capability_t_initialize; f_capability_t capability_2 = f_capability_t_initialize; - int errnos[] = { - EINVAL, - ENOMEM, - mock_errno_generic, - }; - - f_status_t statuss[] = { - F_parameter, - F_memory_not, - F_failure, - }; - for (int i = 0; i < 3; ++i) { will_return(__wrap_cap_dup, true); diff --git a/level_0/f_capability/tests/unit/c/test-capability-owner_set.c b/level_0/f_capability/tests/unit/c/test-capability-owner_set.c index 7e57945..75f85a9 100644 --- a/level_0/f_capability/tests/unit/c/test-capability-owner_set.c +++ b/level_0/f_capability/tests/unit/c/test-capability-owner_set.c @@ -50,7 +50,7 @@ void test__f_capability_owner_set__fails(void **state) { void test__f_capability_owner_set__works(void **state) { const f_capability_t capability = f_capability_t_initialize; - const uid_t id; + const uid_t id = 0; #if defined(_di_libcap_) || defined(_libcap_legacy_only_) printf("[ WARN ] f_capability_owner_set() is not implemented and cannot be fully tested.\n"); diff --git a/level_0/f_capability/tests/unit/c/test-capability-to_name.c b/level_0/f_capability/tests/unit/c/test-capability-to_name.c index 96ab543..556cd99 100644 --- a/level_0/f_capability/tests/unit/c/test-capability-to_name.c +++ b/level_0/f_capability/tests/unit/c/test-capability-to_name.c @@ -69,6 +69,7 @@ void test__f_capability_to_name__works(void **state) { #if defined(_di_libcap_) assert_int_equal(F_status_set_fine(status), F_implemented_not); #else + assert_int_equal(status, F_none); assert_string_equal(name.string, string); assert_int_equal(name.used, 9); #endif // defined(_di_libcap_) diff --git a/level_0/f_capability/tests/unit/c/test-capability-to_text.c b/level_0/f_capability/tests/unit/c/test-capability-to_text.c index 4308e3a..49e376a 100644 --- a/level_0/f_capability/tests/unit/c/test-capability-to_text.c +++ b/level_0/f_capability/tests/unit/c/test-capability-to_text.c @@ -70,6 +70,7 @@ void test__f_capability_to_text__works(void **state) { #if defined(_di_libcap_) assert_int_equal(F_status_set_fine(status), F_implemented_not); #else + assert_int_equal(status, F_none); assert_string_equal(text.string, string); assert_int_equal(text.used, 9); #endif // defined(_di_libcap_) diff --git a/level_0/f_color/data/build/settings-tests b/level_0/f_color/data/build/settings-tests index 16dff84..650a780 100644 --- a/level_0/f_color/data/build/settings-tests +++ b/level_0/f_color/data/build/settings-tests @@ -47,6 +47,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_color/tests/unit/c/test-color-save_1.c b/level_0/f_color/tests/unit/c/test-color-save_1.c index 2cdb00e..d2750e9 100644 --- a/level_0/f_color/tests/unit/c/test-color-save_1.c +++ b/level_0/f_color/tests/unit/c/test-color-save_1.c @@ -8,7 +8,6 @@ extern "C" { #ifndef _di_level_0_parameter_checking_ void test__f_color_save_1_parameter_checking(void **state) { - f_string_static_t buffer = f_string_static_t_initialize; const f_color_format_t format = f_color_format_t_initialize; const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5); diff --git a/level_0/f_color/tests/unit/c/test-color-save_2.c b/level_0/f_color/tests/unit/c/test-color-save_2.c index c61832c..68eb512 100644 --- a/level_0/f_color/tests/unit/c/test-color-save_2.c +++ b/level_0/f_color/tests/unit/c/test-color-save_2.c @@ -8,7 +8,6 @@ extern "C" { #ifndef _di_level_0_parameter_checking_ void test__f_color_save_2_parameter_checking(void **state) { - f_string_static_t buffer = f_string_static_t_initialize; const f_color_format_t format = f_color_format_t_initialize; const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5); diff --git a/level_0/f_color/tests/unit/c/test-color-save_3.c b/level_0/f_color/tests/unit/c/test-color-save_3.c index e3e4c0e..db7b0ab 100644 --- a/level_0/f_color/tests/unit/c/test-color-save_3.c +++ b/level_0/f_color/tests/unit/c/test-color-save_3.c @@ -8,7 +8,6 @@ extern "C" { #ifndef _di_level_0_parameter_checking_ void test__f_color_save_3_parameter_checking(void **state) { - f_string_static_t buffer = f_string_static_t_initialize; const f_color_format_t format = f_color_format_t_initialize; const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5); diff --git a/level_0/f_color/tests/unit/c/test-color-save_4.c b/level_0/f_color/tests/unit/c/test-color-save_4.c index 5656ab8..2db5d12 100644 --- a/level_0/f_color/tests/unit/c/test-color-save_4.c +++ b/level_0/f_color/tests/unit/c/test-color-save_4.c @@ -8,7 +8,6 @@ extern "C" { #ifndef _di_level_0_parameter_checking_ void test__f_color_save_4_parameter_checking(void **state) { - f_string_static_t buffer = f_string_static_t_initialize; const f_color_format_t format = f_color_format_t_initialize; const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5); diff --git a/level_0/f_color/tests/unit/c/test-color-save_5.c b/level_0/f_color/tests/unit/c/test-color-save_5.c index e5d57ce..3e983da 100644 --- a/level_0/f_color/tests/unit/c/test-color-save_5.c +++ b/level_0/f_color/tests/unit/c/test-color-save_5.c @@ -8,7 +8,6 @@ extern "C" { #ifndef _di_level_0_parameter_checking_ void test__f_color_save_5_parameter_checking(void **state) { - f_string_static_t buffer = f_string_static_t_initialize; const f_color_format_t format = f_color_format_t_initialize; const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5); diff --git a/level_0/f_console/data/build/settings-tests b/level_0/f_console/data/build/settings-tests index 80f5ef4..99de552 100644 --- a/level_0/f_console/data/build/settings-tests +++ b/level_0/f_console/data/build/settings-tests @@ -47,6 +47,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_control_group/data/build/settings-tests b/level_0/f_control_group/data/build/settings-tests index 834be39..cc75343 100644 --- a/level_0/f_control_group/data/build/settings-tests +++ b/level_0/f_control_group/data/build/settings-tests @@ -47,6 +47,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_conversion/data/build/settings-tests b/level_0/f_conversion/data/build/settings-tests index 34df4cb..bec86ee 100644 --- a/level_0/f_conversion/data/build/settings-tests +++ b/level_0/f_conversion/data/build/settings-tests @@ -47,6 +47,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_conversion/tests/unit/c/test-conversion-character_to_binary.c b/level_0/f_conversion/tests/unit/c/test-conversion-character_to_binary.c index b3a4a86..de97bed 100644 --- a/level_0/f_conversion/tests/unit/c/test-conversion-character_to_binary.c +++ b/level_0/f_conversion/tests/unit/c/test-conversion-character_to_binary.c @@ -47,7 +47,7 @@ void test__f_conversion_character_to_binary__works(void **state) { number = 255; - const f_status_t status = f_conversion_character_to_binary(i, &number); + f_conversion_character_to_binary(i, &number); switch (i) { case '0': diff --git a/level_0/f_conversion/tests/unit/c/test-conversion-character_to_decimal.c b/level_0/f_conversion/tests/unit/c/test-conversion-character_to_decimal.c index 606dd17..74b679a 100644 --- a/level_0/f_conversion/tests/unit/c/test-conversion-character_to_decimal.c +++ b/level_0/f_conversion/tests/unit/c/test-conversion-character_to_decimal.c @@ -55,7 +55,7 @@ void test__f_conversion_character_to_decimal__works(void **state) { number = 255; - const f_status_t status = f_conversion_character_to_decimal(i, &number); + f_conversion_character_to_decimal(i, &number); switch (i) { case '0': diff --git a/level_0/f_conversion/tests/unit/c/test-conversion-character_to_duodecimal.c b/level_0/f_conversion/tests/unit/c/test-conversion-character_to_duodecimal.c index 07ad746..47d3727 100644 --- a/level_0/f_conversion/tests/unit/c/test-conversion-character_to_duodecimal.c +++ b/level_0/f_conversion/tests/unit/c/test-conversion-character_to_duodecimal.c @@ -59,7 +59,7 @@ void test__f_conversion_character_to_duodecimal__works(void **state) { number = 255; - const f_status_t status = f_conversion_character_to_duodecimal(i, &number); + f_conversion_character_to_duodecimal(i, &number); switch (i) { case '0': diff --git a/level_0/f_conversion/tests/unit/c/test-conversion-character_to_hexidecimal.c b/level_0/f_conversion/tests/unit/c/test-conversion-character_to_hexidecimal.c index 700c8f6..ff3d4e3 100644 --- a/level_0/f_conversion/tests/unit/c/test-conversion-character_to_hexidecimal.c +++ b/level_0/f_conversion/tests/unit/c/test-conversion-character_to_hexidecimal.c @@ -67,7 +67,7 @@ void test__f_conversion_character_to_hexidecimal__works(void **state) { number = 255; - const f_status_t status = f_conversion_character_to_hexidecimal(i, &number); + f_conversion_character_to_hexidecimal(i, &number); switch (i) { case '0': diff --git a/level_0/f_conversion/tests/unit/c/test-conversion-character_to_octal.c b/level_0/f_conversion/tests/unit/c/test-conversion-character_to_octal.c index 5c454bf..490ccd3 100644 --- a/level_0/f_conversion/tests/unit/c/test-conversion-character_to_octal.c +++ b/level_0/f_conversion/tests/unit/c/test-conversion-character_to_octal.c @@ -53,7 +53,7 @@ void test__f_conversion_character_to_octal__works(void **state) { number = 255; - const f_status_t status = f_conversion_character_to_octal(i, &number); + f_conversion_character_to_octal(i, &number); switch (i) { case '0': diff --git a/level_0/f_directory/data/build/settings-tests b/level_0/f_directory/data/build/settings-tests index dd21d11..0244e5a 100644 --- a/level_0/f_directory/data/build/settings-tests +++ b/level_0/f_directory/data/build/settings-tests @@ -47,6 +47,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_environment/data/build/settings-tests b/level_0/f_environment/data/build/settings-tests index 3428a36..2678679 100644 --- a/level_0/f_environment/data/build/settings-tests +++ b/level_0/f_environment/data/build/settings-tests @@ -49,6 +49,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_execute/data/build/settings-tests b/level_0/f_execute/data/build/settings-tests index dc8c67d..9ca24d1 100644 --- a/level_0/f_execute/data/build/settings-tests +++ b/level_0/f_execute/data/build/settings-tests @@ -49,6 +49,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_file/data/build/settings-tests b/level_0/f_file/data/build/settings-tests index 9108db4..6865f9b 100644 --- a/level_0/f_file/data/build/settings-tests +++ b/level_0/f_file/data/build/settings-tests @@ -48,6 +48,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_file/tests/unit/c/test-file-clone.c b/level_0/f_file/tests/unit/c/test-file-clone.c index 1bc42db..1d18851 100644 --- a/level_0/f_file/tests/unit/c/test-file-clone.c +++ b/level_0/f_file/tests/unit/c/test-file-clone.c @@ -349,15 +349,6 @@ void test__f_file_clone__fails_for_other(void **state) { F_file_type_socket_d, }; - f_status_t statuss[] = { - F_supported_not, - F_supported_not, - F_supported_not, - F_supported_not, - F_supported_not, - F_supported_not, - }; - struct stat statistics; memset(&statistics, 0, sizeof(struct stat)); diff --git a/level_0/f_file/tests/unit/c/test-file-link_read.c b/level_0/f_file/tests/unit/c/test-file-link_read.c index 2f4398f..0ab0378 100644 --- a/level_0/f_file/tests/unit/c/test-file-link_read.c +++ b/level_0/f_file/tests/unit/c/test-file-link_read.c @@ -83,7 +83,6 @@ void test__f_file_link_read__fails(void **state) { void test__f_file_link_read__returns_data_not(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); struct stat statistics; diff --git a/level_0/f_file/tests/unit/c/test-file-link_read_at.c b/level_0/f_file/tests/unit/c/test-file-link_read_at.c index 7e0a064..23f2f3b 100644 --- a/level_0/f_file/tests/unit/c/test-file-link_read_at.c +++ b/level_0/f_file/tests/unit/c/test-file-link_read_at.c @@ -79,8 +79,6 @@ void test__f_file_link_read_at__fails(void **state) { void test__f_file_link_read_at__returns_data_not(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); - f_string_dynamic_t buffer = f_string_dynamic_t_initialize; { diff --git a/level_0/f_file/tests/unit/c/test-file-size_by_id.c b/level_0/f_file/tests/unit/c/test-file-size_by_id.c index 16bfd1b..619e993 100644 --- a/level_0/f_file/tests/unit/c/test-file-size_by_id.c +++ b/level_0/f_file/tests/unit/c/test-file-size_by_id.c @@ -7,8 +7,6 @@ extern "C" { void test__f_file_size_by_id__fails(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); - int errnos[] = { EACCES, EBADF, @@ -74,8 +72,6 @@ void test__f_file_size_by_id__returns_file_closed(void **state) { void test__f_file_size_by_id__works(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); - struct stat statistics; memset(&statistics, 0, sizeof(struct stat)); diff --git a/level_0/f_file/tests/unit/c/test-file-stat_by_id.c b/level_0/f_file/tests/unit/c/test-file-stat_by_id.c index 723b2f9..ca8c5a0 100644 --- a/level_0/f_file/tests/unit/c/test-file-stat_by_id.c +++ b/level_0/f_file/tests/unit/c/test-file-stat_by_id.c @@ -7,8 +7,6 @@ extern "C" { void test__f_file_stat_by_id__fails(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); - int errnos[] = { EACCES, EBADF, @@ -78,8 +76,6 @@ void test__f_file_stat_by_id__returns_file_closed(void **state) { void test__f_file_stat_by_id__works(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); - struct stat statistics; memset(&statistics, 0, sizeof(struct stat)); diff --git a/level_0/f_file/tests/unit/c/test-file-stream_close.c b/level_0/f_file/tests/unit/c/test-file-stream_close.c index e455823..aaf8aab 100644 --- a/level_0/f_file/tests/unit/c/test-file-stream_close.c +++ b/level_0/f_file/tests/unit/c/test-file-stream_close.c @@ -25,15 +25,6 @@ void test__f_file_stream_close__fails_for_file_descriptor(void **state) { mock_errno_generic, }; - f_status_t status_flushs[] = { - F_file_descriptor, - F_filesystem_quota_block, - F_supported_not, - F_input_output, - F_space_not, - F_supported_not, - }; - f_status_t status_closes[] = { F_file_descriptor, F_filesystem_quota_block, @@ -103,28 +94,6 @@ void test__f_file_stream_close__fails_for_stream(void **state) { mock_errno_generic, }; - f_status_t status_flushs[] = { - F_access_denied, - F_block, - F_file_descriptor, - F_file_overflow, - F_deadlock, - F_socket_not, - F_space_not, - F_buffer, - F_interrupt, - F_parameter, - F_input_output, - F_file_descriptor_max, - F_lock, - F_space_not, - F_file_type_not_directory, - F_prohibited, - F_pipe_not, - F_block, - F_file_synchronize, - }; - f_status_t status_closes[] = { F_access_denied, F_block, diff --git a/level_0/f_file/tests/unit/c/test-file-stream_read.c b/level_0/f_file/tests/unit/c/test-file-stream_read.c index 5016d8b..2a8b581 100644 --- a/level_0/f_file/tests/unit/c/test-file-stream_read.c +++ b/level_0/f_file/tests/unit/c/test-file-stream_read.c @@ -7,8 +7,6 @@ extern "C" { void test__f_file_stream_read__fails(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); - int errnos[] = { EAGAIN, EBADF, @@ -106,8 +104,6 @@ void test__f_file_stream_read__returns_file_closed(void **state) { void test__f_file_stream_read__works(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); - f_string_dynamic_t buffer = f_string_dynamic_t_initialize; { diff --git a/level_0/f_file/tests/unit/c/test-file-stream_read_block.c b/level_0/f_file/tests/unit/c/test-file-stream_read_block.c index c5da1c0..0410682 100644 --- a/level_0/f_file/tests/unit/c/test-file-stream_read_block.c +++ b/level_0/f_file/tests/unit/c/test-file-stream_read_block.c @@ -7,8 +7,6 @@ extern "C" { void test__f_file_stream_read_block__fails(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); - int errnos[] = { EAGAIN, EBADF, @@ -105,8 +103,6 @@ void test__f_file_stream_read_block__returns_file_closed(void **state) { void test__f_file_stream_read_block__works(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); - f_string_dynamic_t buffer = f_string_dynamic_t_initialize; { diff --git a/level_0/f_file/tests/unit/c/test-file-stream_read_until.c b/level_0/f_file/tests/unit/c/test-file-stream_read_until.c index 9a3384f..dbdbfd7 100644 --- a/level_0/f_file/tests/unit/c/test-file-stream_read_until.c +++ b/level_0/f_file/tests/unit/c/test-file-stream_read_until.c @@ -7,8 +7,6 @@ extern "C" { void test__f_file_stream_read_until__fails(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); - int errnos[] = { EAGAIN, EBADF, @@ -108,8 +106,6 @@ void test__f_file_stream_read_until__returns_file_closed(void **state) { void test__f_file_stream_read_until__works(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); - f_string_dynamic_t buffer = f_string_dynamic_t_initialize; { diff --git a/level_0/f_file/tests/unit/c/test-file-stream_reopen.c b/level_0/f_file/tests/unit/c/test-file-stream_reopen.c index 352da55..e176a48 100644 --- a/level_0/f_file/tests/unit/c/test-file-stream_reopen.c +++ b/level_0/f_file/tests/unit/c/test-file-stream_reopen.c @@ -91,8 +91,6 @@ void test__f_file_stream_reopen__fails(void **state) { void test__f_file_stream_reopen__returns_data_not(void **state) { - const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4); - { f_file_t file = f_file_t_initialize; diff --git a/level_0/f_file/tests/unit/c/test-file-type.c b/level_0/f_file/tests/unit/c/test-file-type.c index cb57a60..55e01c3 100644 --- a/level_0/f_file/tests/unit/c/test-file-type.c +++ b/level_0/f_file/tests/unit/c/test-file-type.c @@ -37,12 +37,12 @@ void test__f_file_type__fails(void **state) { for (int i = 0; i < 10; ++i) { - mode_t mode = 0; + int type = 0; will_return(__wrap_lstat, true); will_return(__wrap_lstat, errnos[i]); - const f_status_t status = f_file_type(path, F_false, &mode); + const f_status_t status = f_file_type(path, F_false, &type); assert_int_equal(F_status_set_fine(status), statuss[i]); } // for diff --git a/level_0/f_file/tests/unit/c/test-file-type_at.c b/level_0/f_file/tests/unit/c/test-file-type_at.c index d4eab00..8ea5a8a 100644 --- a/level_0/f_file/tests/unit/c/test-file-type_at.c +++ b/level_0/f_file/tests/unit/c/test-file-type_at.c @@ -37,7 +37,7 @@ void test__f_file_type_at__fails(void **state) { for (int i = 0; i < 10; ++i) { - mode_t mode = 0; + int mode = 0; will_return(__wrap_fstatat, true); will_return(__wrap_fstatat, errnos[i]); diff --git a/level_0/f_iki/data/build/settings-tests b/level_0/f_iki/data/build/settings-tests index 43db873..91d0295 100644 --- a/level_0/f_iki/data/build/settings-tests +++ b/level_0/f_iki/data/build/settings-tests @@ -49,6 +49,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_iki/tests/unit/c/test-iki-content_is.c b/level_0/f_iki/tests/unit/c/test-iki-content_is.c index ac93049..bf77651 100644 --- a/level_0/f_iki/tests/unit/c/test-iki-content_is.c +++ b/level_0/f_iki/tests/unit/c/test-iki-content_is.c @@ -7,8 +7,6 @@ extern "C" { void test__f_iki_content_is__returns_false(void **state) { - f_string_static_t content = f_string_static_t_initialize; - const f_string_static_t contents[] = { macro_f_string_static_t_initialize("'false", 0, 6), macro_f_string_static_t_initialize("false'", 0, 6), @@ -65,8 +63,6 @@ void test__f_iki_content_is__returns_data_not(void **state) { void test__f_iki_content_is__returns_true(void **state) { - f_string_static_t content = f_string_static_t_initialize; - const f_string_static_t contents[] = { macro_f_string_static_t_initialize("works", 0, 5), macro_f_string_static_t_initialize("also works", 0, 10), diff --git a/level_0/f_iki/tests/unit/c/test-iki-content_partial_is.c b/level_0/f_iki/tests/unit/c/test-iki-content_partial_is.c index 5e135bd..9f3da1c 100644 --- a/level_0/f_iki/tests/unit/c/test-iki-content_partial_is.c +++ b/level_0/f_iki/tests/unit/c/test-iki-content_partial_is.c @@ -7,8 +7,6 @@ extern "C" { void test__f_iki_content_partial_is__returns_false(void **state) { - f_string_static_t content = f_string_static_t_initialize; - const f_string_static_t contents[] = { macro_f_string_static_t_initialize("xxxx' falsexxxx", 0, 15), macro_f_string_static_t_initialize("xxxx'falsexxxx", 0, 14), @@ -107,8 +105,6 @@ void test__f_iki_content_partial_is__returns_data_not_stop(void **state) { void test__f_iki_content_partial_is__returns_true(void **state) { - f_string_static_t content = f_string_static_t_initialize; - const f_string_static_t contents[] = { macro_f_string_static_t_initialize("xxxxworksxxxx", 0, 13), macro_f_string_static_t_initialize("xxxxalso worksxxxx", 0, 18), diff --git a/level_0/f_iki/tests/unit/c/test-iki-object_is.c b/level_0/f_iki/tests/unit/c/test-iki-object_is.c index 0abc946..d55d8d6 100644 --- a/level_0/f_iki/tests/unit/c/test-iki-object_is.c +++ b/level_0/f_iki/tests/unit/c/test-iki-object_is.c @@ -7,8 +7,6 @@ extern "C" { void test__f_iki_object_is__returns_false(void **state) { - f_string_static_t object = f_string_static_t_initialize; - const f_string_static_t objects[] = { macro_f_string_static_t_initialize("fa lse", 0, 6), macro_f_string_static_t_initialize("filse@", 0, 6), @@ -45,8 +43,6 @@ void test__f_iki_object_is__returns_data_not(void **state) { void test__f_iki_object_is__returns_true(void **state) { - f_string_static_t object = f_string_static_t_initialize; - const f_string_static_t objects[] = { macro_f_string_static_t_initialize("works", 0, 5), macro_f_string_static_t_initialize("wor_ks", 0, 6), diff --git a/level_0/f_iki/tests/unit/c/test-iki-object_partial_is.c b/level_0/f_iki/tests/unit/c/test-iki-object_partial_is.c index 63a39c6..a06d266 100644 --- a/level_0/f_iki/tests/unit/c/test-iki-object_partial_is.c +++ b/level_0/f_iki/tests/unit/c/test-iki-object_partial_is.c @@ -7,8 +7,6 @@ extern "C" { void test__f_iki_object_partial_is__returns_false(void **state) { - f_string_static_t object = f_string_static_t_initialize; - const f_string_static_t objects[] = { macro_f_string_static_t_initialize("xxxxfa lsexxxx", 0, 14), macro_f_string_static_t_initialize("xxxxfalse@xxxx", 0, 14), @@ -86,8 +84,6 @@ void test__f_iki_object_partial_is__returns_data_not_stop(void **state) { void test__f_iki_object_partial_is__returns_true(void **state) { - f_string_static_t object = f_string_static_t_initialize; - const f_string_static_t objects[] = { macro_f_string_static_t_initialize("xxxxworksxxxx", 0, 13), macro_f_string_static_t_initialize("xxxxwor_ksxxxx", 0, 14), diff --git a/level_0/f_memory/data/build/settings-tests b/level_0/f_memory/data/build/settings-tests index 68024e9..d5a2f04 100644 --- a/level_0/f_memory/data/build/settings-tests +++ b/level_0/f_memory/data/build/settings-tests @@ -45,6 +45,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_string/data/build/settings-tests b/level_0/f_string/data/build/settings-tests index c9d200c..134eea5 100644 --- a/level_0/f_string/data/build/settings-tests +++ b/level_0/f_string/data/build/settings-tests @@ -70,6 +70,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_string/tests/unit/c/test-string-dynamicss_append_all.c b/level_0/f_string/tests/unit/c/test-string-dynamicss_append_all.c index 6b55e46..31cee0e 100644 --- a/level_0/f_string/tests/unit/c/test-string-dynamicss_append_all.c +++ b/level_0/f_string/tests/unit/c/test-string-dynamicss_append_all.c @@ -7,7 +7,6 @@ extern "C" { void test__f_string_dynamicss_append_all__works(void **state) { - const int length = 5; const int length_inner = 2; const int length_outer = 2; f_string_dynamicss_t source = f_string_dynamicss_t_initialize; @@ -26,7 +25,6 @@ void test__f_string_dynamicss_append_all__works(void **state) { assert_int_equal(source.size, length_outer); f_array_length_t i = 0; - f_array_length_t j = 0; for (; source.used < length_outer; ++source.used) { diff --git a/level_0/f_string/tests/unit/c/test-string-map_multiss_append.c b/level_0/f_string/tests/unit/c/test-string-map_multiss_append.c index 8fb8580..e15e43d 100644 --- a/level_0/f_string/tests/unit/c/test-string-map_multiss_append.c +++ b/level_0/f_string/tests/unit/c/test-string-map_multiss_append.c @@ -8,7 +8,6 @@ extern "C" { void test__f_string_map_multiss_append__works(void **state) { const int length_values = 2; - const int length_values_set = 2; const int length_inner = 2; f_string_map_multis_t source = f_string_map_multis_t_initialize; f_string_map_multiss_t destination = f_string_map_multiss_t_initialize; diff --git a/level_0/f_string/tests/unit/c/test-string-map_multiss_append_all.c b/level_0/f_string/tests/unit/c/test-string-map_multiss_append_all.c index cdec36b..38cfa3d 100644 --- a/level_0/f_string/tests/unit/c/test-string-map_multiss_append_all.c +++ b/level_0/f_string/tests/unit/c/test-string-map_multiss_append_all.c @@ -8,7 +8,6 @@ extern "C" { void test__f_string_map_multiss_append_all__works(void **state) { const int length_values = 2; - const int length_values_set = 2; const int length_inner = 2; const int length_outer = 2; f_string_map_multiss_t source = f_string_map_multiss_t_initialize; @@ -42,7 +41,6 @@ void test__f_string_map_multiss_append_all__works(void **state) { assert_int_equal(source.size, length_outer); f_array_length_t i = 0; - f_array_length_t j = 0; for (; source.used < length_outer; ++source.used) { diff --git a/level_0/f_string/tests/unit/c/test-string-maps_append_all.c b/level_0/f_string/tests/unit/c/test-string-maps_append_all.c index d985f05..6ed8a3b 100644 --- a/level_0/f_string/tests/unit/c/test-string-maps_append_all.c +++ b/level_0/f_string/tests/unit/c/test-string-maps_append_all.c @@ -7,7 +7,6 @@ extern "C" { void test__f_string_maps_append_all__works(void **state) { - const int length = 5; const int length_inner = 2; f_string_maps_t source = f_string_maps_t_initialize; f_string_maps_t destination = f_string_maps_t_initialize; diff --git a/level_0/f_string/tests/unit/c/test-string-mapss_append_all.c b/level_0/f_string/tests/unit/c/test-string-mapss_append_all.c index d1639cc..41b2f24 100644 --- a/level_0/f_string/tests/unit/c/test-string-mapss_append_all.c +++ b/level_0/f_string/tests/unit/c/test-string-mapss_append_all.c @@ -7,7 +7,6 @@ extern "C" { void test__f_string_mapss_append_all__works(void **state) { - const int length = 5; const int length_inner = 2; const int length_outer = 2; f_string_mapss_t source = f_string_mapss_t_initialize; @@ -31,7 +30,6 @@ void test__f_string_mapss_append_all__works(void **state) { assert_int_equal(source.size, length_outer); f_array_length_t i = 0; - f_array_length_t j = 0; for (; source.used < length_outer; ++source.used) { diff --git a/level_0/f_string/tests/unit/c/test-string-quantitys_append_all.c b/level_0/f_string/tests/unit/c/test-string-quantitys_append_all.c index 5d761c5..29c67a4 100644 --- a/level_0/f_string/tests/unit/c/test-string-quantitys_append_all.c +++ b/level_0/f_string/tests/unit/c/test-string-quantitys_append_all.c @@ -7,7 +7,6 @@ extern "C" { void test__f_string_quantitys_append_all__works(void **state) { - const int length = 5; const int length_sources = 2; f_string_quantity_t sources_array[] = { diff --git a/level_0/f_string/tests/unit/c/test-string-ranges_append.c b/level_0/f_string/tests/unit/c/test-string-ranges_append.c index b126fb0..b1d7023 100644 --- a/level_0/f_string/tests/unit/c/test-string-ranges_append.c +++ b/level_0/f_string/tests/unit/c/test-string-ranges_append.c @@ -7,7 +7,6 @@ extern "C" { void test__f_string_ranges_append__works(void **state) { - const f_array_length_t length = 5; const f_string_range_t source = macro_f_string_range_t_initialize(1, 2); f_string_ranges_t destination = f_string_ranges_t_initialize; diff --git a/level_0/f_type_array/data/build/settings-tests b/level_0/f_type_array/data/build/settings-tests index 2ef63b2..dcad9c5 100644 --- a/level_0/f_type_array/data/build/settings-tests +++ b/level_0/f_type_array/data/build/settings-tests @@ -75,6 +75,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-array_lengthss_append.c b/level_0/f_type_array/tests/unit/c/test-type_array-array_lengthss_append.c index 53d7abd..5235bc1 100644 --- a/level_0/f_type_array/tests/unit/c/test-type_array-array_lengthss_append.c +++ b/level_0/f_type_array/tests/unit/c/test-type_array-array_lengthss_append.c @@ -8,7 +8,6 @@ extern "C" { void test__f_type_array_array_lengthss_append__works(void **state) { const int length = 5; - const int length_inner = 2; f_array_lengths_t source = f_array_lengths_t_initialize; f_array_lengthss_t destination = f_array_lengthss_t_initialize; diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-fll_ids_append.c b/level_0/f_type_array/tests/unit/c/test-type_array-fll_ids_append.c index e208d80..8804203 100644 --- a/level_0/f_type_array/tests/unit/c/test-type_array-fll_ids_append.c +++ b/level_0/f_type_array/tests/unit/c/test-type_array-fll_ids_append.c @@ -7,7 +7,6 @@ extern "C" { void test__f_type_array_fll_ids_append__works(void **state) { - const int length = 5; const f_fll_id_t source = { .name = "test", .type = 1, .used = 4 }; f_fll_ids_t destination = f_fll_ids_t_initialize; diff --git a/level_0/f_utf/data/build/settings-tests b/level_0/f_utf/data/build/settings-tests index 0911466..19dbd75 100644 --- a/level_0/f_utf/data/build/settings-tests +++ b/level_0/f_utf/data/build/settings-tests @@ -68,6 +68,6 @@ defines_shared -Lbuild/libraries/shared flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses flags-clang -Wno-logical-op-parentheses -flags-test -fstack-protector +flags-test -fstack-protector -Wall flags_program -fPIE diff --git a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append_all.c index 66b2b6a..cdfc1af 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-dynamicss_append_all.c @@ -7,7 +7,6 @@ extern "C" { void test__f_utf_dynamicss_append_all__works(void **state) { - const int length = 5; const int length_inner = 2; const int length_outer = 2; f_utf_string_dynamicss_t source = f_utf_string_dynamicss_t_initialize; @@ -26,7 +25,6 @@ void test__f_utf_dynamicss_append_all__works(void **state) { assert_int_equal(source.size, length_outer); f_array_length_t i = 0; - f_array_length_t j = 0; for (; source.used < length_outer; ++source.used) { 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 1c5fdd7..08cb2ec 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 @@ -8,7 +8,6 @@ extern "C" { void test__f_utf_map_multiss_append__works(void **state) { const int length_values = 2; - const int length_values_set = 2; const int length_inner = 2; f_utf_string_map_multis_t source = f_utf_string_map_multis_t_initialize; f_utf_string_map_multiss_t destination = f_utf_string_map_multiss_t_initialize; 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 8e596b6..a729aec 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 @@ -8,7 +8,6 @@ extern "C" { void test__f_utf_map_multiss_append_all__works(void **state) { const int length_values = 2; - const int length_values_set = 2; const int length_inner = 2; const int length_outer = 2; f_utf_string_map_multiss_t source = f_utf_string_map_multiss_t_initialize; @@ -42,7 +41,6 @@ void test__f_utf_map_multiss_append_all__works(void **state) { assert_int_equal(source.size, length_outer); f_array_length_t i = 0; - f_array_length_t j = 0; for (; source.used < length_outer; ++source.used) { 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 c168c59..12ccf8a 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 @@ -7,7 +7,6 @@ extern "C" { void test__f_utf_maps_append_all__works(void **state) { - const int length = 5; const int length_inner = 2; f_utf_string_maps_t source = f_utf_string_maps_t_initialize; f_utf_string_maps_t destination = f_utf_string_maps_t_initialize; 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 0205c2d..f7f1e11 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 @@ -7,7 +7,6 @@ extern "C" { void test__f_utf_mapss_append_all__works(void **state) { - const int length = 5; const int length_inner = 2; const int length_outer = 2; f_utf_string_mapss_t source = f_utf_string_mapss_t_initialize; @@ -31,7 +30,6 @@ void test__f_utf_mapss_append_all__works(void **state) { assert_int_equal(source.size, length_outer); f_array_length_t i = 0; - f_array_length_t j = 0; for (; source.used < length_outer; ++source.used) { -- 1.8.3.1