From 08741c2ca563876f0b6cb023d5646e4c98440fd8 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 25 Apr 2023 21:25:53 -0500 Subject: [PATCH] Update: Get remaining unit tests working. --- .../f_fss/tests/unit/c/test-fss-apply_delimit.c | 12 +- .../tests/unit/c/test-fss-apply_delimit_range.c | 20 +- level_0/f_fss/tests/unit/c/test-fss-count_lines.c | 12 +- .../tests/unit/c/test-fss-count_lines_range.c | 20 +- level_0/f_fss/tests/unit/c/test-fss-fail_utf.c | 26 ++- .../tests/unit/c/test-fss-fail_utf_to_false.c | 26 ++- level_0/f_fss/tests/unit/c/test-fss-is_combining.c | 8 +- level_0/f_fss/tests/unit/c/test-fss-is_graph.c | 8 +- level_0/f_fss/tests/unit/c/test-fss-is_space.c | 8 +- .../f_fss/tests/unit/c/test-fss-is_zero_width.c | 8 +- level_0/f_fss/tests/unit/c/test-fss-seek_to_eol.c | 23 +- .../tests/unit/c/test-fss-skip_past_delimit.c | 24 +- .../f_fss/tests/unit/c/test-fss-skip_past_space.c | 24 +- level_0/f_iki/tests/unit/c/test-iki-read.c | 42 ++-- level_0/f_pipe/data/build/settings-tests | 2 +- .../f_pipe/tests/unit/c/test-pipe-debug_exists.h | 34 --- ...pe-debug_exists.c => test-pipe-output_exists.c} | 14 +- .../f_pipe/tests/unit/c/test-pipe-output_exists.h | 34 +++ .../f_pipe/tests/unit/c/test-pipe-warning_exists.c | 75 ------- .../f_pipe/tests/unit/c/test-pipe-warning_exists.h | 34 --- level_0/f_pipe/tests/unit/c/test-pipe.c | 13 +- level_0/f_pipe/tests/unit/c/test-pipe.h | 3 +- level_0/f_print/tests/unit/c/test-print-.c | 32 +-- level_0/f_print/tests/unit/c/test-print-.h | 8 +- .../f_print/tests/unit/c/test-print-character.c | 13 +- .../f_print/tests/unit/c/test-print-character.h | 4 +- .../tests/unit/c/test-print-character_safely.c | 28 ++- .../tests/unit/c/test-print-character_safely.h | 4 +- level_0/f_print/tests/unit/c/test-print-dynamic.c | 23 +- level_0/f_print/tests/unit/c/test-print-dynamic.h | 8 +- .../tests/unit/c/test-print-dynamic_partial.c | 22 +- .../tests/unit/c/test-print-dynamic_partial.h | 8 +- .../tests/unit/c/test-print-dynamic_partial_raw.c | 22 +- .../tests/unit/c/test-print-dynamic_partial_raw.h | 8 +- .../unit/c/test-print-dynamic_partial_raw_safely.c | 22 +- .../unit/c/test-print-dynamic_partial_raw_safely.h | 8 +- .../unit/c/test-print-dynamic_partial_safely.c | 22 +- .../unit/c/test-print-dynamic_partial_safely.h | 8 +- .../f_print/tests/unit/c/test-print-dynamic_raw.c | 23 +- .../f_print/tests/unit/c/test-print-dynamic_raw.h | 8 +- .../tests/unit/c/test-print-dynamic_raw_safely.c | 23 +- .../tests/unit/c/test-print-dynamic_raw_safely.h | 8 +- .../tests/unit/c/test-print-dynamic_safely.c | 23 +- .../tests/unit/c/test-print-dynamic_safely.h | 8 +- level_0/f_print/tests/unit/c/test-print-except.c | 38 ++-- level_0/f_print/tests/unit/c/test-print-except.h | 8 +- .../tests/unit/c/test-print-except_dynamic.c | 24 +- .../tests/unit/c/test-print-except_dynamic.h | 8 +- .../unit/c/test-print-except_dynamic_partial.c | 24 +- .../unit/c/test-print-except_dynamic_partial.h | 8 +- .../unit/c/test-print-except_dynamic_partial_raw.c | 24 +- .../unit/c/test-print-except_dynamic_partial_raw.h | 8 +- .../test-print-except_dynamic_partial_raw_safely.c | 24 +- .../test-print-except_dynamic_partial_raw_safely.h | 8 +- .../c/test-print-except_dynamic_partial_safely.c | 24 +- .../c/test-print-except_dynamic_partial_safely.h | 8 +- .../tests/unit/c/test-print-except_dynamic_raw.c | 24 +- .../tests/unit/c/test-print-except_dynamic_raw.h | 8 +- .../unit/c/test-print-except_dynamic_raw_safely.c | 24 +- .../unit/c/test-print-except_dynamic_raw_safely.h | 8 +- .../unit/c/test-print-except_dynamic_safely.c | 24 +- .../unit/c/test-print-except_dynamic_safely.h | 8 +- .../f_print/tests/unit/c/test-print-except_in.c | 40 ++-- .../f_print/tests/unit/c/test-print-except_in.h | 8 +- .../tests/unit/c/test-print-except_in_dynamic.c | 24 +- .../tests/unit/c/test-print-except_in_dynamic.h | 8 +- .../unit/c/test-print-except_in_dynamic_partial.c | 24 +- .../unit/c/test-print-except_in_dynamic_partial.h | 8 +- .../c/test-print-except_in_dynamic_partial_raw.c | 24 +- .../c/test-print-except_in_dynamic_partial_raw.h | 8 +- ...st-print-except_in_dynamic_partial_raw_safely.c | 24 +- ...st-print-except_in_dynamic_partial_raw_safely.h | 8 +- .../test-print-except_in_dynamic_partial_safely.c | 24 +- .../test-print-except_in_dynamic_partial_safely.h | 8 +- .../unit/c/test-print-except_in_dynamic_raw.c | 24 +- .../unit/c/test-print-except_in_dynamic_raw.h | 8 +- .../c/test-print-except_in_dynamic_raw_safely.c | 24 +- .../c/test-print-except_in_dynamic_raw_safely.h | 8 +- .../unit/c/test-print-except_in_dynamic_safely.c | 24 +- .../unit/c/test-print-except_in_dynamic_safely.h | 8 +- .../tests/unit/c/test-print-except_in_raw.c | 40 ++-- .../tests/unit/c/test-print-except_in_raw.h | 8 +- .../tests/unit/c/test-print-except_in_raw_safely.c | 40 ++-- .../tests/unit/c/test-print-except_in_raw_safely.h | 8 +- .../tests/unit/c/test-print-except_in_safely.c | 40 ++-- .../tests/unit/c/test-print-except_in_safely.h | 8 +- .../f_print/tests/unit/c/test-print-except_raw.c | 38 ++-- .../f_print/tests/unit/c/test-print-except_raw.h | 8 +- .../tests/unit/c/test-print-except_raw_safely.c | 38 ++-- .../tests/unit/c/test-print-except_raw_safely.h | 8 +- .../tests/unit/c/test-print-except_safely.c | 38 ++-- .../tests/unit/c/test-print-except_safely.h | 8 +- level_0/f_print/tests/unit/c/test-print-raw.c | 32 +-- level_0/f_print/tests/unit/c/test-print-raw.h | 8 +- .../f_print/tests/unit/c/test-print-raw_safely.c | 32 +-- .../f_print/tests/unit/c/test-print-raw_safely.h | 8 +- .../tests/unit/c/test-print-raw_terminated.c | 23 +- .../tests/unit/c/test-print-raw_terminated.h | 8 +- level_0/f_print/tests/unit/c/test-print-safely.c | 32 +-- level_0/f_print/tests/unit/c/test-print-safely.h | 8 +- .../tests/unit/c/test-print-safely_terminated.c | 23 +- .../tests/unit/c/test-print-safely_terminated.h | 8 +- .../f_print/tests/unit/c/test-print-terminated.c | 23 +- .../f_print/tests/unit/c/test-print-terminated.h | 8 +- level_0/f_print/tests/unit/c/test-print-to.c | 32 +-- level_0/f_print/tests/unit/c/test-print-to.h | 8 +- .../f_print/tests/unit/c/test-print-to_character.c | 13 +- .../f_print/tests/unit/c/test-print-to_character.h | 4 +- .../tests/unit/c/test-print-to_character_safely.c | 28 ++- .../tests/unit/c/test-print-to_character_safely.h | 4 +- .../f_print/tests/unit/c/test-print-to_dynamic.c | 23 +- .../f_print/tests/unit/c/test-print-to_dynamic.h | 8 +- .../tests/unit/c/test-print-to_dynamic_partial.c | 22 +- .../tests/unit/c/test-print-to_dynamic_partial.h | 8 +- .../unit/c/test-print-to_dynamic_partial_raw.c | 22 +- .../unit/c/test-print-to_dynamic_partial_raw.h | 8 +- .../c/test-print-to_dynamic_partial_raw_safely.c | 22 +- .../c/test-print-to_dynamic_partial_raw_safely.h | 8 +- .../unit/c/test-print-to_dynamic_partial_safely.c | 22 +- .../unit/c/test-print-to_dynamic_partial_safely.h | 8 +- .../tests/unit/c/test-print-to_dynamic_raw.c | 23 +- .../tests/unit/c/test-print-to_dynamic_raw.h | 8 +- .../unit/c/test-print-to_dynamic_raw_safely.c | 23 +- .../unit/c/test-print-to_dynamic_raw_safely.h | 8 +- .../tests/unit/c/test-print-to_dynamic_safely.c | 23 +- .../tests/unit/c/test-print-to_dynamic_safely.h | 8 +- .../f_print/tests/unit/c/test-print-to_except.c | 38 ++-- .../f_print/tests/unit/c/test-print-to_except.h | 8 +- .../tests/unit/c/test-print-to_except_dynamic.c | 24 +- .../tests/unit/c/test-print-to_except_dynamic.h | 8 +- .../unit/c/test-print-to_except_dynamic_partial.c | 24 +- .../unit/c/test-print-to_except_dynamic_partial.h | 8 +- .../c/test-print-to_except_dynamic_partial_raw.c | 24 +- .../c/test-print-to_except_dynamic_partial_raw.h | 8 +- ...st-print-to_except_dynamic_partial_raw_safely.c | 24 +- ...st-print-to_except_dynamic_partial_raw_safely.h | 8 +- .../test-print-to_except_dynamic_partial_safely.c | 24 +- .../test-print-to_except_dynamic_partial_safely.h | 8 +- .../unit/c/test-print-to_except_dynamic_raw.c | 24 +- .../unit/c/test-print-to_except_dynamic_raw.h | 8 +- .../c/test-print-to_except_dynamic_raw_safely.c | 24 +- .../c/test-print-to_except_dynamic_raw_safely.h | 8 +- .../unit/c/test-print-to_except_dynamic_safely.c | 24 +- .../unit/c/test-print-to_except_dynamic_safely.h | 8 +- .../f_print/tests/unit/c/test-print-to_except_in.c | 40 ++-- .../f_print/tests/unit/c/test-print-to_except_in.h | 8 +- .../tests/unit/c/test-print-to_except_in_dynamic.c | 24 +- .../tests/unit/c/test-print-to_except_in_dynamic.h | 8 +- .../c/test-print-to_except_in_dynamic_partial.c | 24 +- .../c/test-print-to_except_in_dynamic_partial.h | 8 +- .../test-print-to_except_in_dynamic_partial_raw.c | 24 +- .../test-print-to_except_in_dynamic_partial_raw.h | 8 +- ...print-to_except_in_dynamic_partial_raw_safely.c | 25 ++- ...print-to_except_in_dynamic_partial_raw_safely.h | 8 +- ...est-print-to_except_in_dynamic_partial_safely.c | 24 +- ...est-print-to_except_in_dynamic_partial_safely.h | 8 +- .../unit/c/test-print-to_except_in_dynamic_raw.c | 24 +- .../unit/c/test-print-to_except_in_dynamic_raw.h | 8 +- .../c/test-print-to_except_in_dynamic_raw_safely.c | 24 +- .../c/test-print-to_except_in_dynamic_raw_safely.h | 8 +- .../c/test-print-to_except_in_dynamic_safely.c | 24 +- .../c/test-print-to_except_in_dynamic_safely.h | 8 +- .../tests/unit/c/test-print-to_except_in_raw.c | 40 ++-- .../tests/unit/c/test-print-to_except_in_raw.h | 8 +- .../unit/c/test-print-to_except_in_raw_safely.c | 40 ++-- .../unit/c/test-print-to_except_in_raw_safely.h | 8 +- .../tests/unit/c/test-print-to_except_in_safely.c | 40 ++-- .../tests/unit/c/test-print-to_except_in_safely.h | 8 +- .../tests/unit/c/test-print-to_except_raw.c | 38 ++-- .../tests/unit/c/test-print-to_except_raw.h | 8 +- .../tests/unit/c/test-print-to_except_raw_safely.c | 38 ++-- .../tests/unit/c/test-print-to_except_raw_safely.h | 8 +- .../tests/unit/c/test-print-to_except_safely.c | 38 ++-- .../tests/unit/c/test-print-to_except_safely.h | 8 +- level_0/f_print/tests/unit/c/test-print-to_raw.c | 32 +-- level_0/f_print/tests/unit/c/test-print-to_raw.h | 8 +- .../tests/unit/c/test-print-to_raw_safely.c | 32 +-- .../tests/unit/c/test-print-to_raw_safely.h | 8 +- .../tests/unit/c/test-print-to_raw_terminated.c | 23 +- .../tests/unit/c/test-print-to_raw_terminated.h | 8 +- .../f_print/tests/unit/c/test-print-to_safely.c | 32 +-- .../f_print/tests/unit/c/test-print-to_safely.h | 8 +- .../tests/unit/c/test-print-to_safely_terminated.c | 23 +- .../tests/unit/c/test-print-to_safely_terminated.h | 8 +- .../tests/unit/c/test-print-to_terminated.c | 23 +- .../tests/unit/c/test-print-to_terminated.h | 8 +- level_0/f_print/tests/unit/c/test-print.c | 246 ++++++++++++++------- level_0/f_signal/tests/unit/c/test-signal-wait.c | 6 +- .../f_signal/tests/unit/c/test-signal-wait_until.c | 2 +- .../tests/unit/c/test-status_string-to.c | 50 ++++- .../tests/unit/c/test-thread-semaphore_file_open.c | 20 +- level_1/fl_path/tests/unit/c/test-path-canonical.c | 12 +- level_1/fl_path/tests/unit/c/test-path-canonical.h | 12 +- level_1/fl_status_string/data/build/testfile | 12 +- 194 files changed, 2038 insertions(+), 1661 deletions(-) delete mode 100644 level_0/f_pipe/tests/unit/c/test-pipe-debug_exists.h rename level_0/f_pipe/tests/unit/c/{test-pipe-debug_exists.c => test-pipe-output_exists.c} (73%) create mode 100644 level_0/f_pipe/tests/unit/c/test-pipe-output_exists.h delete mode 100644 level_0/f_pipe/tests/unit/c/test-pipe-warning_exists.c delete mode 100644 level_0/f_pipe/tests/unit/c/test-pipe-warning_exists.h diff --git a/level_0/f_fss/tests/unit/c/test-fss-apply_delimit.c b/level_0/f_fss/tests/unit/c/test-fss-apply_delimit.c index 06d47de..d82d1ce 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-apply_delimit.c +++ b/level_0/f_fss/tests/unit/c/test-fss-apply_delimit.c @@ -11,9 +11,9 @@ void test__f_fss_apply_delimit__parameter_checking(void **state) { f_state_t state_data = f_state_t_initialize; { - const f_status_t status = f_fss_apply_delimit(state_data, delimits, 0); + f_fss_apply_delimit(delimits, 0, &state_data); - assert_int_equal(status, F_status_set_error(F_parameter)); + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); } } @@ -25,9 +25,9 @@ void test__f_fss_apply_delimit__returns_data_not(void **state) { { f_string_static_t empty = f_string_static_t_initialize; - const f_status_t status = f_fss_apply_delimit(state_data, delimits, &empty); + f_fss_apply_delimit(delimits, &empty, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } } @@ -113,9 +113,9 @@ void test__f_fss_apply_delimit__works(void **state) { for (uint8_t i = 0; i < 7; ++i) { - const f_status_t status = f_fss_apply_delimit(state_data, delimitss[i], &tests[i]); + f_fss_apply_delimit(delimitss[i], &tests[i], &state_data); - assert_int_equal(status, F_none); + assert_int_equal(state_data.status, F_none); assert_int_equal(tests[i].used, expects[i].used); for (uint8_t j = 0; j < tests[i].used; ++j) { diff --git a/level_0/f_fss/tests/unit/c/test-fss-apply_delimit_range.c b/level_0/f_fss/tests/unit/c/test-fss-apply_delimit_range.c index f403202..1e3760f 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-apply_delimit_range.c +++ b/level_0/f_fss/tests/unit/c/test-fss-apply_delimit_range.c @@ -12,9 +12,9 @@ void test__f_fss_apply_delimit_range__parameter_checking(void **state) { const f_string_range_t range = f_string_range_t_initialize; { - const f_status_t status = f_fss_apply_delimit_range(state_data, delimits, range, 0); + f_fss_apply_delimit_range(delimits, range, 0, &state_data); - assert_int_equal(status, F_status_set_error(F_parameter)); + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); } } @@ -28,26 +28,26 @@ void test__f_fss_apply_delimit_range__returns_data_not(void **state) { const f_string_range_t range = f_string_range_t_initialize; f_string_static_t empty = f_string_static_t_initialize; - const f_status_t status = f_fss_apply_delimit_range(state_data, delimits, range, &empty); + f_fss_apply_delimit_range(delimits, range, &empty, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } { const f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_apply_delimit_range(state_data, delimits, range, &test); + f_fss_apply_delimit_range(delimits, range, &test, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } { const f_string_range_t range = macro_f_string_range_t_initialize_1(0, test.used - 1); f_string_static_t empty = f_string_static_t_initialize; - const f_status_t status = f_fss_apply_delimit_range(state_data, delimits, range, &empty); + f_fss_apply_delimit_range(delimits, range, &empty, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } } @@ -135,9 +135,9 @@ void test__f_fss_apply_delimit_range__works(void **state) { const f_string_range_t range = macro_f_string_range_t_initialize_1(0, tests[i].used - 1); - const f_status_t status = f_fss_apply_delimit_range(state_data, delimitss[i], range, &tests[i]); + f_fss_apply_delimit_range(delimitss[i], range, &tests[i], &state_data); - assert_int_equal(status, F_none); + assert_int_equal(state_data.status, F_none); assert_int_equal(tests[i].used, expects[i].used); for (uint8_t j = 0; j < tests[i].used; ++j) { diff --git a/level_0/f_fss/tests/unit/c/test-fss-count_lines.c b/level_0/f_fss/tests/unit/c/test-fss-count_lines.c index 135e3df..8d3571c 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-count_lines.c +++ b/level_0/f_fss/tests/unit/c/test-fss-count_lines.c @@ -11,9 +11,9 @@ void test__f_fss_count_lines__parameter_checking(void **state) { f_state_t state_data = f_state_t_initialize; { - const f_status_t status = f_fss_count_lines(state_data, test, 0, 0); + f_fss_count_lines(test, 0, 0, &state_data); - assert_int_equal(status, F_status_set_error(F_parameter)); + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); } } @@ -24,9 +24,9 @@ void test__f_fss_count_lines__returns_data_not(void **state) { { f_array_length_t line = 0; - const f_status_t status = f_fss_count_lines(state_data, f_string_empty_s, 0, &line); + f_fss_count_lines(f_string_empty_s, 0, &line, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } } @@ -47,9 +47,9 @@ void test__f_fss_count_lines__works(void **state) { for (uint8_t i = 0; i < 5; expect += ++i) { - const f_status_t status = f_fss_count_lines(state_data, buffers[i], buffers[i].used, &line); + f_fss_count_lines(buffers[i], buffers[i].used, &line, &state_data); - assert_int_equal(status, F_none); + assert_int_equal(state_data.status, F_none); assert_int_equal(line, expect); } // for } diff --git a/level_0/f_fss/tests/unit/c/test-fss-count_lines_range.c b/level_0/f_fss/tests/unit/c/test-fss-count_lines_range.c index cc35a91..8e72e81 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-count_lines_range.c +++ b/level_0/f_fss/tests/unit/c/test-fss-count_lines_range.c @@ -11,9 +11,9 @@ void test__f_fss_count_lines_range__parameter_checking(void **state) { const f_string_range_t range = f_string_range_t_initialize; { - const f_status_t status = f_fss_count_lines_range(state_data, f_string_empty_s, range, 0); + f_fss_count_lines_range(f_string_empty_s, range, 0, &state_data); - assert_int_equal(status, F_status_set_error(F_parameter)); + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); } } @@ -26,27 +26,27 @@ void test__f_fss_count_lines_range__returns_data_not(void **state) { f_array_length_t line = 0; f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_count_lines_range(state_data, f_string_empty_s, range, &line); + f_fss_count_lines_range(f_string_empty_s, range, &line, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } { f_array_length_t line = 0; f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_count_lines_range(state_data, test, range, &line); + f_fss_count_lines_range(test, range, &line, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } { f_array_length_t line = 0; f_string_range_t range = macro_f_string_range_t_initialize_1(0, test.used - 1); - const f_status_t status = f_fss_count_lines_range(state_data, f_string_empty_s, range, &line); + f_fss_count_lines_range(f_string_empty_s, range, &line, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } } @@ -69,9 +69,9 @@ void test__f_fss_count_lines_range__works(void **state) { f_string_range_t range = macro_f_string_range_t_initialize_1(0, buffers[i].used - 1); - const f_status_t status = f_fss_count_lines_range(state_data, buffers[i], range, &line); + f_fss_count_lines_range(buffers[i], range, &line, &state_data); - assert_int_equal(status, F_none); + assert_int_equal(state_data.status, F_none); assert_int_equal(line, expect); } // for } diff --git a/level_0/f_fss/tests/unit/c/test-fss-fail_utf.c b/level_0/f_fss/tests/unit/c/test-fss-fail_utf.c index d8c652b..7b8cfea 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-fail_utf.c +++ b/level_0/f_fss/tests/unit/c/test-fss-fail_utf.c @@ -20,17 +20,19 @@ void test__f_fss_fail_utf__works_for_error(void **state) { for (f_status_t i = 0; i < F_status_code_last; ++i) { - const f_status_t status = f_fss_fail_utf(state_data, F_status_set_error(i)); + state_data.status = F_status_set_error(i); + + f_fss_fail_utf(&state_data); for (j = 0; j < 3; ++j) { if (i == statuss[j]) break; } // for if (j == 3) { - assert_int_equal(status, F_status_set_error(i)); + assert_int_equal(state_data.status, F_status_set_error(i)); } else { - assert_int_equal(status, statuss[j]); + assert_int_equal(state_data.status, statuss[j]); } } // for } @@ -39,9 +41,11 @@ void test__f_fss_fail_utf__works_for_error(void **state) { for (f_status_t i = 0; i < F_status_code_last; ++i) { - const f_status_t status = f_fss_fail_utf(state_data, F_status_set_error(i)); + state_data.status = F_status_set_error(i); + + f_fss_fail_utf(&state_data); - assert_int_equal(status, F_status_set_error(i)); + assert_int_equal(state_data.status, F_status_set_error(i)); } // for } @@ -51,18 +55,22 @@ void test__f_fss_fail_utf__works_for_no_error(void **state) { for (f_status_t i = 0; i < F_status_code_last; ++i) { - const f_status_t status = f_fss_fail_utf(state_data, i); + state_data.status = i; - assert_int_equal(status, i); + f_fss_fail_utf(&state_data); + + assert_int_equal(state_data.status, i); } // for state_data.flag |= f_fss_state_flag_utf_fail_on_valid_not_e; for (f_status_t i = 0; i < F_status_code_last; ++i) { - const f_status_t status = f_fss_fail_utf(state_data, i); + state_data.status = i; + + f_fss_fail_utf(&state_data); - assert_int_equal(status, i); + assert_int_equal(state_data.status, i); } // for } diff --git a/level_0/f_fss/tests/unit/c/test-fss-fail_utf_to_false.c b/level_0/f_fss/tests/unit/c/test-fss-fail_utf_to_false.c index 451bc57..7306d23 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-fail_utf_to_false.c +++ b/level_0/f_fss/tests/unit/c/test-fss-fail_utf_to_false.c @@ -20,17 +20,19 @@ void test__f_fss_fail_utf_to_false__works_for_error(void **state) { for (f_status_t i = 0; i < F_status_code_last; ++i) { - const f_status_t status = f_fss_fail_utf_to_false(state_data, F_status_set_error(i)); + state_data.status = F_status_set_error(i); + + f_fss_fail_utf_to_false(&state_data); for (j = 0; j < 3; ++j) { if (i == statuss[j]) break; } // for if (j == 3) { - assert_int_equal(status, F_status_set_error(i)); + assert_int_equal(state_data.status, F_status_set_error(i)); } else { - assert_int_equal(status, F_false); + assert_int_equal(state_data.status, F_false); } } // for } @@ -39,9 +41,11 @@ void test__f_fss_fail_utf_to_false__works_for_error(void **state) { for (f_status_t i = 0; i < F_status_code_last; ++i) { - const f_status_t status = f_fss_fail_utf_to_false(state_data, F_status_set_error(i)); + state_data.status = F_status_set_error(i); + + f_fss_fail_utf_to_false(&state_data); - assert_int_equal(status, F_status_set_error(i)); + assert_int_equal(state_data.status, F_status_set_error(i)); } // for } @@ -51,18 +55,22 @@ void test__f_fss_fail_utf_to_false__works_for_no_error(void **state) { for (f_status_t i = 0; i < F_status_code_last; ++i) { - const f_status_t status = f_fss_fail_utf_to_false(state_data, i); + state_data.status = i; - assert_int_equal(status, i); + f_fss_fail_utf_to_false(&state_data); + + assert_int_equal(state_data.status, i); } // for state_data.flag |= f_fss_state_flag_utf_fail_on_valid_not_e; for (f_status_t i = 0; i < F_status_code_last; ++i) { - const f_status_t status = f_fss_fail_utf_to_false(state_data, i); + state_data.status = i; + + f_fss_fail_utf_to_false(&state_data); - assert_int_equal(status, i); + assert_int_equal(state_data.status, i); } // for } diff --git a/level_0/f_fss/tests/unit/c/test-fss-is_combining.c b/level_0/f_fss/tests/unit/c/test-fss-is_combining.c index ccf6375..cfcd59a 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-is_combining.c +++ b/level_0/f_fss/tests/unit/c/test-fss-is_combining.c @@ -56,7 +56,7 @@ void test__f_fss_is_combining__works(void **state) { const f_string_range_t range = macro_f_string_range_t_initialize_1(offset[i], tests[i].used - 1); - const f_status_t status = f_fss_is_combining(state_data, tests[i], range); + const f_status_t status = f_fss_is_combining(tests[i], range, &state_data); assert_int_equal(status, expects[i]); } // for @@ -64,7 +64,7 @@ void test__f_fss_is_combining__works(void **state) { { const f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_is_combining(state_data, f_string_empty_s, range); + const f_status_t status = f_fss_is_combining(f_string_empty_s, range, &state_data); assert_int_equal(status, F_false); } @@ -72,7 +72,7 @@ void test__f_fss_is_combining__works(void **state) { { const f_string_range_t range = macro_f_string_range_t_initialize_1(0, 2); - const f_status_t status = f_fss_is_combining(state_data, f_string_empty_s, range); + const f_status_t status = f_fss_is_combining(f_string_empty_s, range, &state_data); assert_int_equal(status, F_false); } @@ -81,7 +81,7 @@ void test__f_fss_is_combining__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_is_combining(state_data, test, range); + const f_status_t status = f_fss_is_combining(test, range, &state_data); assert_int_equal(status, F_false); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-is_graph.c b/level_0/f_fss/tests/unit/c/test-fss-is_graph.c index 6612cb9..7e637ba 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-is_graph.c +++ b/level_0/f_fss/tests/unit/c/test-fss-is_graph.c @@ -43,7 +43,7 @@ void test__f_fss_is_graph__works(void **state) { const f_string_range_t range = macro_f_string_range_t_initialize_1(0, tests[i].used - 1); - const f_status_t status = f_fss_is_graph(state_data, tests[i], range); + const f_status_t status = f_fss_is_graph(tests[i], range, &state_data); assert_int_equal(status, expects[i]); } // for @@ -51,7 +51,7 @@ void test__f_fss_is_graph__works(void **state) { { const f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_is_graph(state_data, f_string_empty_s, range); + const f_status_t status = f_fss_is_graph(f_string_empty_s, range, &state_data); assert_int_equal(status, F_false); } @@ -59,7 +59,7 @@ void test__f_fss_is_graph__works(void **state) { { const f_string_range_t range = macro_f_string_range_t_initialize_1(0, 2); - const f_status_t status = f_fss_is_graph(state_data, f_string_empty_s, range); + const f_status_t status = f_fss_is_graph(f_string_empty_s, range, &state_data); assert_int_equal(status, F_false); } @@ -68,7 +68,7 @@ void test__f_fss_is_graph__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_is_graph(state_data, test, range); + const f_status_t status = f_fss_is_graph(test, range, &state_data); assert_int_equal(status, F_false); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-is_space.c b/level_0/f_fss/tests/unit/c/test-fss-is_space.c index 410f681..ee50fdc 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-is_space.c +++ b/level_0/f_fss/tests/unit/c/test-fss-is_space.c @@ -43,7 +43,7 @@ void test__f_fss_is_space__works(void **state) { const f_string_range_t range = macro_f_string_range_t_initialize_1(0, tests[i].used - 1); - const f_status_t status = f_fss_is_space(state_data, tests[i], range); + const f_status_t status = f_fss_is_space(tests[i], range, &state_data); assert_int_equal(status, expects[i]); } // for @@ -51,7 +51,7 @@ void test__f_fss_is_space__works(void **state) { { const f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_is_space(state_data, f_string_empty_s, range); + const f_status_t status = f_fss_is_space(f_string_empty_s, range, &state_data); assert_int_equal(status, F_false); } @@ -59,7 +59,7 @@ void test__f_fss_is_space__works(void **state) { { const f_string_range_t range = macro_f_string_range_t_initialize_1(0, 2); - const f_status_t status = f_fss_is_space(state_data, f_string_empty_s, range); + const f_status_t status = f_fss_is_space(f_string_empty_s, range, &state_data); assert_int_equal(status, F_false); } @@ -68,7 +68,7 @@ void test__f_fss_is_space__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_is_space(state_data, test, range); + const f_status_t status = f_fss_is_space(test, range, &state_data); assert_int_equal(status, F_false); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-is_zero_width.c b/level_0/f_fss/tests/unit/c/test-fss-is_zero_width.c index f0e952b..584b744 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-is_zero_width.c +++ b/level_0/f_fss/tests/unit/c/test-fss-is_zero_width.c @@ -63,7 +63,7 @@ void test__f_fss_is_zero_width__works(void **state) { for (f_array_length_t i = 0; i < 14; ++i) { - const f_status_t status = f_fss_is_zero_width(state_data, tests[i], ranges[i]); + const f_status_t status = f_fss_is_zero_width(tests[i], ranges[i], &state_data); assert_int_equal(status, expects[i]); } // for @@ -71,7 +71,7 @@ void test__f_fss_is_zero_width__works(void **state) { { const f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_is_zero_width(state_data, f_string_empty_s, range); + const f_status_t status = f_fss_is_zero_width(f_string_empty_s, range, &state_data); assert_int_equal(status, F_false); } @@ -79,7 +79,7 @@ void test__f_fss_is_zero_width__works(void **state) { { const f_string_range_t range = macro_f_string_range_t_initialize_1(0, 2); - const f_status_t status = f_fss_is_zero_width(state_data, f_string_empty_s, range); + const f_status_t status = f_fss_is_zero_width(f_string_empty_s, range, &state_data); assert_int_equal(status, F_false); } @@ -88,7 +88,7 @@ void test__f_fss_is_zero_width__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_is_zero_width(state_data, test, range); + const f_status_t status = f_fss_is_zero_width(test, range, &state_data); assert_int_equal(status, F_false); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-seek_to_eol.c b/level_0/f_fss/tests/unit/c/test-fss-seek_to_eol.c index 2136307..356d90b 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-seek_to_eol.c +++ b/level_0/f_fss/tests/unit/c/test-fss-seek_to_eol.c @@ -11,9 +11,9 @@ void test__f_fss_seek_to_eol__parameter_checking(void **state) { f_state_t state_data = f_state_t_initialize; { - const f_status_t status = f_fss_seek_to_eol(state_data, test, 0); + f_fss_seek_to_eol(test, 0, &state_data); - assert_int_equal(status, F_status_set_error(F_parameter)); + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); } } @@ -24,23 +24,26 @@ void test__f_fss_seek_to_eol__returns_data_not(void **state) { { f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_seek_to_eol(state_data, f_string_empty_s, &range); - assert_int_equal(status, F_data_not); + f_fss_seek_to_eol(f_string_empty_s, &range, &state_data); + + assert_int_equal(state_data.status, F_data_not); } { f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_seek_to_eol(state_data, test, &range); - assert_int_equal(status, F_data_not); + f_fss_seek_to_eol(test, &range, &state_data); + + assert_int_equal(state_data.status, F_data_not); } { f_string_range_t range = macro_f_string_range_t_initialize_1(0, 1); - const f_status_t status = f_fss_seek_to_eol(state_data, f_string_empty_s, &range); - assert_int_equal(status, F_data_not); + f_fss_seek_to_eol(f_string_empty_s, &range, &state_data); + + assert_int_equal(state_data.status, F_data_not); } } @@ -112,9 +115,9 @@ void test__f_fss_seek_to_eol__works(void **state) { f_string_range_t range = ranges[i]; - const f_status_t status = f_fss_seek_to_eol(state_data, tests[i], &range); + f_fss_seek_to_eol(tests[i], &range, &state_data); - assert_int_equal(status, statuss[i]); + assert_int_equal(state_data.status, statuss[i]); assert_int_equal(range.start, expects[i]); } // for } diff --git a/level_0/f_fss/tests/unit/c/test-fss-skip_past_delimit.c b/level_0/f_fss/tests/unit/c/test-fss-skip_past_delimit.c index 342a81e..cb56493 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-skip_past_delimit.c +++ b/level_0/f_fss/tests/unit/c/test-fss-skip_past_delimit.c @@ -11,9 +11,9 @@ void test__f_fss_skip_past_delimit__parameter_checking(void **state) { f_state_t state_data = f_state_t_initialize; { - const f_status_t status = f_fss_skip_past_delimit(state_data, test, 0); + f_fss_skip_past_delimit(test, 0, &state_data); - assert_int_equal(status, F_status_set_error(F_parameter)); + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); } } @@ -25,33 +25,33 @@ void test__f_fss_skip_past_delimit__returns_data_not(void **state) { { f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_skip_past_delimit(state_data, f_string_empty_s, &range); + f_fss_skip_past_delimit(f_string_empty_s, &range, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } { f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_skip_past_delimit(state_data, test, &range); + f_fss_skip_past_delimit(test, &range, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } { f_string_range_t range = macro_f_string_range_t_initialize_1(0, test.used - 1); - const f_status_t status = f_fss_skip_past_delimit(state_data, f_string_empty_s, &range); + f_fss_skip_past_delimit(f_string_empty_s, &range, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } { f_string_range_t range = macro_f_string_range_t_initialize_1(test.used, test.used + 2); - const f_status_t status = f_fss_skip_past_delimit(state_data, test, &range); + f_fss_skip_past_delimit(test, &range, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } } @@ -77,9 +77,9 @@ void test__f_fss_skip_past_delimit__works(void **state) { f_string_range_t range = macro_f_string_range_t_initialize_1(0, tests[i].used - 1); - const f_status_t status = f_fss_skip_past_delimit(state_data, tests[i], &range); + f_fss_skip_past_delimit(tests[i], &range, &state_data); - assert_int_equal(status, F_none); + assert_int_equal(state_data.status, F_none); assert_int_equal(range.start, expects[i]); } // for } diff --git a/level_0/f_fss/tests/unit/c/test-fss-skip_past_space.c b/level_0/f_fss/tests/unit/c/test-fss-skip_past_space.c index 9a99386..4fa28e6 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-skip_past_space.c +++ b/level_0/f_fss/tests/unit/c/test-fss-skip_past_space.c @@ -11,9 +11,9 @@ void test__f_fss_skip_past_space__parameter_checking(void **state) { f_state_t state_data = f_state_t_initialize; { - const f_status_t status = f_fss_skip_past_space(state_data, test, 0); + f_fss_skip_past_space(test, 0, &state_data); - assert_int_equal(status, F_status_set_error(F_parameter)); + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); } } @@ -25,33 +25,33 @@ void test__f_fss_skip_past_space__returns_data_not(void **state) { { f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_skip_past_space(state_data, f_string_empty_s, &range); + f_fss_skip_past_space(f_string_empty_s, &range, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } { f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_fss_skip_past_space(state_data, test, &range); + f_fss_skip_past_space(test, &range, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } { f_string_range_t range = macro_f_string_range_t_initialize_1(0, test.used - 1); - const f_status_t status = f_fss_skip_past_space(state_data, f_string_empty_s, &range); + f_fss_skip_past_space(f_string_empty_s, &range, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } { f_string_range_t range = macro_f_string_range_t_initialize_1(test.used, test.used + 2); - const f_status_t status = f_fss_skip_past_space(state_data, test, &range); + f_fss_skip_past_space(test, &range, &state_data); - assert_int_equal(status, F_data_not); + assert_int_equal(state_data.status, F_data_not); } } @@ -83,9 +83,9 @@ void test__f_fss_skip_past_space__works(void **state) { f_string_range_t range = macro_f_string_range_t_initialize_1(0, tests[i].used - 1); - const f_status_t status = f_fss_skip_past_space(state_data, tests[i], &range); + f_fss_skip_past_space(tests[i], &range, &state_data); - assert_int_equal(status, F_none); + assert_int_equal(state_data.status, F_none); assert_int_equal(range.start, expects[i]); } // for } diff --git a/level_0/f_iki/tests/unit/c/test-iki-read.c b/level_0/f_iki/tests/unit/c/test-iki-read.c index 6cd9d94..e1f689b 100644 --- a/level_0/f_iki/tests/unit/c/test-iki-read.c +++ b/level_0/f_iki/tests/unit/c/test-iki-read.c @@ -7,83 +7,83 @@ extern "C" { void test__f_iki_read__parameter_checking(void **state) { - const f_state_t the_state = f_state_t_initialize; + f_state_t state_data = f_state_t_initialize; f_string_static_t empty = macro_f_string_static_t_initialize_1(f_string_empty_s.string, f_string_empty_s.size, f_string_empty_s.used); { f_string_range_t range = f_string_range_t_initialize; f_iki_data_t iki = f_iki_data_t_initialize; - const f_status_t status = f_iki_read(the_state, 0, &range, &iki); + f_iki_read(0, &range, &iki, &state_data); - assert_int_equal(status, F_status_set_error(F_parameter)); + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); } { f_iki_data_t iki = f_iki_data_t_initialize; - const f_status_t status = f_iki_read(the_state, &empty, 0, &iki); + f_iki_read(&empty, 0, &iki, &state_data); - assert_int_equal(status, F_status_set_error(F_parameter)); + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); } { f_string_range_t range = f_string_range_t_initialize; - const f_status_t status = f_iki_read(the_state, &empty, &range, 0); + f_iki_read(&empty, &range, 0, &state_data); - assert_int_equal(status, F_status_set_error(F_parameter)); + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); } } void test__f_iki_read__returns_data_not(void **state) { - const f_state_t the_state = f_state_t_initialize; + f_state_t state_data = f_state_t_initialize; f_string_static_t empty = macro_f_string_static_t_initialize_1(f_string_empty_s.string, f_string_empty_s.size, f_string_empty_s.used); { f_string_range_t range = f_string_range_t_initialize; f_iki_data_t iki = f_iki_data_t_initialize; - const f_status_t status = f_iki_read(the_state, &empty, &range, &iki); + f_iki_read(&empty, &range, &iki, &state_data); - assert_int_equal(F_status_set_fine(status), F_data_not); + assert_int_equal(F_status_set_fine(state_data.status), F_data_not); } } void test__f_iki_read__returns_data_not_eos(void **state) { - const f_state_t the_state = f_state_t_initialize; + f_state_t state_data = f_state_t_initialize; f_string_static_t ascii_a = macro_f_string_static_t_initialize_1(f_string_ascii_a_s.string, f_string_ascii_a_s.size, f_string_ascii_a_s.used); { f_string_range_t range = macro_f_string_range_t_initialize_1(f_string_ascii_a_s.used, f_string_ascii_a_s.used); f_iki_data_t iki = f_iki_data_t_initialize; - const f_status_t status = f_iki_read(the_state, &ascii_a, &range, &iki); + f_iki_read(&ascii_a, &range, &iki, &state_data); - assert_int_equal(F_status_set_fine(status), F_data_not_eos); + assert_int_equal(F_status_set_fine(state_data.status), F_data_not_eos); } } void test__f_iki_read__returns_data_not_stop(void **state) { - const f_state_t the_state = f_state_t_initialize; + f_state_t state_data = f_state_t_initialize; f_string_static_t ascii_a = macro_f_string_static_t_initialize_1(f_string_ascii_a_s.string, f_string_ascii_a_s.size, f_string_ascii_a_s.used); { f_string_range_t range = f_string_range_t_initialize; f_iki_data_t iki = f_iki_data_t_initialize; - const f_status_t status = f_iki_read(the_state, &ascii_a, &range, &iki); + f_iki_read(&ascii_a, &range, &iki, &state_data); - assert_int_equal(F_status_set_fine(status), F_data_not_stop); + assert_int_equal(F_status_set_fine(state_data.status), F_data_not_stop); } } void test__f_iki_read__works(void **state) { - const f_state_t the_state = f_state_t_initialize; + f_state_t state_data = f_state_t_initialize; f_string_static_t empty = macro_f_string_static_t_initialize_1(f_string_empty_s.string, f_string_empty_s.size, f_string_empty_s.used); f_string_static_t ascii_a = macro_f_string_static_t_initialize_1(f_string_ascii_a_s.string, f_string_ascii_a_s.size, f_string_ascii_a_s.used); @@ -242,14 +242,14 @@ void test__f_iki_read__works(void **state) { f_string_range_t range = macro_f_string_range_t_initialize_2(buffers[i].used); f_iki_data_t iki = f_iki_data_t_initialize; - const f_status_t status = f_iki_read(the_state, &buffers[i], &range, &iki); + f_iki_read(&buffers[i], &range, &iki, &state_data); - assert_int_equal(status, statuss[i]); + assert_int_equal(state_data.status, statuss[i]); if (matches[i] == 2) { - const f_status_t status = f_iki_read(the_state, &buffers[i], &range, &iki); + f_iki_read(&buffers[i], &range, &iki, &state_data); - assert_int_equal(F_status_is_error_not(status) ? 0 : 1, 0); + assert_int_equal(F_status_is_error_not(state_data.status) ? 0 : 1, 0); } assert_int_equal(iki.variable.used, matches[i]); diff --git a/level_0/f_pipe/data/build/settings-tests b/level_0/f_pipe/data/build/settings-tests index a82a23f..e1545a6 100644 --- a/level_0/f_pipe/data/build/settings-tests +++ b/level_0/f_pipe/data/build/settings-tests @@ -25,7 +25,7 @@ build_language c build_libraries -lc -lcmocka build_libraries-individual -lf_memory -lf_string -lf_type_array -lf_utf -lf_pipe -build_sources_program test-pipe-debug_exists.c test-pipe-error_exists.c test-pipe-input_exists.c test-pipe-warning_exists.c +build_sources_program test-pipe-error_exists.c test-pipe-input_exists.c test-pipe-output_exists.c build_sources_program test-pipe.c build_script no diff --git a/level_0/f_pipe/tests/unit/c/test-pipe-debug_exists.h b/level_0/f_pipe/tests/unit/c/test-pipe-debug_exists.h deleted file mode 100644 index 7aaea4e..0000000 --- a/level_0/f_pipe/tests/unit/c/test-pipe-debug_exists.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: Pipe - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the pipe project. - */ -#ifndef _TEST__F_pipe_debug_exists_h -#define _TEST__F_pipe_debug_exists_h - -/** - * Test that function fails. - * - * @see f_pipe_debug_exists() - */ -extern void test__f_pipe_debug_exists__fails(void **state); - -/** - * Test that function returns F_false. - * - * @see f_pipe_debug_exists() - */ -extern void test__f_pipe_debug_exists__returns_false(void **state); - -/** - * Test that function returns F_true. - * - * @see f_pipe_debug_exists() - */ -extern void test__f_pipe_debug_exists__returns_true(void **state); - -#endif // _TEST__F_pipe_debug_exists_h diff --git a/level_0/f_pipe/tests/unit/c/test-pipe-debug_exists.c b/level_0/f_pipe/tests/unit/c/test-pipe-output_exists.c similarity index 73% rename from level_0/f_pipe/tests/unit/c/test-pipe-debug_exists.c rename to level_0/f_pipe/tests/unit/c/test-pipe-output_exists.c index fa3bb98..2bf2fd4 100644 --- a/level_0/f_pipe/tests/unit/c/test-pipe-debug_exists.c +++ b/level_0/f_pipe/tests/unit/c/test-pipe-output_exists.c @@ -1,11 +1,11 @@ #include "test-pipe.h" -#include "test-pipe-debug_exists.h" +#include "test-pipe-output_exists.h" #ifdef __cplusplus extern "C" { #endif -void test__f_pipe_debug_exists__fails(void **state) { +void test__f_pipe_output_exists__fails(void **state) { int errnos[] = { EACCES, @@ -26,13 +26,13 @@ void test__f_pipe_debug_exists__fails(void **state) { will_return(__wrap_fstat, true); will_return(__wrap_fstat, errnos[i]); - const f_status_t status = f_pipe_debug_exists(); + const f_status_t status = f_pipe_output_exists(); assert_int_equal(status, F_status_set_error(F_file_stat)); } // for } -void test__f_pipe_debug_exists__returns_false(void **state) { +void test__f_pipe_output_exists__returns_false(void **state) { struct stat statistics; @@ -45,13 +45,13 @@ void test__f_pipe_debug_exists__returns_false(void **state) { will_return(__wrap_fstat, &statistics); will_return(__wrap_fstat, 0); - const f_status_t status = f_pipe_debug_exists(); + const f_status_t status = f_pipe_output_exists(); assert_int_equal(status, F_false); } } -void test__f_pipe_debug_exists__returns_true(void **state) { +void test__f_pipe_output_exists__returns_true(void **state) { struct stat statistics; @@ -64,7 +64,7 @@ void test__f_pipe_debug_exists__returns_true(void **state) { will_return(__wrap_fstat, &statistics); will_return(__wrap_fstat, 0); - const f_status_t status = f_pipe_debug_exists(); + const f_status_t status = f_pipe_output_exists(); assert_int_equal(status, F_true); } diff --git a/level_0/f_pipe/tests/unit/c/test-pipe-output_exists.h b/level_0/f_pipe/tests/unit/c/test-pipe-output_exists.h new file mode 100644 index 0000000..36257ec --- /dev/null +++ b/level_0/f_pipe/tests/unit/c/test-pipe-output_exists.h @@ -0,0 +1,34 @@ +/** + * FLL - Level 0 + * + * Project: Pipe + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the pipe project. + */ +#ifndef _TEST__F_pipe_output_exists_h +#define _TEST__F_pipe_output_exists_h + +/** + * Test that function fails. + * + * @see f_pipe_output_exists() + */ +extern void test__f_pipe_output_exists__fails(void **state); + +/** + * Test that function returns F_false. + * + * @see f_pipe_output_exists() + */ +extern void test__f_pipe_output_exists__returns_false(void **state); + +/** + * Test that function returns F_true. + * + * @see f_pipe_output_exists() + */ +extern void test__f_pipe_output_exists__returns_true(void **state); + +#endif // _TEST__F_pipe_output_exists_h diff --git a/level_0/f_pipe/tests/unit/c/test-pipe-warning_exists.c b/level_0/f_pipe/tests/unit/c/test-pipe-warning_exists.c deleted file mode 100644 index f0b08ce..0000000 --- a/level_0/f_pipe/tests/unit/c/test-pipe-warning_exists.c +++ /dev/null @@ -1,75 +0,0 @@ -#include "test-pipe.h" -#include "test-pipe-warning_exists.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void test__f_pipe_warning_exists__fails(void **state) { - - int errnos[] = { - EACCES, - EBADF, - EFAULT, - EINVAL, - ELOOP, - ENAMETOOLONG, - ENOENT, - ENOMEM, - ENOTDIR, - EOVERFLOW, - mock_errno_generic, - }; - - for (int i = 0; i < 11; ++i) { - - will_return(__wrap_fstat, true); - will_return(__wrap_fstat, errnos[i]); - - const f_status_t status = f_pipe_warning_exists(); - - assert_int_equal(status, F_status_set_error(F_file_stat)); - } // for -} - -void test__f_pipe_warning_exists__returns_false(void **state) { - - struct stat statistics; - - memset(&statistics, 0, sizeof(struct stat)); - - { - statistics.st_mode = 1 | S_IFREG; - - will_return(__wrap_fstat, false); - will_return(__wrap_fstat, &statistics); - will_return(__wrap_fstat, 0); - - const f_status_t status = f_pipe_warning_exists(); - - assert_int_equal(status, F_false); - } -} - -void test__f_pipe_warning_exists__returns_true(void **state) { - - struct stat statistics; - - memset(&statistics, 0, sizeof(struct stat)); - - { - statistics.st_mode = 1 | S_IFIFO; - - will_return(__wrap_fstat, false); - will_return(__wrap_fstat, &statistics); - will_return(__wrap_fstat, 0); - - const f_status_t status = f_pipe_warning_exists(); - - assert_int_equal(status, F_true); - } -} - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_pipe/tests/unit/c/test-pipe-warning_exists.h b/level_0/f_pipe/tests/unit/c/test-pipe-warning_exists.h deleted file mode 100644 index e157c3c..0000000 --- a/level_0/f_pipe/tests/unit/c/test-pipe-warning_exists.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: Pipe - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the pipe project. - */ -#ifndef _TEST__F_pipe_warning_exists_h -#define _TEST__F_pipe_warning_exists_h - -/** - * Test that function fails. - * - * @see f_pipe_warning_exists() - */ -extern void test__f_pipe_warning_exists__fails(void **state); - -/** - * Test that function returns F_false. - * - * @see f_pipe_warning_exists() - */ -extern void test__f_pipe_warning_exists__returns_false(void **state); - -/** - * Test that function returns F_true. - * - * @see f_pipe_warning_exists() - */ -extern void test__f_pipe_warning_exists__returns_true(void **state); - -#endif // _TEST__F_pipe_warning_exists_h diff --git a/level_0/f_pipe/tests/unit/c/test-pipe.c b/level_0/f_pipe/tests/unit/c/test-pipe.c index c82d7ee..2a54ed0 100644 --- a/level_0/f_pipe/tests/unit/c/test-pipe.c +++ b/level_0/f_pipe/tests/unit/c/test-pipe.c @@ -19,10 +19,6 @@ int setdown(void **state) { int main(void) { const struct CMUnitTest tests[] = { - cmocka_unit_test(test__f_pipe_debug_exists__fails), - cmocka_unit_test(test__f_pipe_debug_exists__returns_false), - cmocka_unit_test(test__f_pipe_debug_exists__returns_true), - cmocka_unit_test(test__f_pipe_error_exists__fails), cmocka_unit_test(test__f_pipe_error_exists__returns_false), cmocka_unit_test(test__f_pipe_error_exists__returns_true), @@ -31,15 +27,14 @@ int main(void) { cmocka_unit_test(test__f_pipe_input_exists__returns_false), cmocka_unit_test(test__f_pipe_input_exists__returns_true), - cmocka_unit_test(test__f_pipe_warning_exists__fails), - cmocka_unit_test(test__f_pipe_warning_exists__returns_false), - cmocka_unit_test(test__f_pipe_warning_exists__returns_true), + cmocka_unit_test(test__f_pipe_output_exists__fails), + cmocka_unit_test(test__f_pipe_output_exists__returns_false), + cmocka_unit_test(test__f_pipe_output_exists__returns_true), #ifndef _di_level_0_parameter_checking_ - // f_pipe_debug_exists() doesn't use parameter checking. // f_pipe_error_exists() doesn't use parameter checking. // f_pipe_input_exists() doesn't use parameter checking. - // f_pipe_warning_exists() doesn't use parameter checking. + // f_pipe_output_exists() doesn't use parameter checking. #endif // _di_level_0_parameter_checking_ }; diff --git a/level_0/f_pipe/tests/unit/c/test-pipe.h b/level_0/f_pipe/tests/unit/c/test-pipe.h index 10eb2ef..956c6ec 100644 --- a/level_0/f_pipe/tests/unit/c/test-pipe.h +++ b/level_0/f_pipe/tests/unit/c/test-pipe.h @@ -27,10 +27,9 @@ #include "mock-pipe.h" // Test includes. -#include "test-pipe-debug_exists.h" #include "test-pipe-error_exists.h" #include "test-pipe-input_exists.h" -#include "test-pipe-warning_exists.h" +#include "test-pipe-output_exists.h" #ifdef __cplusplus extern "C" { diff --git a/level_0/f_print/tests/unit/c/test-print-.c b/level_0/f_print/tests/unit/c/test-print-.c index 91bd79e..0285162 100644 --- a/level_0/f_print/tests/unit/c/test-print-.c +++ b/level_0/f_print/tests/unit/c/test-print-.c @@ -8,62 +8,66 @@ extern "C" { void test__f_print__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print(test.string, test.used, stdout); + const f_status_t status = f_print(test.string, test.used, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print__parameter_checking(void **state) { +void test__f_print__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print(test.string, test.used, 0); + const f_status_t status = f_print(f_string_empty_s.string, f_string_empty_s.used, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); { - const f_status_t status = f_print(f_string_empty_s.string, f_string_empty_s.used, stdout); + const f_status_t status = f_print(test.string, f_string_empty_s.used, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print(test.string, f_string_empty_s.used, stdout); + const f_status_t status = f_print(0, test.used, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print(0, test.used, stdout); + const f_status_t status = f_print(test.string, test.used, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print(test.string, test.used, stdout); + const f_status_t status = f_print(test.string, test.used, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-.h b/level_0/f_print/tests/unit/c/test-print-.h index 033493e..7bf9b27 100644 --- a/level_0/f_print/tests/unit/c/test-print-.h +++ b/level_0/f_print/tests/unit/c/test-print-.h @@ -18,18 +18,18 @@ extern void test__f_print__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print() */ -extern void test__f_print__parameter_checking(void **state); +extern void test__f_print__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print() */ -extern void test__f_print__returns_data_not(void **state); +extern void test__f_print__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-character.c b/level_0/f_print/tests/unit/c/test-print-character.c index 0f2830d..28a16d2 100644 --- a/level_0/f_print/tests/unit/c/test-print-character.c +++ b/level_0/f_print/tests/unit/c/test-print-character.c @@ -8,39 +8,42 @@ extern "C" { void test__f_print_character__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_character(test.string[0], stdout); + const f_status_t status = f_print_character(test.string[0], output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_character__parameter_checking(void **state) { +void test__f_print_character__returns_stream_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_character(test.string[0], 0); + const f_status_t status = f_print_character(test.string[0], output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print_character__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_character(test.string[0], stdout); + const f_status_t status = f_print_character(test.string[0], output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-character.h b/level_0/f_print/tests/unit/c/test-print-character.h index 2a245e1..a146a6c 100644 --- a/level_0/f_print/tests/unit/c/test-print-character.h +++ b/level_0/f_print/tests/unit/c/test-print-character.h @@ -18,11 +18,11 @@ extern void test__f_print_character__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_stream_not. * * @see f_print_character() */ -extern void test__f_print_character__parameter_checking(void **state); +extern void test__f_print_character__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-character_safely.c b/level_0/f_print/tests/unit/c/test-print-character_safely.c index f22f3cb..316779a 100644 --- a/level_0/f_print/tests/unit/c/test-print-character_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-character_safely.c @@ -8,13 +8,14 @@ extern "C" { void test__f_print_character_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_character_safely(test.string[0], stdout); + const f_status_t status = f_print_character_safely(test.string[0], output); assert_int_equal(status, F_status_set_error(F_output)); } @@ -24,7 +25,7 @@ void test__f_print_character_safely__fails(void **state) { will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_character_safely((f_char_t) 0x7f, stdout); + const f_status_t status = f_print_character_safely((f_char_t) 0x7f, output); assert_int_equal(status, F_status_set_error(F_output)); } @@ -34,7 +35,7 @@ void test__f_print_character_safely__fails(void **state) { will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_character_safely((f_char_t) F_utf_byte_1_d, stdout); + const f_status_t status = f_print_character_safely((f_char_t) F_utf_byte_1_d, output); assert_int_equal(status, F_status_set_error(F_output)); } @@ -46,7 +47,7 @@ void test__f_print_character_safely__fails(void **state) { will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_character_safely(alternate.string[0], stdout); + const f_status_t status = f_print_character_safely(alternate.string[0], output); assert_int_equal(status, F_status_set_error(F_output)); } @@ -56,33 +57,35 @@ void test__f_print_character_safely__fails(void **state) { will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_character_safely(test.string[0], stdout); + const f_status_t status = f_print_character_safely(test.string[0], output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_character_safely__parameter_checking(void **state) { +void test__f_print_character_safely__returns_stream_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_character_safely(test.string[0], 0); + const f_status_t status = f_print_character_safely(test.string[0], output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print_character_safely__returns_utf(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("蠇", 0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_character_safely(test.string[0], stdout); + const f_status_t status = f_print_character_safely(test.string[0], output); assert_int_equal(status, F_utf); } @@ -91,13 +94,14 @@ void test__f_print_character_safely__returns_utf(void **state) { void test__f_print_character_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, f_print_sequence_delete_s.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_character_safely((f_char_t) 0x7f, stdout); + const f_status_t status = f_print_character_safely((f_char_t) 0x7f, output); assert_int_equal(status, F_none); } @@ -107,7 +111,7 @@ void test__f_print_character_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, f_print_sequence_unknown_s.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_character_safely((f_char_t) F_utf_byte_1_d, stdout); + const f_status_t status = f_print_character_safely((f_char_t) F_utf_byte_1_d, output); assert_int_equal(status, F_none); } @@ -117,7 +121,7 @@ void test__f_print_character_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_character_safely(test.string[0], stdout); + const f_status_t status = f_print_character_safely(test.string[0], output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-character_safely.h b/level_0/f_print/tests/unit/c/test-print-character_safely.h index 2de4b2b..7e8db93 100644 --- a/level_0/f_print/tests/unit/c/test-print-character_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-character_safely.h @@ -18,11 +18,11 @@ extern void test__f_print_character_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_stream_not. * * @see f_print_character_safely() */ -extern void test__f_print_character_safely__parameter_checking(void **state); +extern void test__f_print_character_safely__returns_stream_not(void **state); /** * Test that function works but returns F_utf. diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic.c b/level_0/f_print/tests/unit/c/test-print-dynamic.c index f72d796..bba0a7e 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic.c +++ b/level_0/f_print/tests/unit/c/test-print-dynamic.c @@ -8,48 +8,53 @@ extern "C" { void test__f_print_dynamic__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_dynamic(test, stdout); + const f_status_t status = f_print_dynamic(test, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_dynamic__parameter_checking(void **state) { +void test__f_print_dynamic__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic(test, 0); + const f_status_t status = f_print_dynamic(f_string_empty_s, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_dynamic__returns_data_not(void **state) { +void test__f_print_dynamic__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic(f_string_empty_s, stdout); + const f_status_t status = f_print_dynamic(test, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print_dynamic__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_dynamic(test, stdout); + const f_status_t status = f_print_dynamic(test, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic.h b/level_0/f_print/tests/unit/c/test-print-dynamic.h index 2b413ca..b9e4510 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic.h +++ b/level_0/f_print/tests/unit/c/test-print-dynamic.h @@ -18,18 +18,18 @@ extern void test__f_print_dynamic__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_dynamic() */ -extern void test__f_print_dynamic__parameter_checking(void **state); +extern void test__f_print_dynamic__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_dynamic() */ -extern void test__f_print_dynamic__returns_data_not(void **state); +extern void test__f_print_dynamic__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_partial.c b/level_0/f_print/tests/unit/c/test-print-dynamic_partial.c index 318ddbf..a3092a3 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_partial.c +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_partial.c @@ -9,38 +9,41 @@ void test__f_print_dynamic_partial__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_dynamic_partial(test, partial, stdout); + const f_status_t status = f_print_dynamic_partial(test, partial, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_dynamic_partial__parameter_checking(void **state) { +void test__f_print_dynamic_partial__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_partial(test, partial, 0); + const f_status_t status = f_print_dynamic_partial(f_string_empty_s, partial, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_dynamic_partial__returns_data_not(void **state) { +void test__f_print_dynamic_partial__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_partial(f_string_empty_s, partial, stdout); + const f_status_t status = f_print_dynamic_partial(test, partial, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } @@ -48,13 +51,14 @@ void test__f_print_dynamic_partial__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_dynamic_partial(test, partial, stdout); + const f_status_t status = f_print_dynamic_partial(test, partial, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_partial.h b/level_0/f_print/tests/unit/c/test-print-dynamic_partial.h index 327d748..a054182 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_partial.h +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_partial.h @@ -18,18 +18,18 @@ extern void test__f_print_dynamic_partial__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_dynamic_partial() */ -extern void test__f_print_dynamic_partial__parameter_checking(void **state); +extern void test__f_print_dynamic_partial__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_dynamic_partial() */ -extern void test__f_print_dynamic_partial__returns_data_not(void **state); +extern void test__f_print_dynamic_partial__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw.c b/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw.c index 9e15191..b9c9f4e 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw.c @@ -9,38 +9,41 @@ void test__f_print_dynamic_partial_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_dynamic_partial_raw(test, partial, stdout); + const f_status_t status = f_print_dynamic_partial_raw(test, partial, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_dynamic_partial_raw__parameter_checking(void **state) { +void test__f_print_dynamic_partial_raw__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_partial_raw(test, partial, 0); + const f_status_t status = f_print_dynamic_partial_raw(f_string_empty_s, partial, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_dynamic_partial_raw__returns_data_not(void **state) { +void test__f_print_dynamic_partial_raw__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_partial_raw(f_string_empty_s, partial, stdout); + const f_status_t status = f_print_dynamic_partial_raw(test, partial, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } @@ -48,13 +51,14 @@ void test__f_print_dynamic_partial_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, 3); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_dynamic_partial_raw(test, partial, stdout); + const f_status_t status = f_print_dynamic_partial_raw(test, partial, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw.h b/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw.h index 37b07de..96b3501 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_dynamic_partial_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_dynamic_partial_raw() */ -extern void test__f_print_dynamic_partial_raw__parameter_checking(void **state); +extern void test__f_print_dynamic_partial_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_dynamic_partial_raw() */ -extern void test__f_print_dynamic_partial_raw__returns_data_not(void **state); +extern void test__f_print_dynamic_partial_raw__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw_safely.c index 7523b56..cf44d03 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw_safely.c @@ -9,38 +9,41 @@ void test__f_print_dynamic_partial_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_dynamic_partial_raw_safely(test, partial, stdout); + const f_status_t status = f_print_dynamic_partial_raw_safely(test, partial, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_dynamic_partial_raw_safely__parameter_checking(void **state) { +void test__f_print_dynamic_partial_raw_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_partial_raw_safely(test, partial, 0); + const f_status_t status = f_print_dynamic_partial_raw_safely(f_string_empty_s, partial, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_dynamic_partial_raw_safely__returns_data_not(void **state) { +void test__f_print_dynamic_partial_raw_safely__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_partial_raw_safely(f_string_empty_s, partial, stdout); + const f_status_t status = f_print_dynamic_partial_raw_safely(test, partial, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } @@ -48,13 +51,14 @@ void test__f_print_dynamic_partial_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, 3); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_dynamic_partial_raw_safely(test, partial, stdout); + const f_status_t status = f_print_dynamic_partial_raw_safely(test, partial, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw_safely.h index 388cc98..fe279b1 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_partial_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_dynamic_partial_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_dynamic_partial_raw_safely() */ -extern void test__f_print_dynamic_partial_raw_safely__parameter_checking(void **state); +extern void test__f_print_dynamic_partial_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_dynamic_partial_raw_safely() */ -extern void test__f_print_dynamic_partial_raw_safely__returns_data_not(void **state); +extern void test__f_print_dynamic_partial_raw_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_partial_safely.c b/level_0/f_print/tests/unit/c/test-print-dynamic_partial_safely.c index 1685e52..a7ce2b4 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_partial_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_partial_safely.c @@ -9,38 +9,41 @@ void test__f_print_dynamic_partial_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_dynamic_partial_safely(test, partial, stdout); + const f_status_t status = f_print_dynamic_partial_safely(test, partial, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_dynamic_partial_safely__parameter_checking(void **state) { +void test__f_print_dynamic_partial_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_partial_safely(test, partial, 0); + const f_status_t status = f_print_dynamic_partial_safely(f_string_empty_s, partial, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_dynamic_partial_safely__returns_data_not(void **state) { +void test__f_print_dynamic_partial_safely__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_partial_safely(f_string_empty_s, partial, stdout); + const f_status_t status = f_print_dynamic_partial_safely(test, partial, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } @@ -48,13 +51,14 @@ void test__f_print_dynamic_partial_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, 3); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_dynamic_partial_safely(test, partial, stdout); + const f_status_t status = f_print_dynamic_partial_safely(test, partial, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_partial_safely.h b/level_0/f_print/tests/unit/c/test-print-dynamic_partial_safely.h index 660e65c..78f90c6 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_partial_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_partial_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_dynamic_partial_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_dynamic_partial_safely() */ -extern void test__f_print_dynamic_partial_safely__parameter_checking(void **state); +extern void test__f_print_dynamic_partial_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_dynamic_partial_safely() */ -extern void test__f_print_dynamic_partial_safely__returns_data_not(void **state); +extern void test__f_print_dynamic_partial_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_raw.c b/level_0/f_print/tests/unit/c/test-print-dynamic_raw.c index acf02b1..6f7650a 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_raw.c @@ -8,48 +8,53 @@ extern "C" { void test__f_print_dynamic_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_dynamic_raw(test, stdout); + const f_status_t status = f_print_dynamic_raw(test, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_dynamic_raw__parameter_checking(void **state) { +void test__f_print_dynamic_raw__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_raw(test, 0); + const f_status_t status = f_print_dynamic_raw(f_string_empty_s, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_dynamic_raw__returns_data_not(void **state) { +void test__f_print_dynamic_raw__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_raw(f_string_empty_s, stdout); + const f_status_t status = f_print_dynamic_raw(test, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print_dynamic_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_dynamic_raw(test, stdout); + const f_status_t status = f_print_dynamic_raw(test, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_raw.h b/level_0/f_print/tests/unit/c/test-print-dynamic_raw.h index 568a6ce..21adf1d 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_dynamic_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_dynamic_raw() */ -extern void test__f_print_dynamic_raw__parameter_checking(void **state); +extern void test__f_print_dynamic_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_dynamic_raw() */ -extern void test__f_print_dynamic_raw__returns_data_not(void **state); +extern void test__f_print_dynamic_raw__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-dynamic_raw_safely.c index 04e1908..dc46d16 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_raw_safely.c @@ -8,48 +8,53 @@ extern "C" { void test__f_print_dynamic_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_dynamic_raw_safely(test, stdout); + const f_status_t status = f_print_dynamic_raw_safely(test, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_dynamic_raw_safely__parameter_checking(void **state) { +void test__f_print_dynamic_raw_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_raw_safely(test, 0); + const f_status_t status = f_print_dynamic_raw_safely(f_string_empty_s, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_dynamic_raw_safely__returns_data_not(void **state) { +void test__f_print_dynamic_raw_safely__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_raw_safely(f_string_empty_s, stdout); + const f_status_t status = f_print_dynamic_raw_safely(test, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print_dynamic_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_dynamic_raw_safely(test, stdout); + const f_status_t status = f_print_dynamic_raw_safely(test, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-dynamic_raw_safely.h index 7416489..bbdb860 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_dynamic_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_dynamic_raw_safely() */ -extern void test__f_print_dynamic_raw_safely__parameter_checking(void **state); +extern void test__f_print_dynamic_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_dynamic_raw_safely() */ -extern void test__f_print_dynamic_raw_safely__returns_data_not(void **state); +extern void test__f_print_dynamic_raw_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_safely.c b/level_0/f_print/tests/unit/c/test-print-dynamic_safely.c index 7089888..f8a3333 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_safely.c @@ -8,48 +8,53 @@ extern "C" { void test__f_print_dynamic_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_dynamic_safely(test, stdout); + const f_status_t status = f_print_dynamic_safely(test, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_dynamic_safely__parameter_checking(void **state) { +void test__f_print_dynamic_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_safely(test, 0); + const f_status_t status = f_print_dynamic_safely(f_string_empty_s, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_dynamic_safely__returns_data_not(void **state) { +void test__f_print_dynamic_safely__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_dynamic_safely(f_string_empty_s, stdout); + const f_status_t status = f_print_dynamic_safely(test, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print_dynamic_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_dynamic_safely(test, stdout); + const f_status_t status = f_print_dynamic_safely(test, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-dynamic_safely.h b/level_0/f_print/tests/unit/c/test-print-dynamic_safely.h index 19e61e6..30f8eb6 100644 --- a/level_0/f_print/tests/unit/c/test-print-dynamic_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-dynamic_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_dynamic_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_dynamic_safely() */ -extern void test__f_print_dynamic_safely__parameter_checking(void **state); +extern void test__f_print_dynamic_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_dynamic_safely() */ -extern void test__f_print_dynamic_safely__returns_data_not(void **state); +extern void test__f_print_dynamic_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except.c b/level_0/f_print/tests/unit/c/test-print-except.c index 94366d5..40dc08c 100644 --- a/level_0/f_print/tests/unit/c/test-print-except.c +++ b/level_0/f_print/tests/unit/c/test-print-except.c @@ -9,57 +9,61 @@ void test__f_print_except__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except(test.string, 0, test.used, except, stdout); + const f_status_t status = f_print_except(test.string, 0, test.used, except, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except__parameter_checking(void **state) { +void test__f_print_except__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except(test.string, 0, test.used, except, 0); + const f_status_t status = f_print_except(f_string_empty_s.string, 0, f_string_empty_s.used, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_except__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; { - const f_status_t status = f_print_except(f_string_empty_s.string, 0, f_string_empty_s.used, except, stdout); + const f_status_t status = f_print_except(test.string, 0, f_string_empty_s.used, except, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_except(test.string, 0, f_string_empty_s.used, except, stdout); + const f_status_t status = f_print_except(0, 0, test.used, except, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_except__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except(0, 0, test.used, except, stdout); + const f_status_t status = f_print_except(test.string, 0, test.used, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print_except__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -68,7 +72,7 @@ void test__f_print_except__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except(test.string, 0, test.used, except, stdout); + const f_status_t status = f_print_except(test.string, 0, test.used, except, output); assert_int_equal(status, F_none); } @@ -80,7 +84,7 @@ void test__f_print_except__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except(test.string, 2, test.used, except, stdout); + const f_status_t status = f_print_except(test.string, 2, test.used, except, output); assert_int_equal(status, F_none); } @@ -93,7 +97,7 @@ void test__f_print_except__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used - 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except(test.string, 1, test.used, except, stdout); + const f_status_t status = f_print_except(test.string, 1, test.used, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except.h b/level_0/f_print/tests/unit/c/test-print-except.h index f4219e4..1744b6e 100644 --- a/level_0/f_print/tests/unit/c/test-print-except.h +++ b/level_0/f_print/tests/unit/c/test-print-except.h @@ -18,18 +18,18 @@ extern void test__f_print_except__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except() */ -extern void test__f_print_except__parameter_checking(void **state); +extern void test__f_print_except__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except() */ -extern void test__f_print_except__returns_data_not(void **state); +extern void test__f_print_except__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic.c b/level_0/f_print/tests/unit/c/test-print-except_dynamic.c index 5e135ca..bf33789 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic.c +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic.c @@ -9,44 +9,48 @@ void test__f_print_except_dynamic__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_dynamic(test, except, stdout); + const f_status_t status = f_print_except_dynamic(test, except, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_dynamic__parameter_checking(void **state) { +void test__f_print_except_dynamic__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic(test, except, 0); + const f_status_t status = f_print_except_dynamic(f_string_empty_s, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_dynamic__returns_data_not(void **state) { +void test__f_print_except_dynamic__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic(f_string_empty_s, except, stdout); + const f_status_t status = f_print_except_dynamic(test, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print_except_dynamic__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -55,7 +59,7 @@ void test__f_print_except_dynamic__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic(test, except, stdout); + const f_status_t status = f_print_except_dynamic(test, except, output); assert_int_equal(status, F_none); } @@ -68,7 +72,7 @@ void test__f_print_except_dynamic__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used - 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic(test, except, stdout); + const f_status_t status = f_print_except_dynamic(test, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic.h b/level_0/f_print/tests/unit/c/test-print-except_dynamic.h index d210648..a44bb56 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic.h +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic.h @@ -18,18 +18,18 @@ extern void test__f_print_except_dynamic__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_dynamic() */ -extern void test__f_print_except_dynamic__parameter_checking(void **state); +extern void test__f_print_except_dynamic__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_dynamic() */ -extern void test__f_print_except_dynamic__returns_data_not(void **state); +extern void test__f_print_except_dynamic__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial.c b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial.c index f7b4e2e..f2e2dd3 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial.c +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial.c @@ -10,40 +10,43 @@ void test__f_print_except_dynamic_partial__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_dynamic_partial(test, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial(test, partial, except, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_dynamic_partial__parameter_checking(void **state) { +void test__f_print_except_dynamic_partial__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_partial(test, partial, except, 0); + const f_status_t status = f_print_except_dynamic_partial(f_string_empty_s, partial, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_dynamic_partial__returns_data_not(void **state) { +void test__f_print_except_dynamic_partial__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_partial(f_string_empty_s, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial(test, partial, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } @@ -51,6 +54,7 @@ void test__f_print_except_dynamic_partial__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -59,7 +63,7 @@ void test__f_print_except_dynamic_partial__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_partial(test, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial(test, partial, except, output); assert_int_equal(status, F_none); } @@ -72,7 +76,7 @@ void test__f_print_except_dynamic_partial__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used - 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_partial(test, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial(test, partial, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial.h b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial.h index 40d9477..fc205ca 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial.h +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial.h @@ -18,18 +18,18 @@ extern void test__f_print_except_dynamic_partial__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_dynamic_partial() */ -extern void test__f_print_except_dynamic_partial__parameter_checking(void **state); +extern void test__f_print_except_dynamic_partial__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_dynamic_partial() */ -extern void test__f_print_except_dynamic_partial__returns_data_not(void **state); +extern void test__f_print_except_dynamic_partial__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw.c b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw.c index 15fc676..90a34ff 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw.c @@ -10,40 +10,43 @@ void test__f_print_except_dynamic_partial_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_dynamic_partial_raw__parameter_checking(void **state) { +void test__f_print_except_dynamic_partial_raw__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, 0); + const f_status_t status = f_print_except_dynamic_partial_raw(f_string_empty_s, partial, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_dynamic_partial_raw__returns_data_not(void **state) { +void test__f_print_except_dynamic_partial_raw__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_partial_raw(f_string_empty_s, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } @@ -51,6 +54,7 @@ void test__f_print_except_dynamic_partial_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -59,7 +63,7 @@ void test__f_print_except_dynamic_partial_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, output); assert_int_equal(status, F_none); } @@ -72,7 +76,7 @@ void test__f_print_except_dynamic_partial_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used - 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw.h b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw.h index 4701e30..9fb396a 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_except_dynamic_partial_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_dynamic_partial_raw() */ -extern void test__f_print_except_dynamic_partial_raw__parameter_checking(void **state); +extern void test__f_print_except_dynamic_partial_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_dynamic_partial_raw() */ -extern void test__f_print_except_dynamic_partial_raw__returns_data_not(void **state); +extern void test__f_print_except_dynamic_partial_raw__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw_safely.c index 1814be2..a1f0ad6 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw_safely.c @@ -10,40 +10,43 @@ void test__f_print_except_dynamic_partial_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_dynamic_partial_raw_safely__parameter_checking(void **state) { +void test__f_print_except_dynamic_partial_raw_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, 0); + const f_status_t status = f_print_except_dynamic_partial_raw_safely(f_string_empty_s, partial, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_dynamic_partial_raw_safely__returns_data_not(void **state) { +void test__f_print_except_dynamic_partial_raw_safely__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_partial_raw_safely(f_string_empty_s, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } @@ -51,6 +54,7 @@ void test__f_print_except_dynamic_partial_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -59,7 +63,7 @@ void test__f_print_except_dynamic_partial_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, output); assert_int_equal(status, F_none); } @@ -72,7 +76,7 @@ void test__f_print_except_dynamic_partial_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used - 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw_safely.h index 86186de..0648516 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_except_dynamic_partial_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_dynamic_partial_raw_safely() */ -extern void test__f_print_except_dynamic_partial_raw_safely__parameter_checking(void **state); +extern void test__f_print_except_dynamic_partial_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_dynamic_partial_raw_safely() */ -extern void test__f_print_except_dynamic_partial_raw_safely__returns_data_not(void **state); +extern void test__f_print_except_dynamic_partial_raw_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_safely.c b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_safely.c index 845056b..f111767 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_safely.c @@ -10,40 +10,43 @@ void test__f_print_except_dynamic_partial_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_dynamic_partial_safely__parameter_checking(void **state) { +void test__f_print_except_dynamic_partial_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, 0); + const f_status_t status = f_print_except_dynamic_partial_safely(f_string_empty_s, partial, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_dynamic_partial_safely__returns_data_not(void **state) { +void test__f_print_except_dynamic_partial_safely__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_partial_safely(f_string_empty_s, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } @@ -51,6 +54,7 @@ void test__f_print_except_dynamic_partial_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -59,7 +63,7 @@ void test__f_print_except_dynamic_partial_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, output); assert_int_equal(status, F_none); } @@ -72,7 +76,7 @@ void test__f_print_except_dynamic_partial_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used - 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, stdout); + const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_safely.h b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_safely.h index 326cf45..2bccad7 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_partial_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_except_dynamic_partial_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_dynamic_partial_safely() */ -extern void test__f_print_except_dynamic_partial_safely__parameter_checking(void **state); +extern void test__f_print_except_dynamic_partial_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_dynamic_partial_safely() */ -extern void test__f_print_except_dynamic_partial_safely__returns_data_not(void **state); +extern void test__f_print_except_dynamic_partial_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw.c b/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw.c index f36ca02..117f522 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw.c @@ -9,44 +9,48 @@ void test__f_print_except_dynamic_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_dynamic_raw(test, except, stdout); + const f_status_t status = f_print_except_dynamic_raw(test, except, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_dynamic_raw__parameter_checking(void **state) { +void test__f_print_except_dynamic_raw__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_raw(test, except, 0); + const f_status_t status = f_print_except_dynamic_raw(f_string_empty_s, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_dynamic_raw__returns_data_not(void **state) { +void test__f_print_except_dynamic_raw__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_raw(f_string_empty_s, except, stdout); + const f_status_t status = f_print_except_dynamic_raw(test, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print_except_dynamic_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -55,7 +59,7 @@ void test__f_print_except_dynamic_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_raw(test, except, stdout); + const f_status_t status = f_print_except_dynamic_raw(test, except, output); assert_int_equal(status, F_none); } @@ -68,7 +72,7 @@ void test__f_print_except_dynamic_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used - 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_raw(test, except, stdout); + const f_status_t status = f_print_except_dynamic_raw(test, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw.h b/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw.h index 3bbb08b..a71b9e7 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_except_dynamic_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_dynamic_raw() */ -extern void test__f_print_except_dynamic_raw__parameter_checking(void **state); +extern void test__f_print_except_dynamic_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_dynamic_raw() */ -extern void test__f_print_except_dynamic_raw__returns_data_not(void **state); +extern void test__f_print_except_dynamic_raw__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw_safely.c index bd919d2..151fc3f 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw_safely.c @@ -9,44 +9,48 @@ void test__f_print_except_dynamic_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_dynamic_raw_safely(test, except, stdout); + const f_status_t status = f_print_except_dynamic_raw_safely(test, except, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_dynamic_raw_safely__parameter_checking(void **state) { +void test__f_print_except_dynamic_raw_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_raw_safely(test, except, 0); + const f_status_t status = f_print_except_dynamic_raw_safely(f_string_empty_s, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_dynamic_raw_safely__returns_data_not(void **state) { +void test__f_print_except_dynamic_raw_safely__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_raw_safely(f_string_empty_s, except, stdout); + const f_status_t status = f_print_except_dynamic_raw_safely(test, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print_except_dynamic_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -55,7 +59,7 @@ void test__f_print_except_dynamic_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_raw_safely(test, except, stdout); + const f_status_t status = f_print_except_dynamic_raw_safely(test, except, output); assert_int_equal(status, F_none); } @@ -68,7 +72,7 @@ void test__f_print_except_dynamic_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used - 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_raw_safely(test, except, stdout); + const f_status_t status = f_print_except_dynamic_raw_safely(test, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw_safely.h index 8e465b3..c3739b0 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_except_dynamic_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_dynamic_raw_safely() */ -extern void test__f_print_except_dynamic_raw_safely__parameter_checking(void **state); +extern void test__f_print_except_dynamic_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_dynamic_raw_safely() */ -extern void test__f_print_except_dynamic_raw_safely__returns_data_not(void **state); +extern void test__f_print_except_dynamic_raw_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_safely.c b/level_0/f_print/tests/unit/c/test-print-except_dynamic_safely.c index 1a02534..c428708 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_safely.c @@ -9,44 +9,48 @@ void test__f_print_except_dynamic_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_dynamic_safely(test, except, stdout); + const f_status_t status = f_print_except_dynamic_safely(test, except, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_dynamic_safely__parameter_checking(void **state) { +void test__f_print_except_dynamic_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_safely(test, except, 0); + const f_status_t status = f_print_except_dynamic_safely(f_string_empty_s, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_dynamic_safely__returns_data_not(void **state) { +void test__f_print_except_dynamic_safely__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_dynamic_safely(f_string_empty_s, except, stdout); + const f_status_t status = f_print_except_dynamic_safely(test, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print_except_dynamic_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -55,7 +59,7 @@ void test__f_print_except_dynamic_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_safely(test, except, stdout); + const f_status_t status = f_print_except_dynamic_safely(test, except, output); assert_int_equal(status, F_none); } @@ -68,7 +72,7 @@ void test__f_print_except_dynamic_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used - 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_dynamic_safely(test, except, stdout); + const f_status_t status = f_print_except_dynamic_safely(test, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_dynamic_safely.h b/level_0/f_print/tests/unit/c/test-print-except_dynamic_safely.h index a4cc5e6..61c74b4 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_dynamic_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-except_dynamic_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_except_dynamic_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_dynamic_safely() */ -extern void test__f_print_except_dynamic_safely__parameter_checking(void **state); +extern void test__f_print_except_dynamic_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_dynamic_safely() */ -extern void test__f_print_except_dynamic_safely__returns_data_not(void **state); +extern void test__f_print_except_dynamic_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_in.c b/level_0/f_print/tests/unit/c/test-print-except_in.c index 1fd53e5..9436b2a 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in.c +++ b/level_0/f_print/tests/unit/c/test-print-except_in.c @@ -10,59 +10,63 @@ void test__f_print_except_in__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_in(test.string, 0, test.used, except, range, stdout); + const f_status_t status = f_print_except_in(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_in__parameter_checking(void **state) { +void test__f_print_except_in__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in(test.string, 0, test.used, except, range, 0); + const f_status_t status = f_print_except_in(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_except_in__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; - const f_string_ranges_t range = f_string_ranges_t_initialize; { - const f_status_t status = f_print_except_in(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, stdout); + const f_status_t status = f_print_except_in(test.string, 0, f_string_empty_s.used, except, range, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_except_in(test.string, 0, f_string_empty_s.used, except, range, stdout); + const f_status_t status = f_print_except_in(0, 0, test.used, except, range, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_except_in__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in(0, 0, test.used, except, range, stdout); + const f_status_t status = f_print_except_in(test.string, 0, test.used, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(F_status_set_fine(status), F_stream_not); } } void test__f_print_except_in__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -72,7 +76,7 @@ void test__f_print_except_in__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in(test.string, 0, test.used, except, range, stdout); + const f_status_t status = f_print_except_in(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -85,7 +89,7 @@ void test__f_print_except_in__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in(test.string, 2, test.used, except, range, stdout); + const f_status_t status = f_print_except_in(test.string, 2, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -102,7 +106,7 @@ void test__f_print_except_in__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in(test.string, 1, test.used, except, range, stdout); + const f_status_t status = f_print_except_in(test.string, 1, test.used, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_in.h b/level_0/f_print/tests/unit/c/test-print-except_in.h index 6fd2917..84d460b 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in.h +++ b/level_0/f_print/tests/unit/c/test-print-except_in.h @@ -18,18 +18,18 @@ extern void test__f_print_except_in__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_in() */ -extern void test__f_print_except_in__parameter_checking(void **state); +extern void test__f_print_except_in__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_in() */ -extern void test__f_print_except_in__returns_data_not(void **state); +extern void test__f_print_except_in__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic.c b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic.c index 76e2a03..8caf777 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic.c +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic.c @@ -10,46 +10,50 @@ void test__f_print_except_in_dynamic__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_in_dynamic(test, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic(test, except, range, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_in_dynamic__parameter_checking(void **state) { +void test__f_print_except_in_dynamic__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic(test, except, range, 0); + const f_status_t status = f_print_except_in_dynamic(f_string_empty_s, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_in_dynamic__returns_data_not(void **state) { +void test__f_print_except_in_dynamic__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic(f_string_empty_s, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic(test, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_except_in_dynamic__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -59,7 +63,7 @@ void test__f_print_except_in_dynamic__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic(test, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic(test, except, range, output); assert_int_equal(status, F_none); } @@ -76,7 +80,7 @@ void test__f_print_except_in_dynamic__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic(test, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic(test, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic.h b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic.h index ba4afb3..042bc85 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic.h +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic.h @@ -18,18 +18,18 @@ extern void test__f_print_except_in_dynamic__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_in_dynamic() */ -extern void test__f_print_except_in_dynamic__parameter_checking(void **state); +extern void test__f_print_except_in_dynamic__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_in_dynamic() */ -extern void test__f_print_except_in_dynamic__returns_data_not(void **state); +extern void test__f_print_except_in_dynamic__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial.c b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial.c index ced8599..de601b2 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial.c +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial.c @@ -11,42 +11,45 @@ void test__f_print_except_in_dynamic_partial__fails(void **state) { const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_in_dynamic_partial__parameter_checking(void **state) { +void test__f_print_except_in_dynamic_partial__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, 0); + const f_status_t status = f_print_except_in_dynamic_partial(f_string_empty_s, partial, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_in_dynamic_partial__returns_data_not(void **state) { +void test__f_print_except_in_dynamic_partial__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_partial(f_string_empty_s, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } @@ -54,6 +57,7 @@ void test__f_print_except_in_dynamic_partial__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -63,7 +67,7 @@ void test__f_print_except_in_dynamic_partial__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, output); assert_int_equal(status, F_none); } @@ -80,7 +84,7 @@ void test__f_print_except_in_dynamic_partial__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial.h b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial.h index 4c13192..b3f188c 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial.h +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial.h @@ -18,18 +18,18 @@ extern void test__f_print_except_in_dynamic_partial__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_in_dynamic_partial() */ -extern void test__f_print_except_in_dynamic_partial__parameter_checking(void **state); +extern void test__f_print_except_in_dynamic_partial__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_in_dynamic_partial() */ -extern void test__f_print_except_in_dynamic_partial__returns_data_not(void **state); +extern void test__f_print_except_in_dynamic_partial__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw.c b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw.c index 1e1069b..99f16ae 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw.c @@ -11,42 +11,45 @@ void test__f_print_except_in_dynamic_partial_raw__fails(void **state) { const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_in_dynamic_partial_raw__parameter_checking(void **state) { +void test__f_print_except_in_dynamic_partial_raw__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, 0); + const f_status_t status = f_print_except_in_dynamic_partial_raw(f_string_empty_s, partial, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_in_dynamic_partial_raw__returns_data_not(void **state) { +void test__f_print_except_in_dynamic_partial_raw__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_partial_raw(f_string_empty_s, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } @@ -54,6 +57,7 @@ void test__f_print_except_in_dynamic_partial_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -63,7 +67,7 @@ void test__f_print_except_in_dynamic_partial_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, output); assert_int_equal(status, F_none); } @@ -80,7 +84,7 @@ void test__f_print_except_in_dynamic_partial_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw.h b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw.h index 9f158a6..096a51c 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_except_in_dynamic_partial_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_in_dynamic_partial_raw() */ -extern void test__f_print_except_in_dynamic_partial_raw__parameter_checking(void **state); +extern void test__f_print_except_in_dynamic_partial_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_in_dynamic_partial_raw() */ -extern void test__f_print_except_in_dynamic_partial_raw__returns_data_not(void **state); +extern void test__f_print_except_in_dynamic_partial_raw__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw_safely.c index 86ca439..9fda3bf 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw_safely.c @@ -11,42 +11,45 @@ void test__f_print_except_in_dynamic_partial_raw_safely__fails(void **state) { const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_in_dynamic_partial_raw_safely__parameter_checking(void **state) { +void test__f_print_except_in_dynamic_partial_raw_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, 0); + const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(f_string_empty_s, partial, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_in_dynamic_partial_raw_safely__returns_data_not(void **state) { +void test__f_print_except_in_dynamic_partial_raw_safely__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(f_string_empty_s, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } @@ -54,6 +57,7 @@ void test__f_print_except_in_dynamic_partial_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -63,7 +67,7 @@ void test__f_print_except_in_dynamic_partial_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, output); assert_int_equal(status, F_none); } @@ -80,7 +84,7 @@ void test__f_print_except_in_dynamic_partial_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw_safely.h index 11e3f94..2543bec 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_except_in_dynamic_partial_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_in_dynamic_partial_raw_safely() */ -extern void test__f_print_except_in_dynamic_partial_raw_safely__parameter_checking(void **state); +extern void test__f_print_except_in_dynamic_partial_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_in_dynamic_partial_raw_safely() */ -extern void test__f_print_except_in_dynamic_partial_raw_safely__returns_data_not(void **state); +extern void test__f_print_except_in_dynamic_partial_raw_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_safely.c b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_safely.c index ef9c37f..8b88b2f 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_safely.c @@ -11,42 +11,45 @@ void test__f_print_except_in_dynamic_partial_safely__fails(void **state) { const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_in_dynamic_partial_safely__parameter_checking(void **state) { +void test__f_print_except_in_dynamic_partial_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, 0); + const f_status_t status = f_print_except_in_dynamic_partial_safely(f_string_empty_s, partial, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_in_dynamic_partial_safely__returns_data_not(void **state) { +void test__f_print_except_in_dynamic_partial_safely__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_partial_safely(f_string_empty_s, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } @@ -54,6 +57,7 @@ void test__f_print_except_in_dynamic_partial_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -63,7 +67,7 @@ void test__f_print_except_in_dynamic_partial_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, output); assert_int_equal(status, F_none); } @@ -80,7 +84,7 @@ void test__f_print_except_in_dynamic_partial_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_safely.h b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_safely.h index dd72238..a4de043 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_partial_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_except_in_dynamic_partial_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_in_dynamic_partial_safely() */ -extern void test__f_print_except_in_dynamic_partial_safely__parameter_checking(void **state); +extern void test__f_print_except_in_dynamic_partial_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_in_dynamic_partial_safely() */ -extern void test__f_print_except_in_dynamic_partial_safely__returns_data_not(void **state); +extern void test__f_print_except_in_dynamic_partial_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw.c b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw.c index 45b5e11..c3164bf 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw.c @@ -10,46 +10,50 @@ void test__f_print_except_in_dynamic_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_in_dynamic_raw__parameter_checking(void **state) { +void test__f_print_except_in_dynamic_raw__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, 0); + const f_status_t status = f_print_except_in_dynamic_raw(f_string_empty_s, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_in_dynamic_raw__returns_data_not(void **state) { +void test__f_print_except_in_dynamic_raw__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_raw(f_string_empty_s, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_except_in_dynamic_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -59,7 +63,7 @@ void test__f_print_except_in_dynamic_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, output); assert_int_equal(status, F_none); } @@ -76,7 +80,7 @@ void test__f_print_except_in_dynamic_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw.h b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw.h index f2a0615..a40a93d 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_except_in_dynamic_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_in_dynamic_raw() */ -extern void test__f_print_except_in_dynamic_raw__parameter_checking(void **state); +extern void test__f_print_except_in_dynamic_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_in_dynamic_raw() */ -extern void test__f_print_except_in_dynamic_raw__returns_data_not(void **state); +extern void test__f_print_except_in_dynamic_raw__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw_safely.c index 5355182..f894625 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw_safely.c @@ -10,46 +10,50 @@ void test__f_print_except_in_dynamic_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_in_dynamic_raw_safely__parameter_checking(void **state) { +void test__f_print_except_in_dynamic_raw_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, 0); + const f_status_t status = f_print_except_in_dynamic_raw_safely(f_string_empty_s, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_in_dynamic_raw_safely__returns_data_not(void **state) { +void test__f_print_except_in_dynamic_raw_safely__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_raw_safely(f_string_empty_s, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_except_in_dynamic_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -59,7 +63,7 @@ void test__f_print_except_in_dynamic_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, output); assert_int_equal(status, F_none); } @@ -76,7 +80,7 @@ void test__f_print_except_in_dynamic_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw_safely.h index c906c13..82bca43 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_except_in_dynamic_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_in_dynamic_raw_safely() */ -extern void test__f_print_except_in_dynamic_raw_safely__parameter_checking(void **state); +extern void test__f_print_except_in_dynamic_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_in_dynamic_raw_safely() */ -extern void test__f_print_except_in_dynamic_raw_safely__returns_data_not(void **state); +extern void test__f_print_except_in_dynamic_raw_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_safely.c b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_safely.c index a65c44e..c646559 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_safely.c @@ -10,46 +10,50 @@ void test__f_print_except_in_dynamic_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_in_dynamic_safely__parameter_checking(void **state) { +void test__f_print_except_in_dynamic_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, 0); + const f_status_t status = f_print_except_in_dynamic_safely(f_string_empty_s, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_except_in_dynamic_safely__returns_data_not(void **state) { +void test__f_print_except_in_dynamic_safely__returns_stream_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_dynamic_safely(f_string_empty_s, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_except_in_dynamic_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -59,7 +63,7 @@ void test__f_print_except_in_dynamic_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, output); assert_int_equal(status, F_none); } @@ -76,7 +80,7 @@ void test__f_print_except_in_dynamic_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, stdout); + const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_safely.h b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_safely.h index 901c413..8bda995 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-except_in_dynamic_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_except_in_dynamic_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_in_dynamic_safely() */ -extern void test__f_print_except_in_dynamic_safely__parameter_checking(void **state); +extern void test__f_print_except_in_dynamic_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_in_dynamic_safely() */ -extern void test__f_print_except_in_dynamic_safely__returns_data_not(void **state); +extern void test__f_print_except_in_dynamic_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_raw.c b/level_0/f_print/tests/unit/c/test-print-except_in_raw.c index 1377390..a26e8f1 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-except_in_raw.c @@ -10,59 +10,63 @@ void test__f_print_except_in_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_in_raw(test.string, 0, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_in_raw__parameter_checking(void **state) { +void test__f_print_except_in_raw__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_raw(test.string, 0, test.used, except, range, 0); + const f_status_t status = f_print_except_in_raw(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_except_in_raw__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; - const f_string_ranges_t range = f_string_ranges_t_initialize; { - const f_status_t status = f_print_except_in_raw(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw(test.string, 0, f_string_empty_s.used, except, range, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_except_in_raw(test.string, 0, f_string_empty_s.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw(0, 0, test.used, except, range, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_except_in_raw__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_raw(0, 0, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw(test.string, 0, test.used, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_except_in_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -72,7 +76,7 @@ void test__f_print_except_in_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_raw(test.string, 0, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -85,7 +89,7 @@ void test__f_print_except_in_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_raw(test.string, 2, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw(test.string, 2, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -102,7 +106,7 @@ void test__f_print_except_in_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_raw(test.string, 1, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw(test.string, 1, test.used, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_raw.h b/level_0/f_print/tests/unit/c/test-print-except_in_raw.h index 55bb9a3..662da40 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-except_in_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_except_in_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_in_raw() */ -extern void test__f_print_except_in_raw__parameter_checking(void **state); +extern void test__f_print_except_in_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_in_raw() */ -extern void test__f_print_except_in_raw__returns_data_not(void **state); +extern void test__f_print_except_in_raw__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-except_in_raw_safely.c index aab7b23..1ab9b97 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-except_in_raw_safely.c @@ -10,59 +10,63 @@ void test__f_print_except_in_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_in_raw_safely(test.string, 0, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw_safely(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_in_raw_safely__parameter_checking(void **state) { +void test__f_print_except_in_raw_safely__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_raw_safely(test.string, 0, test.used, except, range, 0); + const f_status_t status = f_print_except_in_raw_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_except_in_raw_safely__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; - const f_string_ranges_t range = f_string_ranges_t_initialize; { - const f_status_t status = f_print_except_in_raw_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw_safely(test.string, 0, f_string_empty_s.used, except, range, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_except_in_raw_safely(test.string, 0, f_string_empty_s.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw_safely(0, 0, test.used, except, range, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_except_in_raw_safely__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_raw_safely(0, 0, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw_safely(test.string, 0, test.used, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_except_in_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -72,7 +76,7 @@ void test__f_print_except_in_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_raw_safely(test.string, 0, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw_safely(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -85,7 +89,7 @@ void test__f_print_except_in_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_raw_safely(test.string, 2, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw_safely(test.string, 2, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -102,7 +106,7 @@ void test__f_print_except_in_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_raw_safely(test.string, 1, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_raw_safely(test.string, 1, test.used, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-except_in_raw_safely.h index 353e6e0..d18043b 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-except_in_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_except_in_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_in_raw_safely() */ -extern void test__f_print_except_in_raw_safely__parameter_checking(void **state); +extern void test__f_print_except_in_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_in_raw_safely() */ -extern void test__f_print_except_in_raw_safely__returns_data_not(void **state); +extern void test__f_print_except_in_raw_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_safely.c b/level_0/f_print/tests/unit/c/test-print-except_in_safely.c index 471747f..b55a635 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-except_in_safely.c @@ -10,59 +10,63 @@ void test__f_print_except_in_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_in_safely(test.string, 0, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_safely(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_in_safely__parameter_checking(void **state) { +void test__f_print_except_in_safely__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_safely(test.string, 0, test.used, except, range, 0); + const f_status_t status = f_print_except_in_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_except_in_safely__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; - const f_string_ranges_t range = f_string_ranges_t_initialize; { - const f_status_t status = f_print_except_in_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, stdout); + const f_status_t status = f_print_except_in_safely(test.string, 0, f_string_empty_s.used, except, range, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_except_in_safely(test.string, 0, f_string_empty_s.used, except, range, stdout); + const f_status_t status = f_print_except_in_safely(0, 0, test.used, except, range, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_except_in_safely__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_in_safely(0, 0, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_safely(test.string, 0, test.used, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_except_in_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -72,7 +76,7 @@ void test__f_print_except_in_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_safely(test.string, 0, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_safely(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -85,7 +89,7 @@ void test__f_print_except_in_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_safely(test.string, 2, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_safely(test.string, 2, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -102,7 +106,7 @@ void test__f_print_except_in_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_in_safely(test.string, 1, test.used, except, range, stdout); + const f_status_t status = f_print_except_in_safely(test.string, 1, test.used, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_in_safely.h b/level_0/f_print/tests/unit/c/test-print-except_in_safely.h index e317db0..54a823e 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_in_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-except_in_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_except_in_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_in_safely() */ -extern void test__f_print_except_in_safely__parameter_checking(void **state); +extern void test__f_print_except_in_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_in_safely() */ -extern void test__f_print_except_in_safely__returns_data_not(void **state); +extern void test__f_print_except_in_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_raw.c b/level_0/f_print/tests/unit/c/test-print-except_raw.c index c80edda..77cab6d 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-except_raw.c @@ -9,57 +9,61 @@ void test__f_print_except_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_raw(test.string, 0, test.used, except, stdout); + const f_status_t status = f_print_except_raw(test.string, 0, test.used, except, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_raw__parameter_checking(void **state) { +void test__f_print_except_raw__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_raw(test.string, 0, test.used, except, 0); + const f_status_t status = f_print_except_raw(f_string_empty_s.string, 0, f_string_empty_s.used, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_except_raw__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; { - const f_status_t status = f_print_except_raw(f_string_empty_s.string, 0, f_string_empty_s.used, except, stdout); + const f_status_t status = f_print_except_raw(test.string, 0, f_string_empty_s.used, except, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_except_raw(test.string, 0, f_string_empty_s.used, except, stdout); + const f_status_t status = f_print_except_raw(0, 0, test.used, except, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_except_raw__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_raw(0, 0, test.used, except, stdout); + const f_status_t status = f_print_except_raw(test.string, 0, test.used, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_except_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -68,7 +72,7 @@ void test__f_print_except_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_raw(test.string, 0, test.used, except, stdout); + const f_status_t status = f_print_except_raw(test.string, 0, test.used, except, output); assert_int_equal(status, F_none); } @@ -80,7 +84,7 @@ void test__f_print_except_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_raw(test.string, 2, test.used, except, stdout); + const f_status_t status = f_print_except_raw(test.string, 2, test.used, except, output); assert_int_equal(status, F_none); } @@ -93,7 +97,7 @@ void test__f_print_except_raw__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used - 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_raw(test.string, 1, test.used, except, stdout); + const f_status_t status = f_print_except_raw(test.string, 1, test.used, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_raw.h b/level_0/f_print/tests/unit/c/test-print-except_raw.h index 1255087..a10aca0 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-except_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_except_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_raw() */ -extern void test__f_print_except_raw__parameter_checking(void **state); +extern void test__f_print_except_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_raw() */ -extern void test__f_print_except_raw__returns_data_not(void **state); +extern void test__f_print_except_raw__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-except_raw_safely.c index a24ba69..b3682fc 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-except_raw_safely.c @@ -9,57 +9,61 @@ void test__f_print_except_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_raw_safely(test.string, 0, test.used, except, stdout); + const f_status_t status = f_print_except_raw_safely(test.string, 0, test.used, except, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_raw_safely__parameter_checking(void **state) { +void test__f_print_except_raw_safely__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_raw_safely(test.string, 0, test.used, except, 0); + const f_status_t status = f_print_except_raw_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_except_raw_safely__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; { - const f_status_t status = f_print_except_raw_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, stdout); + const f_status_t status = f_print_except_raw_safely(test.string, 0, f_string_empty_s.used, except, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_except_raw_safely(test.string, 0, f_string_empty_s.used, except, stdout); + const f_status_t status = f_print_except_raw_safely(0, 0, test.used, except, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_except_raw_safely__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_raw_safely(0, 0, test.used, except, stdout); + const f_status_t status = f_print_except_raw_safely(test.string, 0, test.used, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_except_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -68,7 +72,7 @@ void test__f_print_except_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_raw_safely(test.string, 0, test.used, except, stdout); + const f_status_t status = f_print_except_raw_safely(test.string, 0, test.used, except, output); assert_int_equal(status, F_none); } @@ -80,7 +84,7 @@ void test__f_print_except_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_raw_safely(test.string, 2, test.used, except, stdout); + const f_status_t status = f_print_except_raw_safely(test.string, 2, test.used, except, output); assert_int_equal(status, F_none); } @@ -93,7 +97,7 @@ void test__f_print_except_raw_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used - 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_raw_safely(test.string, 1, test.used, except, stdout); + const f_status_t status = f_print_except_raw_safely(test.string, 1, test.used, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-except_raw_safely.h index 419d898..d3d42c0 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-except_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_except_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_raw_safely() */ -extern void test__f_print_except_raw_safely__parameter_checking(void **state); +extern void test__f_print_except_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_raw_safely() */ -extern void test__f_print_except_raw_safely__returns_data_not(void **state); +extern void test__f_print_except_raw_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-except_safely.c b/level_0/f_print/tests/unit/c/test-print-except_safely.c index 2ebf78a..6059102 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-except_safely.c @@ -9,57 +9,61 @@ void test__f_print_except_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_except_safely(test.string, 0, test.used, except, stdout); + const f_status_t status = f_print_except_safely(test.string, 0, test.used, except, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_except_safely__parameter_checking(void **state) { +void test__f_print_except_safely__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_safely(test.string, 0, test.used, except, 0); + const f_status_t status = f_print_except_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_except_safely__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; { - const f_status_t status = f_print_except_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, stdout); + const f_status_t status = f_print_except_safely(test.string, 0, f_string_empty_s.used, except, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_except_safely(test.string, 0, f_string_empty_s.used, except, stdout); + const f_status_t status = f_print_except_safely(0, 0, test.used, except, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_except_safely__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_except_safely(0, 0, test.used, except, stdout); + const f_status_t status = f_print_except_safely(test.string, 0, test.used, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_except_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -68,7 +72,7 @@ void test__f_print_except_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_safely(test.string, 0, test.used, except, stdout); + const f_status_t status = f_print_except_safely(test.string, 0, test.used, except, output); assert_int_equal(status, F_none); } @@ -80,7 +84,7 @@ void test__f_print_except_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_safely(test.string, 2, test.used, except, stdout); + const f_status_t status = f_print_except_safely(test.string, 2, test.used, except, output); assert_int_equal(status, F_none); } @@ -93,7 +97,7 @@ void test__f_print_except_safely__works(void **state) { will_return(__wrap_fwrite_unlocked, test.used - 1); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_except_safely(test.string, 1, test.used, except, stdout); + const f_status_t status = f_print_except_safely(test.string, 1, test.used, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-except_safely.h b/level_0/f_print/tests/unit/c/test-print-except_safely.h index c618d64..807832e 100644 --- a/level_0/f_print/tests/unit/c/test-print-except_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-except_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_except_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_except_safely() */ -extern void test__f_print_except_safely__parameter_checking(void **state); +extern void test__f_print_except_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_except_safely() */ -extern void test__f_print_except_safely__returns_data_not(void **state); +extern void test__f_print_except_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-raw.c b/level_0/f_print/tests/unit/c/test-print-raw.c index 8baa97b..a317359 100644 --- a/level_0/f_print/tests/unit/c/test-print-raw.c +++ b/level_0/f_print/tests/unit/c/test-print-raw.c @@ -8,62 +8,66 @@ extern "C" { void test__f_print_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_raw(test.string, test.used, stdout); + const f_status_t status = f_print_raw(test.string, test.used, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_raw__parameter_checking(void **state) { +void test__f_print_raw__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_raw(test.string, test.used, 0); + const f_status_t status = f_print_raw(f_string_empty_s.string, f_string_empty_s.used, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_raw__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); { - const f_status_t status = f_print_raw(f_string_empty_s.string, f_string_empty_s.used, stdout); + const f_status_t status = f_print_raw(test.string, f_string_empty_s.used, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_raw(test.string, f_string_empty_s.used, stdout); + const f_status_t status = f_print_raw(0, test.used, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_raw__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_raw(0, test.used, stdout); + const f_status_t status = f_print_raw(test.string, test.used, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_raw(test.string, test.used, stdout); + const f_status_t status = f_print_raw(test.string, test.used, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-raw.h b/level_0/f_print/tests/unit/c/test-print-raw.h index 89fd04f..82a9834 100644 --- a/level_0/f_print/tests/unit/c/test-print-raw.h +++ b/level_0/f_print/tests/unit/c/test-print-raw.h @@ -18,18 +18,18 @@ extern void test__f_print_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_raw() */ -extern void test__f_print_raw__parameter_checking(void **state); +extern void test__f_print_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_raw() */ -extern void test__f_print_raw__returns_data_not(void **state); +extern void test__f_print_raw__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-raw_safely.c b/level_0/f_print/tests/unit/c/test-print-raw_safely.c index 5beb037..238e65f 100644 --- a/level_0/f_print/tests/unit/c/test-print-raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-raw_safely.c @@ -8,62 +8,66 @@ extern "C" { void test__f_print_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_raw_safely(test.string, test.used, stdout); + const f_status_t status = f_print_raw_safely(test.string, test.used, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_raw_safely__parameter_checking(void **state) { +void test__f_print_raw_safely__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_raw_safely(test.string, test.used, 0); + const f_status_t status = f_print_raw_safely(f_string_empty_s.string, f_string_empty_s.used, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_raw_safely__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); { - const f_status_t status = f_print_raw_safely(f_string_empty_s.string, f_string_empty_s.used, stdout); + const f_status_t status = f_print_raw_safely(test.string, f_string_empty_s.used, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_raw_safely(test.string, f_string_empty_s.used, stdout); + const f_status_t status = f_print_raw_safely(0, test.used, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_raw_safely__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_raw_safely(0, test.used, stdout); + const f_status_t status = f_print_raw_safely(test.string, test.used, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_raw_safely(test.string, test.used, stdout); + const f_status_t status = f_print_raw_safely(test.string, test.used, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-raw_safely.h b/level_0/f_print/tests/unit/c/test-print-raw_safely.h index 044e7ea..3d2721b 100644 --- a/level_0/f_print/tests/unit/c/test-print-raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_raw_safely() */ -extern void test__f_print_raw_safely__parameter_checking(void **state); +extern void test__f_print_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_raw_safely() */ -extern void test__f_print_raw_safely__returns_data_not(void **state); +extern void test__f_print_raw_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-raw_terminated.c b/level_0/f_print/tests/unit/c/test-print-raw_terminated.c index 270778b..ea36112 100644 --- a/level_0/f_print/tests/unit/c/test-print-raw_terminated.c +++ b/level_0/f_print/tests/unit/c/test-print-raw_terminated.c @@ -8,48 +8,53 @@ extern "C" { void test__f_print_raw_terminated__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_raw_terminated(test.string, stdout); + const f_status_t status = f_print_raw_terminated(test.string, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_raw_terminated__parameter_checking(void **state) { +void test__f_print_raw_terminated__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_raw_terminated(test.string, 0); + const f_status_t status = f_print_raw_terminated(0, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_raw_terminated__returns_data_not(void **state) { +void test__f_print_raw_terminated__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_raw_terminated(0, stdout); + const f_status_t status = f_print_raw_terminated(test.string, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_raw_terminated__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_raw_terminated(test.string, stdout); + const f_status_t status = f_print_raw_terminated(test.string, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-raw_terminated.h b/level_0/f_print/tests/unit/c/test-print-raw_terminated.h index 0ecee27..ee0b63d 100644 --- a/level_0/f_print/tests/unit/c/test-print-raw_terminated.h +++ b/level_0/f_print/tests/unit/c/test-print-raw_terminated.h @@ -18,18 +18,18 @@ extern void test__f_print_raw_terminated__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_raw_terminated() */ -extern void test__f_print_raw_terminated__parameter_checking(void **state); +extern void test__f_print_raw_terminated__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_raw_terminated() */ -extern void test__f_print_raw_terminated__returns_data_not(void **state); +extern void test__f_print_raw_terminated__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-safely.c b/level_0/f_print/tests/unit/c/test-print-safely.c index e88d94c..48bffb7 100644 --- a/level_0/f_print/tests/unit/c/test-print-safely.c +++ b/level_0/f_print/tests/unit/c/test-print-safely.c @@ -8,62 +8,66 @@ extern "C" { void test__f_print_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_safely(test.string, test.used, stdout); + const f_status_t status = f_print_safely(test.string, test.used, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_safely__parameter_checking(void **state) { +void test__f_print_safely__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_safely(test.string, test.used, 0); + const f_status_t status = f_print_safely(f_string_empty_s.string, f_string_empty_s.used, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_safely__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); { - const f_status_t status = f_print_safely(f_string_empty_s.string, f_string_empty_s.used, stdout); + const f_status_t status = f_print_safely(test.string, f_string_empty_s.used, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_safely(test.string, f_string_empty_s.used, stdout); + const f_status_t status = f_print_safely(0, test.used, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_safely__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_safely(0, test.used, stdout); + const f_status_t status = f_print_safely(test.string, test.used, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_safely(test.string, test.used, stdout); + const f_status_t status = f_print_safely(test.string, test.used, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-safely.h b/level_0/f_print/tests/unit/c/test-print-safely.h index f568e46..19b8abf 100644 --- a/level_0/f_print/tests/unit/c/test-print-safely.h +++ b/level_0/f_print/tests/unit/c/test-print-safely.h @@ -18,18 +18,18 @@ extern void test__f_print_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_safely() */ -extern void test__f_print_safely__parameter_checking(void **state); +extern void test__f_print_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_safely() */ -extern void test__f_print_safely__returns_data_not(void **state); +extern void test__f_print_safely__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-safely_terminated.c b/level_0/f_print/tests/unit/c/test-print-safely_terminated.c index 9468e55..8ed9df9 100644 --- a/level_0/f_print/tests/unit/c/test-print-safely_terminated.c +++ b/level_0/f_print/tests/unit/c/test-print-safely_terminated.c @@ -8,48 +8,53 @@ extern "C" { void test__f_print_safely_terminated__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_safely_terminated(test.string, stdout); + const f_status_t status = f_print_safely_terminated(test.string, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_safely_terminated__parameter_checking(void **state) { +void test__f_print_safely_terminated__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_safely_terminated(test.string, 0); + const f_status_t status = f_print_safely_terminated(0, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_safely_terminated__returns_data_not(void **state) { +void test__f_print_safely_terminated__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_safely_terminated(0, stdout); + const f_status_t status = f_print_safely_terminated(test.string, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_safely_terminated__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_safely_terminated(test.string, stdout); + const f_status_t status = f_print_safely_terminated(test.string, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-safely_terminated.h b/level_0/f_print/tests/unit/c/test-print-safely_terminated.h index 17bac19..ec288eb 100644 --- a/level_0/f_print/tests/unit/c/test-print-safely_terminated.h +++ b/level_0/f_print/tests/unit/c/test-print-safely_terminated.h @@ -18,18 +18,18 @@ extern void test__f_print_safely_terminated__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_safely_terminated() */ -extern void test__f_print_safely_terminated__parameter_checking(void **state); +extern void test__f_print_safely_terminated__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_safely_terminated() */ -extern void test__f_print_safely_terminated__returns_data_not(void **state); +extern void test__f_print_safely_terminated__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-terminated.c b/level_0/f_print/tests/unit/c/test-print-terminated.c index cd12c92..6fdf6ff 100644 --- a/level_0/f_print/tests/unit/c/test-print-terminated.c +++ b/level_0/f_print/tests/unit/c/test-print-terminated.c @@ -8,48 +8,53 @@ extern "C" { void test__f_print_terminated__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, true); will_return(__wrap_fwrite_unlocked, 0); will_return(__wrap_ferror_unlocked, true); - const f_status_t status = f_print_terminated(test.string, stdout); + const f_status_t status = f_print_terminated(test.string, output); assert_int_equal(status, F_status_set_error(F_output)); } } -void test__f_print_terminated__parameter_checking(void **state) { +void test__f_print_terminated__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_terminated(test.string, 0); + const f_status_t status = f_print_terminated(0, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_terminated__returns_data_not(void **state) { +void test__f_print_terminated__returns_stream_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_terminated(0, stdout); + const f_status_t status = f_print_terminated(test.string, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_stream_not); } } void test__f_print_terminated__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_fwrite_unlocked, false); will_return(__wrap_fwrite_unlocked, test.used); will_return(__wrap_ferror_unlocked, false); - const f_status_t status = f_print_terminated(test.string, stdout); + const f_status_t status = f_print_terminated(test.string, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-terminated.h b/level_0/f_print/tests/unit/c/test-print-terminated.h index 6a3f0e8..5d9291a 100644 --- a/level_0/f_print/tests/unit/c/test-print-terminated.h +++ b/level_0/f_print/tests/unit/c/test-print-terminated.h @@ -18,18 +18,18 @@ extern void test__f_print_terminated__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_terminated() */ -extern void test__f_print_terminated__parameter_checking(void **state); +extern void test__f_print_terminated__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_stream_not. * * @see f_print_terminated() */ -extern void test__f_print_terminated__returns_data_not(void **state); +extern void test__f_print_terminated__returns_stream_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to.c b/level_0/f_print/tests/unit/c/test-print-to.c index 40ba940..10b29dd 100644 --- a/level_0/f_print/tests/unit/c/test-print-to.c +++ b/level_0/f_print/tests/unit/c/test-print-to.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,55 +49,58 @@ void test__f_print_to__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to(test.string, test.used, 0); + const f_status_t status = f_print_to(test.string, test.used, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to__parameter_checking(void **state) { +void test__f_print_to__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to(test.string, test.used, -1); + const f_status_t status = f_print_to(f_string_empty_s.string, f_string_empty_s.used, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_to__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); { - const f_status_t status = f_print_to(f_string_empty_s.string, f_string_empty_s.used, 0); + const f_status_t status = f_print_to(test.string, f_string_empty_s.used, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_to(test.string, f_string_empty_s.used, 0); + const f_status_t status = f_print_to(0, test.used, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_to__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to(0, test.used, 0); + const f_status_t status = f_print_to(test.string, test.used, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to(test.string, test.used, 0); + const f_status_t status = f_print_to(test.string, test.used, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to.h b/level_0/f_print/tests/unit/c/test-print-to.h index 0a060b0..575a16a 100644 --- a/level_0/f_print/tests/unit/c/test-print-to.h +++ b/level_0/f_print/tests/unit/c/test-print-to.h @@ -18,18 +18,18 @@ extern void test__f_print_to__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to() */ -extern void test__f_print_to__parameter_checking(void **state); +extern void test__f_print_to__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to() */ -extern void test__f_print_to__returns_data_not(void **state); +extern void test__f_print_to__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_character.c b/level_0/f_print/tests/unit/c/test-print-to_character.c index 8c7082d..2a7cb30 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_character.c +++ b/level_0/f_print/tests/unit/c/test-print-to_character.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to_character__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,32 +49,34 @@ void test__f_print_to_character__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_character(test.string[0], 0); + const f_status_t status = f_print_to_character(test.string[0], output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_character__parameter_checking(void **state) { +void test__f_print_to_character__returns_file_descriptor_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_character(test.string[0], -1); + const f_status_t status = f_print_to_character(test.string[0], output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_character__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, 1); - const f_status_t status = f_print_to_character(test.string[0], 0); + const f_status_t status = f_print_to_character(test.string[0], output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_character.h b/level_0/f_print/tests/unit/c/test-print-to_character.h index 18022a1..eb77e78 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_character.h +++ b/level_0/f_print/tests/unit/c/test-print-to_character.h @@ -18,11 +18,11 @@ extern void test__f_print_to_character__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_character() */ -extern void test__f_print_to_character__parameter_checking(void **state); +extern void test__f_print_to_character__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_character_safely.c b/level_0/f_print/tests/unit/c/test-print-to_character_safely.c index 82c1bd2..4a37644 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_character_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_character_safely.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to_character_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,7 +49,7 @@ void test__f_print_to_character_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_character_safely(test.string[0], 0); + const f_status_t status = f_print_to_character_safely(test.string[0], output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for @@ -58,7 +59,7 @@ void test__f_print_to_character_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_character_safely((f_char_t) 0x7f, 0); + const f_status_t status = f_print_to_character_safely((f_char_t) 0x7f, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for @@ -68,7 +69,7 @@ void test__f_print_to_character_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_character_safely((f_char_t) F_utf_byte_1_d, 0); + const f_status_t status = f_print_to_character_safely((f_char_t) F_utf_byte_1_d, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for @@ -80,7 +81,7 @@ void test__f_print_to_character_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_character_safely(alternate.string[0], 0); + const f_status_t status = f_print_to_character_safely(alternate.string[0], output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for @@ -90,32 +91,34 @@ void test__f_print_to_character_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_character_safely(test.string[0], 0);; + const f_status_t status = f_print_to_character_safely(test.string[0], output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_character_safely__parameter_checking(void **state) { +void test__f_print_to_character_safely__returns_file_descriptor_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_character_safely(test.string[0], -1); + const f_status_t status = f_print_to_character_safely(test.string[0], output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_character_safely__returns_utf(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("蠇", 0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, 1); - const f_status_t status = f_print_to_character_safely(test.string[0], 0); + const f_status_t status = f_print_to_character_safely(test.string[0], output); assert_int_equal(status, F_utf); } @@ -124,12 +127,13 @@ void test__f_print_to_character_safely__returns_utf(void **state) { void test__f_print_to_character_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, f_print_sequence_delete_s.used); - const f_status_t status = f_print_to_character_safely((f_char_t) 0x7f, 0); + const f_status_t status = f_print_to_character_safely((f_char_t) 0x7f, output); assert_int_equal(status, F_none); } @@ -138,7 +142,7 @@ void test__f_print_to_character_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, f_print_sequence_unknown_s.used); - const f_status_t status = f_print_to_character_safely((f_char_t) F_utf_byte_1_d, 0); + const f_status_t status = f_print_to_character_safely((f_char_t) F_utf_byte_1_d, output); assert_int_equal(status, F_none); } @@ -147,7 +151,7 @@ void test__f_print_to_character_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, 1); - const f_status_t status = f_print_to_character_safely(test.string[0], 0); + const f_status_t status = f_print_to_character_safely(test.string[0], output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_character_safely.h b/level_0/f_print/tests/unit/c/test-print-to_character_safely.h index 28215c7..e81d43b 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_character_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_character_safely.h @@ -18,11 +18,11 @@ extern void test__f_print_to_character_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_character_safely() */ -extern void test__f_print_to_character_safely__parameter_checking(void **state); +extern void test__f_print_to_character_safely__returns_file_descriptor_not(void **state); /** * Test that function works but returns F_utf. diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic.c b/level_0/f_print/tests/unit/c/test-print-to_dynamic.c index ba7fb64..20a9528 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic.c +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to_dynamic__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,41 +49,45 @@ void test__f_print_to_dynamic__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_dynamic(test, 0); + const f_status_t status = f_print_to_dynamic(test, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_dynamic__parameter_checking(void **state) { +void test__f_print_to_dynamic__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic(test, -1); + const f_status_t status = f_print_to_dynamic(f_string_empty_s, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_dynamic__returns_data_not(void **state) { +void test__f_print_to_dynamic__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic(f_string_empty_s, 0); + const f_status_t status = f_print_to_dynamic(test, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_dynamic__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_dynamic(test, 0); + const f_status_t status = f_print_to_dynamic(test, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic.h b/level_0/f_print/tests/unit/c/test-print-to_dynamic.h index cdc80fa..f986072 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic.h +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic.h @@ -18,18 +18,18 @@ extern void test__f_print_to_dynamic__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_dynamic() */ -extern void test__f_print_to_dynamic__parameter_checking(void **state); +extern void test__f_print_to_dynamic__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_dynamic() */ -extern void test__f_print_to_dynamic__returns_data_not(void **state); +extern void test__f_print_to_dynamic__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial.c b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial.c index e836c75..fe0e635 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial.c +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial.c @@ -9,6 +9,7 @@ void test__f_print_to_dynamic_partial__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -49,32 +50,34 @@ void test__f_print_to_dynamic_partial__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_dynamic_partial(test, partial, 0); + const f_status_t status = f_print_to_dynamic_partial(test, partial, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_dynamic_partial__parameter_checking(void **state) { +void test__f_print_to_dynamic_partial__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_partial(test, partial, -1); + const f_status_t status = f_print_to_dynamic_partial(f_string_empty_s, partial, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_dynamic_partial__returns_data_not(void **state) { +void test__f_print_to_dynamic_partial__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_partial(f_string_empty_s, partial, 0); + const f_status_t status = f_print_to_dynamic_partial(test, partial, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } @@ -82,12 +85,13 @@ void test__f_print_to_dynamic_partial__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_dynamic_partial(test, partial, 0); + const f_status_t status = f_print_to_dynamic_partial(test, partial, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial.h b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial.h index 4cfbab9..e4f8938 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial.h +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial.h @@ -18,18 +18,18 @@ extern void test__f_print_to_dynamic_partial__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_dynamic_partial() */ -extern void test__f_print_to_dynamic_partial__parameter_checking(void **state); +extern void test__f_print_to_dynamic_partial__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_dynamic_partial() */ -extern void test__f_print_to_dynamic_partial__returns_data_not(void **state); +extern void test__f_print_to_dynamic_partial__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw.c b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw.c index 3f390ef..a42996d 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw.c @@ -9,6 +9,7 @@ void test__f_print_to_dynamic_partial_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -49,32 +50,34 @@ void test__f_print_to_dynamic_partial_raw__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_dynamic_partial_raw(test, partial, 0); + const f_status_t status = f_print_to_dynamic_partial_raw(test, partial, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_dynamic_partial_raw__parameter_checking(void **state) { +void test__f_print_to_dynamic_partial_raw__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_partial_raw(test, partial, -1); + const f_status_t status = f_print_to_dynamic_partial_raw(f_string_empty_s, partial, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_dynamic_partial_raw__returns_data_not(void **state) { +void test__f_print_to_dynamic_partial_raw__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_partial_raw(f_string_empty_s, partial, 0); + const f_status_t status = f_print_to_dynamic_partial_raw(test, partial, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } @@ -82,12 +85,13 @@ void test__f_print_to_dynamic_partial_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_dynamic_partial_raw(test, partial, 0); + const f_status_t status = f_print_to_dynamic_partial_raw(test, partial, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw.h b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw.h index 294bdc0..257f909 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_to_dynamic_partial_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_dynamic_partial_raw() */ -extern void test__f_print_to_dynamic_partial_raw__parameter_checking(void **state); +extern void test__f_print_to_dynamic_partial_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_dynamic_partial_raw() */ -extern void test__f_print_to_dynamic_partial_raw__returns_data_not(void **state); +extern void test__f_print_to_dynamic_partial_raw__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw_safely.c index 110a74f..7c61e9a 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw_safely.c @@ -9,6 +9,7 @@ void test__f_print_to_dynamic_partial_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -49,32 +50,34 @@ void test__f_print_to_dynamic_partial_raw_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_dynamic_partial_raw_safely(test, partial, 0); + const f_status_t status = f_print_to_dynamic_partial_raw_safely(test, partial, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_dynamic_partial_raw_safely__parameter_checking(void **state) { +void test__f_print_to_dynamic_partial_raw_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_partial_raw_safely(test, partial, -1); + const f_status_t status = f_print_to_dynamic_partial_raw_safely(f_string_empty_s, partial, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_dynamic_partial_raw_safely__returns_data_not(void **state) { +void test__f_print_to_dynamic_partial_raw_safely__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_partial_raw_safely(f_string_empty_s, partial, 0); + const f_status_t status = f_print_to_dynamic_partial_raw_safely(test, partial, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } @@ -82,12 +85,13 @@ void test__f_print_to_dynamic_partial_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_dynamic_partial_raw_safely(test, partial, 0); + const f_status_t status = f_print_to_dynamic_partial_raw_safely(test, partial, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw_safely.h index ea27654..0b1a530 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_dynamic_partial_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_dynamic_partial_raw_safely() */ -extern void test__f_print_to_dynamic_partial_raw_safely__parameter_checking(void **state); +extern void test__f_print_to_dynamic_partial_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_dynamic_partial_raw_safely() */ -extern void test__f_print_to_dynamic_partial_raw_safely__returns_data_not(void **state); +extern void test__f_print_to_dynamic_partial_raw_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_safely.c b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_safely.c index dff9644..a5d61dc 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_safely.c @@ -9,6 +9,7 @@ void test__f_print_to_dynamic_partial_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -49,32 +50,34 @@ void test__f_print_to_dynamic_partial_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_dynamic_partial_safely(test, partial, 0); + const f_status_t status = f_print_to_dynamic_partial_safely(test, partial, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_dynamic_partial_safely__parameter_checking(void **state) { +void test__f_print_to_dynamic_partial_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_partial_safely(test, partial, -1); + const f_status_t status = f_print_to_dynamic_partial_safely(f_string_empty_s, partial, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_dynamic_partial_safely__returns_data_not(void **state) { +void test__f_print_to_dynamic_partial_safely__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_partial_safely(f_string_empty_s, partial, 0); + const f_status_t status = f_print_to_dynamic_partial_safely(test, partial, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } @@ -82,12 +85,13 @@ void test__f_print_to_dynamic_partial_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_dynamic_partial_safely(test, partial, 0); + const f_status_t status = f_print_to_dynamic_partial_safely(test, partial, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_safely.h b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_safely.h index 7ea36f2..55b29e0 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_partial_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_dynamic_partial_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_dynamic_partial_safely() */ -extern void test__f_print_to_dynamic_partial_safely__parameter_checking(void **state); +extern void test__f_print_to_dynamic_partial_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_dynamic_partial_safely() */ -extern void test__f_print_to_dynamic_partial_safely__returns_data_not(void **state); +extern void test__f_print_to_dynamic_partial_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw.c b/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw.c index be73c4b..dc8e91a 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to_dynamic_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,41 +49,45 @@ void test__f_print_to_dynamic_raw__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_dynamic_raw(test, 0); + const f_status_t status = f_print_to_dynamic_raw(test, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_dynamic_raw__parameter_checking(void **state) { +void test__f_print_to_dynamic_raw__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_raw(test, -1); + const f_status_t status = f_print_to_dynamic_raw(f_string_empty_s, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_dynamic_raw__returns_data_not(void **state) { +void test__f_print_to_dynamic_raw__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_raw(f_string_empty_s, 0); + const f_status_t status = f_print_to_dynamic_raw(test, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_dynamic_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_dynamic_raw(test, 0); + const f_status_t status = f_print_to_dynamic_raw(test, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw.h b/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw.h index 85768aa..8228907 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_to_dynamic_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_dynamic_raw() */ -extern void test__f_print_to_dynamic_raw__parameter_checking(void **state); +extern void test__f_print_to_dynamic_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_dynamic_raw() */ -extern void test__f_print_to_dynamic_raw__returns_data_not(void **state); +extern void test__f_print_to_dynamic_raw__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw_safely.c index 382c59d..844725c 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw_safely.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to_dynamic_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,41 +49,45 @@ void test__f_print_to_dynamic_raw_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_dynamic_raw_safely(test, 0); + const f_status_t status = f_print_to_dynamic_raw_safely(test, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_dynamic_raw_safely__parameter_checking(void **state) { +void test__f_print_to_dynamic_raw_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_raw_safely(test, -1); + const f_status_t status = f_print_to_dynamic_raw_safely(f_string_empty_s, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_dynamic_raw_safely__returns_data_not(void **state) { +void test__f_print_to_dynamic_raw_safely__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_raw_safely(f_string_empty_s, 0); + const f_status_t status = f_print_to_dynamic_raw_safely(test, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_dynamic_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_dynamic_raw_safely(test, 0); + const f_status_t status = f_print_to_dynamic_raw_safely(test, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw_safely.h index dc33244..6c6d2ff 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_dynamic_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_dynamic_raw_safely() */ -extern void test__f_print_to_dynamic_raw_safely__parameter_checking(void **state); +extern void test__f_print_to_dynamic_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_dynamic_raw_safely() */ -extern void test__f_print_to_dynamic_raw_safely__returns_data_not(void **state); +extern void test__f_print_to_dynamic_raw_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_safely.c b/level_0/f_print/tests/unit/c/test-print-to_dynamic_safely.c index f959884..3aa0b1e 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_safely.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to_dynamic_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,41 +49,45 @@ void test__f_print_to_dynamic_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_dynamic_safely(test, 0); + const f_status_t status = f_print_to_dynamic_safely(test, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_dynamic_safely__parameter_checking(void **state) { +void test__f_print_to_dynamic_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_safely(test, -1); + const f_status_t status = f_print_to_dynamic_safely(f_string_empty_s, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_dynamic_safely__returns_data_not(void **state) { +void test__f_print_to_dynamic_safely__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_dynamic_safely(f_string_empty_s, 0); + const f_status_t status = f_print_to_dynamic_safely(test, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_dynamic_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_dynamic_safely(test, 0); + const f_status_t status = f_print_to_dynamic_safely(test, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_dynamic_safely.h b/level_0/f_print/tests/unit/c/test-print-to_dynamic_safely.h index c33d943..aadc182 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_dynamic_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_dynamic_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_dynamic_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_dynamic_safely() */ -extern void test__f_print_to_dynamic_safely__parameter_checking(void **state); +extern void test__f_print_to_dynamic_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_dynamic_safely() */ -extern void test__f_print_to_dynamic_safely__returns_data_not(void **state); +extern void test__f_print_to_dynamic_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except.c b/level_0/f_print/tests/unit/c/test-print-to_except.c index 3996c74..9db50f1 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except.c @@ -9,6 +9,7 @@ void test__f_print_to_except__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -49,51 +50,54 @@ void test__f_print_to_except__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except(test.string, 0, test.used, except, 0); + const f_status_t status = f_print_to_except(test.string, 0, test.used, except, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except__parameter_checking(void **state) { +void test__f_print_to_except__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except(test.string, 0, test.used, except, -1); + const f_status_t status = f_print_to_except(f_string_empty_s.string, 0, f_string_empty_s.used, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_to_except__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; { - const f_status_t status = f_print_to_except(f_string_empty_s.string, 0, f_string_empty_s.used, except, 0); + const f_status_t status = f_print_to_except(test.string, 0, f_string_empty_s.used, except, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_to_except(test.string, 0, f_string_empty_s.used, except, 0); + const f_status_t status = f_print_to_except(0, 0, test.used, except, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_to_except__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except(0, 0, test.used, except, 0); + const f_status_t status = f_print_to_except(test.string, 0, test.used, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -101,7 +105,7 @@ void test__f_print_to_except__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except(test.string, 0, test.used, except, 0); + const f_status_t status = f_print_to_except(test.string, 0, test.used, except, output); assert_int_equal(status, F_none); } @@ -112,7 +116,7 @@ void test__f_print_to_except__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except(test.string, 2, test.used, except, 0); + const f_status_t status = f_print_to_except(test.string, 2, test.used, except, output); assert_int_equal(status, F_none); } @@ -124,7 +128,7 @@ void test__f_print_to_except__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except(test.string, 1, test.used, except, 0); + const f_status_t status = f_print_to_except(test.string, 1, test.used, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except.h b/level_0/f_print/tests/unit/c/test-print-to_except.h index aa383af..a4a1400 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except() */ -extern void test__f_print_to_except__parameter_checking(void **state); +extern void test__f_print_to_except__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except() */ -extern void test__f_print_to_except__returns_data_not(void **state); +extern void test__f_print_to_except__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic.c b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic.c index 543a0f4..6072769 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic.c @@ -9,6 +9,7 @@ void test__f_print_to_except_dynamic__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -49,38 +50,41 @@ void test__f_print_to_except_dynamic__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_dynamic(test, except, 0); + const f_status_t status = f_print_to_except_dynamic(test, except, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_dynamic__parameter_checking(void **state) { +void test__f_print_to_except_dynamic__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic(test, except, -1); + const f_status_t status = f_print_to_except_dynamic(f_string_empty_s, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_dynamic__returns_data_not(void **state) { +void test__f_print_to_except_dynamic__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic(f_string_empty_s, except, 0); + const f_status_t status = f_print_to_except_dynamic(test, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_dynamic__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -88,7 +92,7 @@ void test__f_print_to_except_dynamic__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic(test, except, 0); + const f_status_t status = f_print_to_except_dynamic(test, except, output); assert_int_equal(status, F_none); } @@ -100,7 +104,7 @@ void test__f_print_to_except_dynamic__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic(test, except, 0); + const f_status_t status = f_print_to_except_dynamic(test, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic.h b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic.h index 37e7874..0be8b1f 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_dynamic__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_dynamic() */ -extern void test__f_print_to_except_dynamic__parameter_checking(void **state); +extern void test__f_print_to_except_dynamic__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_dynamic() */ -extern void test__f_print_to_except_dynamic__returns_data_not(void **state); +extern void test__f_print_to_except_dynamic__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial.c b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial.c index b4e3dab..735655f 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial.c @@ -10,6 +10,7 @@ void test__f_print_to_except_dynamic_partial__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -50,34 +51,36 @@ void test__f_print_to_except_dynamic_partial__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_dynamic_partial(test, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial(test, partial, except, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_dynamic_partial__parameter_checking(void **state) { +void test__f_print_to_except_dynamic_partial__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_partial(test, partial, except, -1); + const f_status_t status = f_print_to_except_dynamic_partial(f_string_empty_s, partial, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_dynamic_partial__returns_data_not(void **state) { +void test__f_print_to_except_dynamic_partial__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_partial(f_string_empty_s, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial(test, partial, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } @@ -85,6 +88,7 @@ void test__f_print_to_except_dynamic_partial__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -92,7 +96,7 @@ void test__f_print_to_except_dynamic_partial__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_partial(test, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial(test, partial, except, output); assert_int_equal(status, F_none); } @@ -104,7 +108,7 @@ void test__f_print_to_except_dynamic_partial__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_partial(test, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial(test, partial, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial.h b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial.h index 1cc1046..7f6b600 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_dynamic_partial__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_dynamic_partial() */ -extern void test__f_print_to_except_dynamic_partial__parameter_checking(void **state); +extern void test__f_print_to_except_dynamic_partial__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_dynamic_partial() */ -extern void test__f_print_to_except_dynamic_partial__returns_data_not(void **state); +extern void test__f_print_to_except_dynamic_partial__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw.c b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw.c index aab0200..6d678c8 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw.c @@ -10,6 +10,7 @@ void test__f_print_to_except_dynamic_partial_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -50,34 +51,36 @@ void test__f_print_to_except_dynamic_partial_raw__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_dynamic_partial_raw(test, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial_raw(test, partial, except, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_dynamic_partial_raw__parameter_checking(void **state) { +void test__f_print_to_except_dynamic_partial_raw__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_partial_raw(test, partial, except, -1); + const f_status_t status = f_print_to_except_dynamic_partial_raw(f_string_empty_s, partial, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_dynamic_partial_raw__returns_data_not(void **state) { +void test__f_print_to_except_dynamic_partial_raw__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_partial_raw(f_string_empty_s, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial_raw(test, partial, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } @@ -85,6 +88,7 @@ void test__f_print_to_except_dynamic_partial_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -92,7 +96,7 @@ void test__f_print_to_except_dynamic_partial_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_partial_raw(test, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial_raw(test, partial, except, output); assert_int_equal(status, F_none); } @@ -104,7 +108,7 @@ void test__f_print_to_except_dynamic_partial_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_partial_raw(test, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial_raw(test, partial, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw.h b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw.h index 40bf35e..735c6a7 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_dynamic_partial_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_dynamic_partial_raw() */ -extern void test__f_print_to_except_dynamic_partial_raw__parameter_checking(void **state); +extern void test__f_print_to_except_dynamic_partial_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_dynamic_partial_raw() */ -extern void test__f_print_to_except_dynamic_partial_raw__returns_data_not(void **state); +extern void test__f_print_to_except_dynamic_partial_raw__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw_safely.c index d5a345d..0d340c5 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw_safely.c @@ -10,6 +10,7 @@ void test__f_print_to_except_dynamic_partial_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -50,34 +51,36 @@ void test__f_print_to_except_dynamic_partial_raw_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_dynamic_partial_raw_safely(test, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial_raw_safely(test, partial, except, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_dynamic_partial_raw_safely__parameter_checking(void **state) { +void test__f_print_to_except_dynamic_partial_raw_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_partial_raw_safely(test, partial, except, -1); + const f_status_t status = f_print_to_except_dynamic_partial_raw_safely(f_string_empty_s, partial, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_dynamic_partial_raw_safely__returns_data_not(void **state) { +void test__f_print_to_except_dynamic_partial_raw_safely__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_partial_raw_safely(f_string_empty_s, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial_raw_safely(test, partial, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } @@ -85,6 +88,7 @@ void test__f_print_to_except_dynamic_partial_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -92,7 +96,7 @@ void test__f_print_to_except_dynamic_partial_raw_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_partial_raw_safely(test, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial_raw_safely(test, partial, except, output); assert_int_equal(status, F_none); } @@ -104,7 +108,7 @@ void test__f_print_to_except_dynamic_partial_raw_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_partial_raw_safely(test, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial_raw_safely(test, partial, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw_safely.h index c26ac0c..be21f79 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_dynamic_partial_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_dynamic_partial_raw_safely() */ -extern void test__f_print_to_except_dynamic_partial_raw_safely__parameter_checking(void **state); +extern void test__f_print_to_except_dynamic_partial_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_dynamic_partial_raw_safely() */ -extern void test__f_print_to_except_dynamic_partial_raw_safely__returns_data_not(void **state); +extern void test__f_print_to_except_dynamic_partial_raw_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_safely.c b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_safely.c index 3183fd0..34502b0 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_safely.c @@ -10,6 +10,7 @@ void test__f_print_to_except_dynamic_partial_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -50,34 +51,36 @@ void test__f_print_to_except_dynamic_partial_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_dynamic_partial_safely(test, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial_safely(test, partial, except, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_dynamic_partial_safely__parameter_checking(void **state) { +void test__f_print_to_except_dynamic_partial_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_partial_safely(test, partial, except, -1); + const f_status_t status = f_print_to_except_dynamic_partial_safely(f_string_empty_s, partial, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_dynamic_partial_safely__returns_data_not(void **state) { +void test__f_print_to_except_dynamic_partial_safely__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_partial_safely(f_string_empty_s, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial_safely(test, partial, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } @@ -85,6 +88,7 @@ void test__f_print_to_except_dynamic_partial_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -92,7 +96,7 @@ void test__f_print_to_except_dynamic_partial_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_partial_safely(test, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial_safely(test, partial, except, output); assert_int_equal(status, F_none); } @@ -104,7 +108,7 @@ void test__f_print_to_except_dynamic_partial_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_partial_safely(test, partial, except, 0); + const f_status_t status = f_print_to_except_dynamic_partial_safely(test, partial, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_safely.h b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_safely.h index 70eb966..6a0e8d6 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_partial_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_dynamic_partial_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_dynamic_partial_safely() */ -extern void test__f_print_to_except_dynamic_partial_safely__parameter_checking(void **state); +extern void test__f_print_to_except_dynamic_partial_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_dynamic_partial_safely() */ -extern void test__f_print_to_except_dynamic_partial_safely__returns_data_not(void **state); +extern void test__f_print_to_except_dynamic_partial_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw.c b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw.c index 74bb56f..76205c9 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw.c @@ -9,6 +9,7 @@ void test__f_print_to_except_dynamic_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -49,38 +50,41 @@ void test__f_print_to_except_dynamic_raw__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_dynamic_raw(test, except, 0); + const f_status_t status = f_print_to_except_dynamic_raw(test, except, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_dynamic_raw__parameter_checking(void **state) { +void test__f_print_to_except_dynamic_raw__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_raw(test, except, -1); + const f_status_t status = f_print_to_except_dynamic_raw(f_string_empty_s, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_dynamic_raw__returns_data_not(void **state) { +void test__f_print_to_except_dynamic_raw__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_raw(f_string_empty_s, except, 0); + const f_status_t status = f_print_to_except_dynamic_raw(test, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_dynamic_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -88,7 +92,7 @@ void test__f_print_to_except_dynamic_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_raw(test, except, 0); + const f_status_t status = f_print_to_except_dynamic_raw(test, except, output); assert_int_equal(status, F_none); } @@ -100,7 +104,7 @@ void test__f_print_to_except_dynamic_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_raw(test, except, 0); + const f_status_t status = f_print_to_except_dynamic_raw(test, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw.h b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw.h index f166f04..9d9aaf1 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_dynamic_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_dynamic_raw() */ -extern void test__f_print_to_except_dynamic_raw__parameter_checking(void **state); +extern void test__f_print_to_except_dynamic_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_dynamic_raw() */ -extern void test__f_print_to_except_dynamic_raw__returns_data_not(void **state); +extern void test__f_print_to_except_dynamic_raw__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw_safely.c index 0d1cd96..759272e 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw_safely.c @@ -9,6 +9,7 @@ void test__f_print_to_except_dynamic_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -49,38 +50,41 @@ void test__f_print_to_except_dynamic_raw_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_dynamic_raw_safely(test, except, 0); + const f_status_t status = f_print_to_except_dynamic_raw_safely(test, except, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_dynamic_raw_safely__parameter_checking(void **state) { +void test__f_print_to_except_dynamic_raw_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_raw_safely(test, except, -1); + const f_status_t status = f_print_to_except_dynamic_raw_safely(f_string_empty_s, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_dynamic_raw_safely__returns_data_not(void **state) { +void test__f_print_to_except_dynamic_raw_safely__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_raw_safely(f_string_empty_s, except, 0); + const f_status_t status = f_print_to_except_dynamic_raw_safely(test, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_dynamic_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -88,7 +92,7 @@ void test__f_print_to_except_dynamic_raw_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_raw_safely(test, except, 0); + const f_status_t status = f_print_to_except_dynamic_raw_safely(test, except, output); assert_int_equal(status, F_none); } @@ -100,7 +104,7 @@ void test__f_print_to_except_dynamic_raw_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_raw_safely(test, except, 0); + const f_status_t status = f_print_to_except_dynamic_raw_safely(test, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw_safely.h index 7e43069..ba30483 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_dynamic_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_dynamic_raw_safely() */ -extern void test__f_print_to_except_dynamic_raw_safely__parameter_checking(void **state); +extern void test__f_print_to_except_dynamic_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_dynamic_raw_safely() */ -extern void test__f_print_to_except_dynamic_raw_safely__returns_data_not(void **state); +extern void test__f_print_to_except_dynamic_raw_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_safely.c b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_safely.c index 963cdfa..0ceb48f 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_safely.c @@ -9,6 +9,7 @@ void test__f_print_to_except_dynamic_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -49,38 +50,41 @@ void test__f_print_to_except_dynamic_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_dynamic_safely(test, except, 0); + const f_status_t status = f_print_to_except_dynamic_safely(test, except, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_dynamic_safely__parameter_checking(void **state) { +void test__f_print_to_except_dynamic_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_safely(test, except, -1); + const f_status_t status = f_print_to_except_dynamic_safely(f_string_empty_s, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_dynamic_safely__returns_data_not(void **state) { +void test__f_print_to_except_dynamic_safely__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_dynamic_safely(f_string_empty_s, except, 0); + const f_status_t status = f_print_to_except_dynamic_safely(test, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_dynamic_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -88,7 +92,7 @@ void test__f_print_to_except_dynamic_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_safely(test, except, 0); + const f_status_t status = f_print_to_except_dynamic_safely(test, except, output); assert_int_equal(status, F_none); } @@ -100,7 +104,7 @@ void test__f_print_to_except_dynamic_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_dynamic_safely(test, except, 0); + const f_status_t status = f_print_to_except_dynamic_safely(test, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_safely.h b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_safely.h index 099f54d..7de42b8 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_dynamic_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_dynamic_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_dynamic_safely() */ -extern void test__f_print_to_except_dynamic_safely__parameter_checking(void **state); +extern void test__f_print_to_except_dynamic_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_dynamic_safely() */ -extern void test__f_print_to_except_dynamic_safely__returns_data_not(void **state); +extern void test__f_print_to_except_dynamic_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in.c b/level_0/f_print/tests/unit/c/test-print-to_except_in.c index 8d317ac..a04975d 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in.c @@ -10,6 +10,7 @@ void test__f_print_to_except_in__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -50,53 +51,56 @@ void test__f_print_to_except_in__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_in(test.string, 0, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_in__parameter_checking(void **state) { +void test__f_print_to_except_in__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in(test.string, 0, test.used, except, range, -1); + const f_status_t status = f_print_to_except_in(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_to_except_in__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; - const f_string_ranges_t range = f_string_ranges_t_initialize; { - const f_status_t status = f_print_to_except_in(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, 0); + const f_status_t status = f_print_to_except_in(test.string, 0, f_string_empty_s.used, except, range, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_to_except_in(test.string, 0, f_string_empty_s.used, except, range, 0); + const f_status_t status = f_print_to_except_in(0, 0, test.used, except, range, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_to_except_in__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in(0, 0, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in(test.string, 0, test.used, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_in__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -105,7 +109,7 @@ void test__f_print_to_except_in__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in(test.string, 0, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -117,7 +121,7 @@ void test__f_print_to_except_in__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in(test.string, 2, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in(test.string, 2, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -133,7 +137,7 @@ void test__f_print_to_except_in__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in(test.string, 1, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in(test.string, 1, test.used, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in.h b/level_0/f_print/tests/unit/c/test-print-to_except_in.h index ecd13ed..ec6531c 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_in__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_in() */ -extern void test__f_print_to_except_in__parameter_checking(void **state); +extern void test__f_print_to_except_in__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_in() */ -extern void test__f_print_to_except_in__returns_data_not(void **state); +extern void test__f_print_to_except_in__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic.c b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic.c index c4e6675..c472fbb 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic.c @@ -10,6 +10,7 @@ void test__f_print_to_except_in_dynamic__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -50,40 +51,43 @@ void test__f_print_to_except_in_dynamic__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_in_dynamic(test, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic(test, except, range, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_in_dynamic__parameter_checking(void **state) { +void test__f_print_to_except_in_dynamic__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic(test, except, range, -1); + const f_status_t status = f_print_to_except_in_dynamic(f_string_empty_s, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_in_dynamic__returns_data_not(void **state) { +void test__f_print_to_except_in_dynamic__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic(f_string_empty_s, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic(test, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_in_dynamic__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -92,7 +96,7 @@ void test__f_print_to_except_in_dynamic__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic(test, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic(test, except, range, output); assert_int_equal(status, F_none); } @@ -108,7 +112,7 @@ void test__f_print_to_except_in_dynamic__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic(test, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic(test, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic.h b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic.h index b9efa65..36d9e08 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_in_dynamic__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_in_dynamic() */ -extern void test__f_print_to_except_in_dynamic__parameter_checking(void **state); +extern void test__f_print_to_except_in_dynamic__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_in_dynamic() */ -extern void test__f_print_to_except_in_dynamic__returns_data_not(void **state); +extern void test__f_print_to_except_in_dynamic__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial.c b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial.c index f2e3a47..cfede54 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial.c @@ -11,6 +11,7 @@ void test__f_print_to_except_in_dynamic_partial__fails(void **state) { const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -51,36 +52,38 @@ void test__f_print_to_except_in_dynamic_partial__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_in_dynamic_partial(test, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial(test, partial, except, range, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_in_dynamic_partial__parameter_checking(void **state) { +void test__f_print_to_except_in_dynamic_partial__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_partial(test, partial, except, range, -1); + const f_status_t status = f_print_to_except_in_dynamic_partial(f_string_empty_s, partial, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_in_dynamic_partial__returns_data_not(void **state) { +void test__f_print_to_except_in_dynamic_partial__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_partial(f_string_empty_s, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial(test, partial, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } @@ -88,6 +91,7 @@ void test__f_print_to_except_in_dynamic_partial__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -96,7 +100,7 @@ void test__f_print_to_except_in_dynamic_partial__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_partial(test, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial(test, partial, except, range, output); assert_int_equal(status, F_none); } @@ -112,7 +116,7 @@ void test__f_print_to_except_in_dynamic_partial__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_partial(test, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial(test, partial, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial.h b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial.h index da9a5b8..a7d9405 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_in_dynamic_partial__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_in_dynamic_partial() */ -extern void test__f_print_to_except_in_dynamic_partial__parameter_checking(void **state); +extern void test__f_print_to_except_in_dynamic_partial__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_in_dynamic_partial() */ -extern void test__f_print_to_except_in_dynamic_partial__returns_data_not(void **state); +extern void test__f_print_to_except_in_dynamic_partial__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw.c b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw.c index c39a8d8..5a623a7 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw.c @@ -11,6 +11,7 @@ void test__f_print_to_except_in_dynamic_partial_raw__fails(void **state) { const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -51,36 +52,38 @@ void test__f_print_to_except_in_dynamic_partial_raw__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_in_dynamic_partial_raw(test, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial_raw(test, partial, except, range, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_in_dynamic_partial_raw__parameter_checking(void **state) { +void test__f_print_to_except_in_dynamic_partial_raw__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_partial_raw(test, partial, except, range, -1); + const f_status_t status = f_print_to_except_in_dynamic_partial_raw(f_string_empty_s, partial, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_in_dynamic_partial_raw__returns_data_not(void **state) { +void test__f_print_to_except_in_dynamic_partial_raw__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_partial_raw(f_string_empty_s, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial_raw(test, partial, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } @@ -88,6 +91,7 @@ void test__f_print_to_except_in_dynamic_partial_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -96,7 +100,7 @@ void test__f_print_to_except_in_dynamic_partial_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_partial_raw(test, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial_raw(test, partial, except, range, output); assert_int_equal(status, F_none); } @@ -112,7 +116,7 @@ void test__f_print_to_except_in_dynamic_partial_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_partial_raw(test, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial_raw(test, partial, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw.h b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw.h index 8627967..6c4aacd 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_in_dynamic_partial_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_in_dynamic_partial_raw() */ -extern void test__f_print_to_except_in_dynamic_partial_raw__parameter_checking(void **state); +extern void test__f_print_to_except_in_dynamic_partial_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_in_dynamic_partial_raw() */ -extern void test__f_print_to_except_in_dynamic_partial_raw__returns_data_not(void **state); +extern void test__f_print_to_except_in_dynamic_partial_raw__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw_safely.c index 9d7e2ce..60e1fdb 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw_safely.c @@ -11,6 +11,7 @@ void test__f_print_to_except_in_dynamic_partial_raw_safely__fails(void **state) const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -51,36 +52,38 @@ void test__f_print_to_except_in_dynamic_partial_raw_safely__fails(void **state) will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_in_dynamic_partial_raw_safely(test, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial_raw_safely(test, partial, except, range, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_in_dynamic_partial_raw_safely__parameter_checking(void **state) { +void test__f_print_to_except_in_dynamic_partial_raw_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_partial_raw_safely(test, partial, except, range, -1); + const f_status_t status = f_print_to_except_in_dynamic_partial_raw_safely(f_string_empty_s, partial, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_in_dynamic_partial_raw_safely__returns_data_not(void **state) { +void test__f_print_to_except_in_dynamic_partial_raw_safely__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_partial_raw_safely(f_string_empty_s, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial_raw_safely(test, partial, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } @@ -88,6 +91,7 @@ void test__f_print_to_except_in_dynamic_partial_raw_safely__works(void **state) const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -96,7 +100,7 @@ void test__f_print_to_except_in_dynamic_partial_raw_safely__works(void **state) will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_partial_raw_safely(test, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial_raw_safely(test, partial, except, range, output); assert_int_equal(status, F_none); } @@ -108,11 +112,12 @@ void test__f_print_to_except_in_dynamic_partial_raw_safely__works(void **state) }; const f_array_lengths_t except = macro_f_array_lengths_t_initialize_1(lengths, 0, 1); const f_string_ranges_t range = macro_f_string_ranges_t_initialize_1(ranges, 0, 1); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_partial_raw_safely(test, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial_raw_safely(test, partial, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw_safely.h index 108a9b6..c78acfa 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_in_dynamic_partial_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_in_dynamic_partial_raw_safely() */ -extern void test__f_print_to_except_in_dynamic_partial_raw_safely__parameter_checking(void **state); +extern void test__f_print_to_except_in_dynamic_partial_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_in_dynamic_partial_raw_safely() */ -extern void test__f_print_to_except_in_dynamic_partial_raw_safely__returns_data_not(void **state); +extern void test__f_print_to_except_in_dynamic_partial_raw_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_safely.c b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_safely.c index b8dcb6b..965db9e 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_safely.c @@ -11,6 +11,7 @@ void test__f_print_to_except_in_dynamic_partial_safely__fails(void **state) { const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -51,36 +52,38 @@ void test__f_print_to_except_in_dynamic_partial_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_in_dynamic_partial_safely(test, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial_safely(test, partial, except, range, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_in_dynamic_partial_safely__parameter_checking(void **state) { +void test__f_print_to_except_in_dynamic_partial_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_partial_safely(test, partial, except, range, -1); + const f_status_t status = f_print_to_except_in_dynamic_partial_safely(f_string_empty_s, partial, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_in_dynamic_partial_safely__returns_data_not(void **state) { +void test__f_print_to_except_in_dynamic_partial_safely__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_partial_safely(f_string_empty_s, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial_safely(test, partial, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } @@ -88,6 +91,7 @@ void test__f_print_to_except_in_dynamic_partial_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_range_t partial = macro_f_string_range_t_initialize_1(0, 2); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -96,7 +100,7 @@ void test__f_print_to_except_in_dynamic_partial_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_partial_safely(test, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial_safely(test, partial, except, range, output); assert_int_equal(status, F_none); } @@ -112,7 +116,7 @@ void test__f_print_to_except_in_dynamic_partial_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_partial_safely(test, partial, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_partial_safely(test, partial, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_safely.h b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_safely.h index 7298349..7806aa8 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_partial_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_in_dynamic_partial_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_in_dynamic_partial_safely() */ -extern void test__f_print_to_except_in_dynamic_partial_safely__parameter_checking(void **state); +extern void test__f_print_to_except_in_dynamic_partial_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_in_dynamic_partial_safely() */ -extern void test__f_print_to_except_in_dynamic_partial_safely__returns_data_not(void **state); +extern void test__f_print_to_except_in_dynamic_partial_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw.c b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw.c index 8911d1a..0b187a2 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw.c @@ -10,6 +10,7 @@ void test__f_print_to_except_in_dynamic_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -50,40 +51,43 @@ void test__f_print_to_except_in_dynamic_raw__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_in_dynamic_raw(test, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_raw(test, except, range, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_in_dynamic_raw__parameter_checking(void **state) { +void test__f_print_to_except_in_dynamic_raw__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_raw(test, except, range, -1); + const f_status_t status = f_print_to_except_in_dynamic_raw(f_string_empty_s, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_in_dynamic_raw__returns_data_not(void **state) { +void test__f_print_to_except_in_dynamic_raw__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_raw(f_string_empty_s, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_raw(test, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_in_dynamic_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -92,7 +96,7 @@ void test__f_print_to_except_in_dynamic_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_raw(test, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_raw(test, except, range, output); assert_int_equal(status, F_none); } @@ -108,7 +112,7 @@ void test__f_print_to_except_in_dynamic_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_raw(test, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_raw(test, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw.h b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw.h index f74a7b3..306563f 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_in_dynamic_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_in_dynamic_raw() */ -extern void test__f_print_to_except_in_dynamic_raw__parameter_checking(void **state); +extern void test__f_print_to_except_in_dynamic_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_in_dynamic_raw() */ -extern void test__f_print_to_except_in_dynamic_raw__returns_data_not(void **state); +extern void test__f_print_to_except_in_dynamic_raw__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw_safely.c index d4058bf..4e09319 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw_safely.c @@ -10,6 +10,7 @@ void test__f_print_to_except_in_dynamic_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -50,40 +51,43 @@ void test__f_print_to_except_in_dynamic_raw_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_in_dynamic_raw_safely(test, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_raw_safely(test, except, range, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_in_dynamic_raw_safely__parameter_checking(void **state) { +void test__f_print_to_except_in_dynamic_raw_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_raw_safely(test, except, range, -1); + const f_status_t status = f_print_to_except_in_dynamic_raw_safely(f_string_empty_s, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_in_dynamic_raw_safely__returns_data_not(void **state) { +void test__f_print_to_except_in_dynamic_raw_safely__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_raw_safely(f_string_empty_s, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_raw_safely(test, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_in_dynamic_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -92,7 +96,7 @@ void test__f_print_to_except_in_dynamic_raw_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_raw_safely(test, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_raw_safely(test, except, range, output); assert_int_equal(status, F_none); } @@ -108,7 +112,7 @@ void test__f_print_to_except_in_dynamic_raw_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_raw_safely(test, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_raw_safely(test, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw_safely.h index 345362b..1f1931e 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_in_dynamic_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_in_dynamic_raw_safely() */ -extern void test__f_print_to_except_in_dynamic_raw_safely__parameter_checking(void **state); +extern void test__f_print_to_except_in_dynamic_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_in_dynamic_raw_safely() */ -extern void test__f_print_to_except_in_dynamic_raw_safely__returns_data_not(void **state); +extern void test__f_print_to_except_in_dynamic_raw_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_safely.c b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_safely.c index 8af9220..8e143db 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_safely.c @@ -10,6 +10,7 @@ void test__f_print_to_except_in_dynamic_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -50,40 +51,43 @@ void test__f_print_to_except_in_dynamic_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_in_dynamic_safely(test, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_safely(test, except, range, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_in_dynamic_safely__parameter_checking(void **state) { +void test__f_print_to_except_in_dynamic_safely__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_safely(test, except, range, -1); + const f_status_t status = f_print_to_except_in_dynamic_safely(f_string_empty_s, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_except_in_dynamic_safely__returns_data_not(void **state) { +void test__f_print_to_except_in_dynamic_safely__returns_file_descriptor_not(void **state) { + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_dynamic_safely(f_string_empty_s, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_safely(test, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_in_dynamic_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -92,7 +96,7 @@ void test__f_print_to_except_in_dynamic_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_safely(test, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_safely(test, except, range, output); assert_int_equal(status, F_none); } @@ -108,7 +112,7 @@ void test__f_print_to_except_in_dynamic_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_dynamic_safely(test, except, range, 0); + const f_status_t status = f_print_to_except_in_dynamic_safely(test, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_safely.h b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_safely.h index e765ac9..1f3d422 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_dynamic_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_in_dynamic_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_in_dynamic_safely() */ -extern void test__f_print_to_except_in_dynamic_safely__parameter_checking(void **state); +extern void test__f_print_to_except_in_dynamic_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_in_dynamic_safely() */ -extern void test__f_print_to_except_in_dynamic_safely__returns_data_not(void **state); +extern void test__f_print_to_except_in_dynamic_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_raw.c b/level_0/f_print/tests/unit/c/test-print-to_except_in_raw.c index 47bf604..a0950af 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_raw.c @@ -10,6 +10,7 @@ void test__f_print_to_except_in_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -50,53 +51,56 @@ void test__f_print_to_except_in_raw__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_in_raw(test.string, 0, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_in_raw__parameter_checking(void **state) { +void test__f_print_to_except_in_raw__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_raw(test.string, 0, test.used, except, range, -1); + const f_status_t status = f_print_to_except_in_raw(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_to_except_in_raw__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; - const f_string_ranges_t range = f_string_ranges_t_initialize; { - const f_status_t status = f_print_to_except_in_raw(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw(test.string, 0, f_string_empty_s.used, except, range, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_to_except_in_raw(test.string, 0, f_string_empty_s.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw(0, 0, test.used, except, range, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_to_except_in_raw__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_raw(0, 0, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw(test.string, 0, test.used, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_in_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -105,7 +109,7 @@ void test__f_print_to_except_in_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_raw(test.string, 0, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -117,7 +121,7 @@ void test__f_print_to_except_in_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_raw(test.string, 2, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw(test.string, 2, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -133,7 +137,7 @@ void test__f_print_to_except_in_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_raw(test.string, 1, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw(test.string, 1, test.used, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_raw.h b/level_0/f_print/tests/unit/c/test-print-to_except_in_raw.h index 06f68f6..9d237bd 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_in_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_in_raw() */ -extern void test__f_print_to_except_in_raw__parameter_checking(void **state); +extern void test__f_print_to_except_in_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_in_raw() */ -extern void test__f_print_to_except_in_raw__returns_data_not(void **state); +extern void test__f_print_to_except_in_raw__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-to_except_in_raw_safely.c index d6dd4a7..7de60ac 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_raw_safely.c @@ -10,6 +10,7 @@ void test__f_print_to_except_in_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -50,53 +51,56 @@ void test__f_print_to_except_in_raw_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_in_raw_safely(test.string, 0, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw_safely(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_in_raw_safely__parameter_checking(void **state) { +void test__f_print_to_except_in_raw_safely__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_raw_safely(test.string, 0, test.used, except, range, -1); + const f_status_t status = f_print_to_except_in_raw_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_to_except_in_raw_safely__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; - const f_string_ranges_t range = f_string_ranges_t_initialize; { - const f_status_t status = f_print_to_except_in_raw_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw_safely(test.string, 0, f_string_empty_s.used, except, range, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_to_except_in_raw_safely(test.string, 0, f_string_empty_s.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw_safely(0, 0, test.used, except, range, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_to_except_in_raw_safely__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_raw_safely(0, 0, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw_safely(test.string, 0, test.used, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_in_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -105,7 +109,7 @@ void test__f_print_to_except_in_raw_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_raw_safely(test.string, 0, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw_safely(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -117,7 +121,7 @@ void test__f_print_to_except_in_raw_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_raw_safely(test.string, 2, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw_safely(test.string, 2, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -133,7 +137,7 @@ void test__f_print_to_except_in_raw_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_raw_safely(test.string, 1, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_raw_safely(test.string, 1, test.used, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-to_except_in_raw_safely.h index 4cc4c18..f9db0e0 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_in_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_in_raw_safely() */ -extern void test__f_print_to_except_in_raw_safely__parameter_checking(void **state); +extern void test__f_print_to_except_in_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_in_raw_safely() */ -extern void test__f_print_to_except_in_raw_safely__returns_data_not(void **state); +extern void test__f_print_to_except_in_raw_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_safely.c b/level_0/f_print/tests/unit/c/test-print-to_except_in_safely.c index 73c7dbb..c1d052f 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_safely.c @@ -10,6 +10,7 @@ void test__f_print_to_except_in_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -50,53 +51,56 @@ void test__f_print_to_except_in_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_in_safely(test.string, 0, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_safely(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_in_safely__parameter_checking(void **state) { +void test__f_print_to_except_in_safely__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_safely(test.string, 0, test.used, except, range, -1); + const f_status_t status = f_print_to_except_in_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_to_except_in_safely__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; - const f_string_ranges_t range = f_string_ranges_t_initialize; { - const f_status_t status = f_print_to_except_in_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, range, 0); + const f_status_t status = f_print_to_except_in_safely(test.string, 0, f_string_empty_s.used, except, range, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_to_except_in_safely(test.string, 0, f_string_empty_s.used, except, range, 0); + const f_status_t status = f_print_to_except_in_safely(0, 0, test.used, except, range, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_to_except_in_safely__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_string_ranges_t range = f_string_ranges_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_in_safely(0, 0, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_safely(test.string, 0, test.used, except, range, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_in_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -105,7 +109,7 @@ void test__f_print_to_except_in_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_safely(test.string, 0, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_safely(test.string, 0, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -117,7 +121,7 @@ void test__f_print_to_except_in_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_safely(test.string, 2, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_safely(test.string, 2, test.used, except, range, output); assert_int_equal(status, F_none); } @@ -133,7 +137,7 @@ void test__f_print_to_except_in_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_in_safely(test.string, 1, test.used, except, range, 0); + const f_status_t status = f_print_to_except_in_safely(test.string, 1, test.used, except, range, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_in_safely.h b/level_0/f_print/tests/unit/c/test-print-to_except_in_safely.h index d442701..61cfe29 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_in_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_in_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_in_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_in_safely() */ -extern void test__f_print_to_except_in_safely__parameter_checking(void **state); +extern void test__f_print_to_except_in_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_in_safely() */ -extern void test__f_print_to_except_in_safely__returns_data_not(void **state); +extern void test__f_print_to_except_in_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_raw.c b/level_0/f_print/tests/unit/c/test-print-to_except_raw.c index bed6c0a..dfa3ba7 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_raw.c @@ -9,6 +9,7 @@ void test__f_print_to_except_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -49,51 +50,54 @@ void test__f_print_to_except_raw__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_raw(test.string, 0, test.used, except, 0); + const f_status_t status = f_print_to_except_raw(test.string, 0, test.used, except, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_raw__parameter_checking(void **state) { +void test__f_print_to_except_raw__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_raw(test.string, 0, test.used, except, -1); + const f_status_t status = f_print_to_except_raw(f_string_empty_s.string, 0, f_string_empty_s.used, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_to_except_raw__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; { - const f_status_t status = f_print_to_except_raw(f_string_empty_s.string, 0, f_string_empty_s.used, except, 0); + const f_status_t status = f_print_to_except_raw(test.string, 0, f_string_empty_s.used, except, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_to_except_raw(test.string, 0, f_string_empty_s.used, except, 0); + const f_status_t status = f_print_to_except_raw(0, 0, test.used, except, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_to_except_raw__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_raw(0, 0, test.used, except, 0); + const f_status_t status = f_print_to_except_raw(test.string, 0, test.used, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -101,7 +105,7 @@ void test__f_print_to_except_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_raw(test.string, 0, test.used, except, 0); + const f_status_t status = f_print_to_except_raw(test.string, 0, test.used, except, output); assert_int_equal(status, F_none); } @@ -112,7 +116,7 @@ void test__f_print_to_except_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_raw(test.string, 2, test.used, except, 0); + const f_status_t status = f_print_to_except_raw(test.string, 2, test.used, except, output); assert_int_equal(status, F_none); } @@ -124,7 +128,7 @@ void test__f_print_to_except_raw__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_raw(test.string, 1, test.used, except, 0); + const f_status_t status = f_print_to_except_raw(test.string, 1, test.used, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_raw.h b/level_0/f_print/tests/unit/c/test-print-to_except_raw.h index e8d9cee..bd0993f 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_raw() */ -extern void test__f_print_to_except_raw__parameter_checking(void **state); +extern void test__f_print_to_except_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_raw() */ -extern void test__f_print_to_except_raw__returns_data_not(void **state); +extern void test__f_print_to_except_raw__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-to_except_raw_safely.c index dca118f..258d3ac 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_raw_safely.c @@ -9,6 +9,7 @@ void test__f_print_to_except_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -49,51 +50,54 @@ void test__f_print_to_except_raw_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_raw_safely(test.string, 0, test.used, except, 0); + const f_status_t status = f_print_to_except_raw_safely(test.string, 0, test.used, except, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_raw_safely__parameter_checking(void **state) { +void test__f_print_to_except_raw_safely__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_raw_safely(test.string, 0, test.used, except, -1); + const f_status_t status = f_print_to_except_raw_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_to_except_raw_safely__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; { - const f_status_t status = f_print_to_except_raw_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, 0); + const f_status_t status = f_print_to_except_raw_safely(test.string, 0, f_string_empty_s.used, except, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_to_except_raw_safely(test.string, 0, f_string_empty_s.used, except, 0); + const f_status_t status = f_print_to_except_raw_safely(0, 0, test.used, except, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_to_except_raw_safely__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_raw_safely(0, 0, test.used, except, 0); + const f_status_t status = f_print_to_except_raw_safely(test.string, 0, test.used, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -101,7 +105,7 @@ void test__f_print_to_except_raw_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_raw_safely(test.string, 0, test.used, except, 0); + const f_status_t status = f_print_to_except_raw_safely(test.string, 0, test.used, except, output); assert_int_equal(status, F_none); } @@ -112,7 +116,7 @@ void test__f_print_to_except_raw_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_raw_safely(test.string, 2, test.used, except, 0); + const f_status_t status = f_print_to_except_raw_safely(test.string, 2, test.used, except, output); assert_int_equal(status, F_none); } @@ -124,7 +128,7 @@ void test__f_print_to_except_raw_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_raw_safely(test.string, 1, test.used, except, 0); + const f_status_t status = f_print_to_except_raw_safely(test.string, 1, test.used, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-to_except_raw_safely.h index 8f1d74f..35bbd5e 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_raw_safely() */ -extern void test__f_print_to_except_raw_safely__parameter_checking(void **state); +extern void test__f_print_to_except_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_raw_safely() */ -extern void test__f_print_to_except_raw_safely__returns_data_not(void **state); +extern void test__f_print_to_except_raw_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_safely.c b/level_0/f_print/tests/unit/c/test-print-to_except_safely.c index c9db7c0..d890d8c 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_except_safely.c @@ -9,6 +9,7 @@ void test__f_print_to_except_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -49,51 +50,54 @@ void test__f_print_to_except_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_except_safely(test.string, 0, test.used, except, 0); + const f_status_t status = f_print_to_except_safely(test.string, 0, test.used, except, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_except_safely__parameter_checking(void **state) { +void test__f_print_to_except_safely__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_safely(test.string, 0, test.used, except, -1); + const f_status_t status = f_print_to_except_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_to_except_safely__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); - const f_array_lengths_t except = f_array_lengths_t_initialize; { - const f_status_t status = f_print_to_except_safely(f_string_empty_s.string, 0, f_string_empty_s.used, except, 0); + const f_status_t status = f_print_to_except_safely(test.string, 0, f_string_empty_s.used, except, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_to_except_safely(test.string, 0, f_string_empty_s.used, except, 0); + const f_status_t status = f_print_to_except_safely(0, 0, test.used, except, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_to_except_safely__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_array_lengths_t except = f_array_lengths_t_initialize; + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_except_safely(0, 0, test.used, except, 0); + const f_status_t status = f_print_to_except_safely(test.string, 0, test.used, except, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_except_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { const f_array_lengths_t except = f_array_lengths_t_initialize; @@ -101,7 +105,7 @@ void test__f_print_to_except_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_safely(test.string, 0, test.used, except, 0); + const f_status_t status = f_print_to_except_safely(test.string, 0, test.used, except, output); assert_int_equal(status, F_none); } @@ -112,7 +116,7 @@ void test__f_print_to_except_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_safely(test.string, 2, test.used, except, 0); + const f_status_t status = f_print_to_except_safely(test.string, 2, test.used, except, output); assert_int_equal(status, F_none); } @@ -124,7 +128,7 @@ void test__f_print_to_except_safely__works(void **state) { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_except_safely(test.string, 1, test.used, except, 0); + const f_status_t status = f_print_to_except_safely(test.string, 1, test.used, except, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_except_safely.h b/level_0/f_print/tests/unit/c/test-print-to_except_safely.h index 547f12e..289807b 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_except_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_except_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_except_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_except_safely() */ -extern void test__f_print_to_except_safely__parameter_checking(void **state); +extern void test__f_print_to_except_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_except_safely() */ -extern void test__f_print_to_except_safely__returns_data_not(void **state); +extern void test__f_print_to_except_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_raw.c b/level_0/f_print/tests/unit/c/test-print-to_raw.c index 92e2c75..09e9ef1 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_raw.c +++ b/level_0/f_print/tests/unit/c/test-print-to_raw.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to_raw__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,49 +49,52 @@ void test__f_print_to_raw__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_raw(test.string, test.used, 0); + const f_status_t status = f_print_to_raw(test.string, test.used, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_raw__parameter_checking(void **state) { +void test__f_print_to_raw__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_raw(test.string, test.used, -1); + const f_status_t status = f_print_to_raw(f_string_empty_s.string, f_string_empty_s.used, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_to_raw__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); { - const f_status_t status = f_print_to_raw(f_string_empty_s.string, f_string_empty_s.used, 0); + const f_status_t status = f_print_to_raw(test.string, f_string_empty_s.used, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_to_raw(test.string, f_string_empty_s.used, 0); + const f_status_t status = f_print_to_raw(0, test.used, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_to_raw__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_raw(0, test.used, 0); + const f_status_t status = f_print_to_raw(test.string, test.used, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_raw__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); @@ -99,7 +103,7 @@ void test__f_print_to_raw__works(void **state) { /*will_return(__wrap_write, false); will_return(__wrap_write, 1);*/ - const f_status_t status = f_print_to_raw(test.string, test.used, 0); + const f_status_t status = f_print_to_raw(test.string, test.used, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_raw.h b/level_0/f_print/tests/unit/c/test-print-to_raw.h index 750430e..8b676e3 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_raw.h +++ b/level_0/f_print/tests/unit/c/test-print-to_raw.h @@ -18,18 +18,18 @@ extern void test__f_print_to_raw__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_raw() */ -extern void test__f_print_to_raw__parameter_checking(void **state); +extern void test__f_print_to_raw__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_raw() */ -extern void test__f_print_to_raw__returns_data_not(void **state); +extern void test__f_print_to_raw__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_raw_safely.c b/level_0/f_print/tests/unit/c/test-print-to_raw_safely.c index 34d9607..3d7e0dd 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_raw_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_raw_safely.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to_raw_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,55 +49,58 @@ void test__f_print_to_raw_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_raw_safely(test.string, test.used, 0); + const f_status_t status = f_print_to_raw_safely(test.string, test.used, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_raw_safely__parameter_checking(void **state) { +void test__f_print_to_raw_safely__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_raw_safely(test.string, test.used, -1); + const f_status_t status = f_print_to_raw_safely(f_string_empty_s.string, f_string_empty_s.used, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_to_raw_safely__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); { - const f_status_t status = f_print_to_raw_safely(f_string_empty_s.string, f_string_empty_s.used, 0); + const f_status_t status = f_print_to_raw_safely(test.string, f_string_empty_s.used, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_to_raw_safely(test.string, f_string_empty_s.used, 0); + const f_status_t status = f_print_to_raw_safely(0, test.used, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_to_raw_safely__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_raw_safely(0, test.used, 0); + const f_status_t status = f_print_to_raw_safely(test.string, test.used, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_raw_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_raw_safely(test.string, test.used, 0); + const f_status_t status = f_print_to_raw_safely(test.string, test.used, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_raw_safely.h b/level_0/f_print/tests/unit/c/test-print-to_raw_safely.h index 1100d67..b5f408c 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_raw_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_raw_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_raw_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_raw_safely() */ -extern void test__f_print_to_raw_safely__parameter_checking(void **state); +extern void test__f_print_to_raw_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_raw_safely() */ -extern void test__f_print_to_raw_safely__returns_data_not(void **state); +extern void test__f_print_to_raw_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_raw_terminated.c b/level_0/f_print/tests/unit/c/test-print-to_raw_terminated.c index 5d5bc71..3ae873c 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_raw_terminated.c +++ b/level_0/f_print/tests/unit/c/test-print-to_raw_terminated.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to_raw_terminated__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,41 +49,45 @@ void test__f_print_to_raw_terminated__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_raw_terminated(test.string, 0); + const f_status_t status = f_print_to_raw_terminated(test.string, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_raw_terminated__parameter_checking(void **state) { +void test__f_print_to_raw_terminated__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_raw_terminated(test.string, -1); + const f_status_t status = f_print_to_raw_terminated(0, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_raw_terminated__returns_data_not(void **state) { +void test__f_print_to_raw_terminated__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_raw_terminated(0, 0); + const f_status_t status = f_print_to_raw_terminated(test.string, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_raw_terminated__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_raw_terminated(test.string, 0); + const f_status_t status = f_print_to_raw_terminated(test.string, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_raw_terminated.h b/level_0/f_print/tests/unit/c/test-print-to_raw_terminated.h index 2615189..765c3e4 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_raw_terminated.h +++ b/level_0/f_print/tests/unit/c/test-print-to_raw_terminated.h @@ -18,18 +18,18 @@ extern void test__f_print_to_raw_terminated__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_raw_terminated() */ -extern void test__f_print_to_raw_terminated__parameter_checking(void **state); +extern void test__f_print_to_raw_terminated__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_raw_terminated() */ -extern void test__f_print_to_raw_terminated__returns_data_not(void **state); +extern void test__f_print_to_raw_terminated__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_safely.c b/level_0/f_print/tests/unit/c/test-print-to_safely.c index d3cc534..d29203f 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_safely.c +++ b/level_0/f_print/tests/unit/c/test-print-to_safely.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to_safely__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,55 +49,58 @@ void test__f_print_to_safely__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_safely(test.string, test.used, 0); + const f_status_t status = f_print_to_safely(test.string, test.used, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_safely__parameter_checking(void **state) { +void test__f_print_to_safely__returns_data_not(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_safely(test.string, test.used, -1); + const f_status_t status = f_print_to_safely(f_string_empty_s.string, f_string_empty_s.used, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } -} - -void test__f_print_to_safely__returns_data_not(void **state) { - - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); { - const f_status_t status = f_print_to_safely(f_string_empty_s.string, f_string_empty_s.used, 0); + const f_status_t status = f_print_to_safely(test.string, f_string_empty_s.used, output); assert_int_equal(status, F_data_not); } { - const f_status_t status = f_print_to_safely(test.string, f_string_empty_s.used, 0); + const f_status_t status = f_print_to_safely(0, test.used, output); assert_int_equal(status, F_data_not); } +} + +void test__f_print_to_safely__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_safely(0, test.used, 0); + const f_status_t status = f_print_to_safely(test.string, test.used, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_safely__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_safely(test.string, test.used, 0); + const f_status_t status = f_print_to_safely(test.string, test.used, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_safely.h b/level_0/f_print/tests/unit/c/test-print-to_safely.h index ace2408..d31f810 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_safely.h +++ b/level_0/f_print/tests/unit/c/test-print-to_safely.h @@ -18,18 +18,18 @@ extern void test__f_print_to_safely__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_safely() */ -extern void test__f_print_to_safely__parameter_checking(void **state); +extern void test__f_print_to_safely__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_safely() */ -extern void test__f_print_to_safely__returns_data_not(void **state); +extern void test__f_print_to_safely__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_safely_terminated.c b/level_0/f_print/tests/unit/c/test-print-to_safely_terminated.c index a088d07..56e1354 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_safely_terminated.c +++ b/level_0/f_print/tests/unit/c/test-print-to_safely_terminated.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to_safely_terminated__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,41 +49,45 @@ void test__f_print_to_safely_terminated__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_safely_terminated(test.string, 0); + const f_status_t status = f_print_to_safely_terminated(test.string, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_safely_terminated__parameter_checking(void **state) { +void test__f_print_to_safely_terminated__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_safely_terminated(test.string, -1); + const f_status_t status = f_print_to_safely_terminated(0, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_safely_terminated__returns_data_not(void **state) { +void test__f_print_to_safely_terminated__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_safely_terminated(0, 0); + const f_status_t status = f_print_to_safely_terminated(test.string, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_safely_terminated__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_safely_terminated(test.string, 0); + const f_status_t status = f_print_to_safely_terminated(test.string, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_safely_terminated.h b/level_0/f_print/tests/unit/c/test-print-to_safely_terminated.h index 2b3ec2c..6dd5e40 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_safely_terminated.h +++ b/level_0/f_print/tests/unit/c/test-print-to_safely_terminated.h @@ -18,18 +18,18 @@ extern void test__f_print_to_safely_terminated__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_safely_terminated() */ -extern void test__f_print_to_safely_terminated__parameter_checking(void **state); +extern void test__f_print_to_safely_terminated__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_safely_terminated() */ -extern void test__f_print_to_safely_terminated__returns_data_not(void **state); +extern void test__f_print_to_safely_terminated__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print-to_terminated.c b/level_0/f_print/tests/unit/c/test-print-to_terminated.c index 30d5c8a..795eadc 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_terminated.c +++ b/level_0/f_print/tests/unit/c/test-print-to_terminated.c @@ -8,6 +8,7 @@ extern "C" { void test__f_print_to_terminated__fails(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); int errnos[] = { EAGAIN, @@ -48,41 +49,45 @@ void test__f_print_to_terminated__fails(void **state) { will_return(__wrap_write, true); will_return(__wrap_write, errnos[i]); - const f_status_t status = f_print_to_terminated(test.string, 0); + const f_status_t status = f_print_to_terminated(test.string, output); assert_int_equal(status, F_status_set_error(statuss[i])); } // for } -void test__f_print_to_terminated__parameter_checking(void **state) { +void test__f_print_to_terminated__returns_data_not(void **state) { - const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_terminated(test.string, -1); + const f_status_t status = f_print_to_terminated(0, output); - assert_int_equal(F_status_set_fine(status), F_parameter); + assert_int_equal(status, F_data_not); } } -void test__f_print_to_terminated__returns_data_not(void **state) { +void test__f_print_to_terminated__returns_file_descriptor_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(0, -1, F_file_flag_write_only_d); { - const f_status_t status = f_print_to_terminated(0, 0); + const f_status_t status = f_print_to_terminated(test.string, output); - assert_int_equal(status, F_data_not); + assert_int_equal(status, F_file_descriptor_not); } } void test__f_print_to_terminated__works(void **state) { const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_file_t output = macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d); { will_return(__wrap_write, false); will_return(__wrap_write, test.used); - const f_status_t status = f_print_to_terminated(test.string, 0); + const f_status_t status = f_print_to_terminated(test.string, output); assert_int_equal(status, F_none); } diff --git a/level_0/f_print/tests/unit/c/test-print-to_terminated.h b/level_0/f_print/tests/unit/c/test-print-to_terminated.h index 6ee9043..d255ddd 100644 --- a/level_0/f_print/tests/unit/c/test-print-to_terminated.h +++ b/level_0/f_print/tests/unit/c/test-print-to_terminated.h @@ -18,18 +18,18 @@ extern void test__f_print_to_terminated__fails(void **state); /** - * Test that parameter checking works as expected. + * Test that function works but returns F_data_not. * * @see f_print_to_terminated() */ -extern void test__f_print_to_terminated__parameter_checking(void **state); +extern void test__f_print_to_terminated__returns_data_not(void **state); /** - * Test that function works but returns F_data_not. + * Test that function works but returns F_file_descriptor_not. * * @see f_print_to_terminated() */ -extern void test__f_print_to_terminated__returns_data_not(void **state); +extern void test__f_print_to_terminated__returns_file_descriptor_not(void **state); /** * Test that function works. diff --git a/level_0/f_print/tests/unit/c/test-print.c b/level_0/f_print/tests/unit/c/test-print.c index 95e8ebb..65629e0 100644 --- a/level_0/f_print/tests/unit/c/test-print.c +++ b/level_0/f_print/tests/unit/c/test-print.c @@ -21,12 +21,15 @@ int main(void) { const struct CMUnitTest tests[] = { cmocka_unit_test(test__f_print__fails), cmocka_unit_test(test__f_print__returns_data_not), + cmocka_unit_test(test__f_print__returns_stream_not), cmocka_unit_test(test__f_print__works), cmocka_unit_test(test__f_print_character__fails), + cmocka_unit_test(test__f_print_character__returns_stream_not), cmocka_unit_test(test__f_print_character__works), cmocka_unit_test(test__f_print_character_safely__fails), + cmocka_unit_test(test__f_print_character_safely__returns_stream_not), cmocka_unit_test(test__f_print_character_safely__returns_utf), cmocka_unit_test(test__f_print_character_safely__works), @@ -37,146 +40,182 @@ int main(void) { cmocka_unit_test(test__f_print_dynamic__fails), cmocka_unit_test(test__f_print_dynamic__returns_data_not), + cmocka_unit_test(test__f_print_dynamic__returns_stream_not), cmocka_unit_test(test__f_print_dynamic__works), cmocka_unit_test(test__f_print_dynamic_partial__fails), cmocka_unit_test(test__f_print_dynamic_partial__returns_data_not), + cmocka_unit_test(test__f_print_dynamic_partial__returns_stream_not), cmocka_unit_test(test__f_print_dynamic_partial__works), cmocka_unit_test(test__f_print_dynamic_partial_raw__fails), cmocka_unit_test(test__f_print_dynamic_partial_raw__returns_data_not), + cmocka_unit_test(test__f_print_dynamic_partial_raw__returns_stream_not), cmocka_unit_test(test__f_print_dynamic_partial_raw__works), cmocka_unit_test(test__f_print_dynamic_partial_raw_safely__fails), cmocka_unit_test(test__f_print_dynamic_partial_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_dynamic_partial_raw_safely__returns_stream_not), cmocka_unit_test(test__f_print_dynamic_partial_raw_safely__works), cmocka_unit_test(test__f_print_dynamic_partial_safely__fails), cmocka_unit_test(test__f_print_dynamic_partial_safely__returns_data_not), + cmocka_unit_test(test__f_print_dynamic_partial_safely__returns_stream_not), cmocka_unit_test(test__f_print_dynamic_partial_safely__works), cmocka_unit_test(test__f_print_dynamic_raw__fails), cmocka_unit_test(test__f_print_dynamic_raw__returns_data_not), + cmocka_unit_test(test__f_print_dynamic_raw__returns_stream_not), cmocka_unit_test(test__f_print_dynamic_raw__works), cmocka_unit_test(test__f_print_dynamic_raw_safely__fails), cmocka_unit_test(test__f_print_dynamic_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_dynamic_raw_safely__returns_stream_not), cmocka_unit_test(test__f_print_dynamic_raw_safely__works), cmocka_unit_test(test__f_print_dynamic_safely__fails), cmocka_unit_test(test__f_print_dynamic_safely__returns_data_not), + cmocka_unit_test(test__f_print_dynamic_safely__returns_stream_not), cmocka_unit_test(test__f_print_dynamic_safely__works), cmocka_unit_test(test__f_print_except__fails), cmocka_unit_test(test__f_print_except__returns_data_not), + cmocka_unit_test(test__f_print_except__returns_stream_not), cmocka_unit_test(test__f_print_except__works), cmocka_unit_test(test__f_print_except_dynamic__fails), cmocka_unit_test(test__f_print_except_dynamic__returns_data_not), + cmocka_unit_test(test__f_print_except_dynamic__returns_stream_not), cmocka_unit_test(test__f_print_except_dynamic__works), cmocka_unit_test(test__f_print_except_dynamic_partial__fails), cmocka_unit_test(test__f_print_except_dynamic_partial__returns_data_not), + cmocka_unit_test(test__f_print_except_dynamic_partial__returns_stream_not), cmocka_unit_test(test__f_print_except_dynamic_partial__works), cmocka_unit_test(test__f_print_except_dynamic_partial_raw__fails), cmocka_unit_test(test__f_print_except_dynamic_partial_raw__returns_data_not), + cmocka_unit_test(test__f_print_except_dynamic_partial_raw__returns_stream_not), cmocka_unit_test(test__f_print_except_dynamic_partial_raw__works), cmocka_unit_test(test__f_print_except_dynamic_partial_raw_safely__fails), cmocka_unit_test(test__f_print_except_dynamic_partial_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_except_dynamic_partial_raw_safely__returns_stream_not), cmocka_unit_test(test__f_print_except_dynamic_partial_raw_safely__works), cmocka_unit_test(test__f_print_except_dynamic_partial_safely__fails), cmocka_unit_test(test__f_print_except_dynamic_partial_safely__returns_data_not), + cmocka_unit_test(test__f_print_except_dynamic_partial_safely__returns_stream_not), cmocka_unit_test(test__f_print_except_dynamic_partial_safely__works), cmocka_unit_test(test__f_print_except_dynamic_raw__fails), cmocka_unit_test(test__f_print_except_dynamic_raw__returns_data_not), + cmocka_unit_test(test__f_print_except_dynamic_raw__returns_stream_not), cmocka_unit_test(test__f_print_except_dynamic_raw__works), cmocka_unit_test(test__f_print_except_dynamic_raw_safely__fails), cmocka_unit_test(test__f_print_except_dynamic_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_except_dynamic_raw_safely__returns_stream_not), cmocka_unit_test(test__f_print_except_dynamic_raw_safely__works), cmocka_unit_test(test__f_print_except_dynamic_safely__fails), cmocka_unit_test(test__f_print_except_dynamic_safely__returns_data_not), + cmocka_unit_test(test__f_print_except_dynamic_safely__returns_stream_not), cmocka_unit_test(test__f_print_except_dynamic_safely__works), cmocka_unit_test(test__f_print_except_in__fails), cmocka_unit_test(test__f_print_except_in__returns_data_not), + cmocka_unit_test(test__f_print_except_in__returns_stream_not), cmocka_unit_test(test__f_print_except_in__works), cmocka_unit_test(test__f_print_except_in_dynamic__fails), cmocka_unit_test(test__f_print_except_in_dynamic__returns_data_not), + cmocka_unit_test(test__f_print_except_in_dynamic__returns_stream_not), cmocka_unit_test(test__f_print_except_in_dynamic__works), cmocka_unit_test(test__f_print_except_in_dynamic_partial__fails), cmocka_unit_test(test__f_print_except_in_dynamic_partial__returns_data_not), + cmocka_unit_test(test__f_print_except_in_dynamic_partial__returns_stream_not), cmocka_unit_test(test__f_print_except_in_dynamic_partial__works), cmocka_unit_test(test__f_print_except_in_dynamic_partial_raw__fails), cmocka_unit_test(test__f_print_except_in_dynamic_partial_raw__returns_data_not), + cmocka_unit_test(test__f_print_except_in_dynamic_partial_raw__returns_stream_not), cmocka_unit_test(test__f_print_except_in_dynamic_partial_raw__works), cmocka_unit_test(test__f_print_except_in_dynamic_partial_raw_safely__fails), cmocka_unit_test(test__f_print_except_in_dynamic_partial_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_except_in_dynamic_partial_raw_safely__returns_stream_not), cmocka_unit_test(test__f_print_except_in_dynamic_partial_raw_safely__works), cmocka_unit_test(test__f_print_except_in_dynamic_partial_safely__fails), cmocka_unit_test(test__f_print_except_in_dynamic_partial_safely__returns_data_not), + cmocka_unit_test(test__f_print_except_in_dynamic_partial_safely__returns_stream_not), cmocka_unit_test(test__f_print_except_in_dynamic_partial_safely__works), cmocka_unit_test(test__f_print_except_in_dynamic_raw__fails), cmocka_unit_test(test__f_print_except_in_dynamic_raw__returns_data_not), + cmocka_unit_test(test__f_print_except_in_dynamic_raw__returns_stream_not), cmocka_unit_test(test__f_print_except_in_dynamic_raw__works), cmocka_unit_test(test__f_print_except_in_dynamic_raw_safely__fails), cmocka_unit_test(test__f_print_except_in_dynamic_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_except_in_dynamic_raw_safely__returns_stream_not), cmocka_unit_test(test__f_print_except_in_dynamic_raw_safely__works), cmocka_unit_test(test__f_print_except_in_dynamic_safely__fails), cmocka_unit_test(test__f_print_except_in_dynamic_safely__returns_data_not), + cmocka_unit_test(test__f_print_except_in_dynamic_safely__returns_stream_not), cmocka_unit_test(test__f_print_except_in_dynamic_safely__works), cmocka_unit_test(test__f_print_except_in_raw__fails), cmocka_unit_test(test__f_print_except_in_raw__returns_data_not), + cmocka_unit_test(test__f_print_except_in_raw__returns_stream_not), cmocka_unit_test(test__f_print_except_in_raw__works), cmocka_unit_test(test__f_print_except_in_raw_safely__fails), cmocka_unit_test(test__f_print_except_in_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_except_in_raw_safely__returns_stream_not), cmocka_unit_test(test__f_print_except_in_raw_safely__works), cmocka_unit_test(test__f_print_except_in_safely__fails), cmocka_unit_test(test__f_print_except_in_safely__returns_data_not), + cmocka_unit_test(test__f_print_except_in_safely__returns_stream_not), cmocka_unit_test(test__f_print_except_in_safely__works), cmocka_unit_test(test__f_print_except_raw__fails), cmocka_unit_test(test__f_print_except_raw__returns_data_not), + cmocka_unit_test(test__f_print_except_raw__returns_stream_not), cmocka_unit_test(test__f_print_except_raw__works), cmocka_unit_test(test__f_print_except_raw_safely__fails), cmocka_unit_test(test__f_print_except_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_except_raw_safely__returns_stream_not), cmocka_unit_test(test__f_print_except_raw_safely__works), cmocka_unit_test(test__f_print_except_safely__fails), cmocka_unit_test(test__f_print_except_safely__returns_data_not), + cmocka_unit_test(test__f_print_except_safely__returns_stream_not), cmocka_unit_test(test__f_print_except_safely__works), cmocka_unit_test(test__f_print_raw__fails), cmocka_unit_test(test__f_print_raw__returns_data_not), + cmocka_unit_test(test__f_print_raw__returns_stream_not), cmocka_unit_test(test__f_print_raw__works), cmocka_unit_test(test__f_print_raw_safely__fails), cmocka_unit_test(test__f_print_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_raw_safely__returns_stream_not), cmocka_unit_test(test__f_print_raw_safely__works), cmocka_unit_test(test__f_print_raw_terminated__fails), cmocka_unit_test(test__f_print_raw_terminated__returns_data_not), + cmocka_unit_test(test__f_print_raw_terminated__returns_stream_not), cmocka_unit_test(test__f_print_raw_terminated__works), cmocka_unit_test(test__f_print_safely__fails), cmocka_unit_test(test__f_print_safely__returns_data_not), + cmocka_unit_test(test__f_print_safely__returns_stream_not), cmocka_unit_test(test__f_print_safely__works), cmocka_unit_test(test__f_print_safely_get__returns_character_control), @@ -186,260 +225,303 @@ int main(void) { cmocka_unit_test(test__f_print_safely_terminated__fails), cmocka_unit_test(test__f_print_safely_terminated__returns_data_not), + cmocka_unit_test(test__f_print_safely_terminated__returns_stream_not), cmocka_unit_test(test__f_print_safely_terminated__works), cmocka_unit_test(test__f_print_terminated__fails), cmocka_unit_test(test__f_print_terminated__returns_data_not), + cmocka_unit_test(test__f_print_terminated__returns_stream_not), cmocka_unit_test(test__f_print_terminated__works), cmocka_unit_test(test__f_print_to__fails), cmocka_unit_test(test__f_print_to__returns_data_not), + cmocka_unit_test(test__f_print_to__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to__works), cmocka_unit_test(test__f_print_to_character__fails), + cmocka_unit_test(test__f_print_to_character__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_character__works), cmocka_unit_test(test__f_print_to_character_safely__fails), + cmocka_unit_test(test__f_print_to_character_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_character_safely__returns_utf), cmocka_unit_test(test__f_print_to_character_safely__works), cmocka_unit_test(test__f_print_to_dynamic__fails), cmocka_unit_test(test__f_print_to_dynamic__returns_data_not), + cmocka_unit_test(test__f_print_to_dynamic__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_dynamic__works), cmocka_unit_test(test__f_print_to_dynamic_partial__fails), cmocka_unit_test(test__f_print_to_dynamic_partial__returns_data_not), + cmocka_unit_test(test__f_print_to_dynamic_partial__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_dynamic_partial__works), cmocka_unit_test(test__f_print_to_dynamic_partial_raw__fails), cmocka_unit_test(test__f_print_to_dynamic_partial_raw__returns_data_not), + cmocka_unit_test(test__f_print_to_dynamic_partial_raw__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_dynamic_partial_raw__works), cmocka_unit_test(test__f_print_to_dynamic_partial_raw_safely__fails), cmocka_unit_test(test__f_print_to_dynamic_partial_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_dynamic_partial_raw_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_dynamic_partial_raw_safely__works), cmocka_unit_test(test__f_print_to_dynamic_partial_safely__fails), cmocka_unit_test(test__f_print_to_dynamic_partial_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_dynamic_partial_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_dynamic_partial_safely__works), cmocka_unit_test(test__f_print_to_dynamic_raw__fails), cmocka_unit_test(test__f_print_to_dynamic_raw__returns_data_not), + cmocka_unit_test(test__f_print_to_dynamic_raw__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_dynamic_raw__works), cmocka_unit_test(test__f_print_to_dynamic_raw_safely__fails), cmocka_unit_test(test__f_print_to_dynamic_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_dynamic_raw_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_dynamic_raw_safely__works), cmocka_unit_test(test__f_print_to_dynamic_safely__fails), cmocka_unit_test(test__f_print_to_dynamic_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_dynamic_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_dynamic_safely__works), cmocka_unit_test(test__f_print_to_except__fails), cmocka_unit_test(test__f_print_to_except__returns_data_not), + cmocka_unit_test(test__f_print_to_except__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except__works), cmocka_unit_test(test__f_print_to_except_dynamic__fails), cmocka_unit_test(test__f_print_to_except_dynamic__returns_data_not), + cmocka_unit_test(test__f_print_to_except_dynamic__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_dynamic__works), cmocka_unit_test(test__f_print_to_except_dynamic_partial__fails), cmocka_unit_test(test__f_print_to_except_dynamic_partial__returns_data_not), + cmocka_unit_test(test__f_print_to_except_dynamic_partial__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_dynamic_partial__works), cmocka_unit_test(test__f_print_to_except_dynamic_partial_raw__fails), cmocka_unit_test(test__f_print_to_except_dynamic_partial_raw__returns_data_not), + cmocka_unit_test(test__f_print_to_except_dynamic_partial_raw__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_dynamic_partial_raw__works), cmocka_unit_test(test__f_print_to_except_dynamic_partial_raw_safely__fails), cmocka_unit_test(test__f_print_to_except_dynamic_partial_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_except_dynamic_partial_raw_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_dynamic_partial_raw_safely__works), cmocka_unit_test(test__f_print_to_except_dynamic_partial_safely__fails), cmocka_unit_test(test__f_print_to_except_dynamic_partial_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_except_dynamic_partial_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_dynamic_partial_safely__works), cmocka_unit_test(test__f_print_to_except_dynamic_raw__fails), cmocka_unit_test(test__f_print_to_except_dynamic_raw__returns_data_not), + cmocka_unit_test(test__f_print_to_except_dynamic_raw__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_dynamic_raw__works), cmocka_unit_test(test__f_print_to_except_dynamic_raw_safely__fails), cmocka_unit_test(test__f_print_to_except_dynamic_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_except_dynamic_raw_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_dynamic_raw_safely__works), cmocka_unit_test(test__f_print_to_except_dynamic_safely__fails), cmocka_unit_test(test__f_print_to_except_dynamic_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_except_dynamic_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_dynamic_safely__works), cmocka_unit_test(test__f_print_to_except_in__fails), cmocka_unit_test(test__f_print_to_except_in__returns_data_not), + cmocka_unit_test(test__f_print_to_except_in__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_in__works), cmocka_unit_test(test__f_print_to_except_in_dynamic__fails), cmocka_unit_test(test__f_print_to_except_in_dynamic__returns_data_not), + cmocka_unit_test(test__f_print_to_except_in_dynamic__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_in_dynamic__works), cmocka_unit_test(test__f_print_to_except_in_dynamic_partial__fails), cmocka_unit_test(test__f_print_to_except_in_dynamic_partial__returns_data_not), + cmocka_unit_test(test__f_print_to_except_in_dynamic_partial__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_in_dynamic_partial__works), cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_raw__fails), cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_raw__returns_data_not), + cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_raw__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_raw__works), cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_raw_safely__fails), cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_raw_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_raw_safely__works), cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_safely__fails), cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_safely__works), cmocka_unit_test(test__f_print_to_except_in_dynamic_raw__fails), cmocka_unit_test(test__f_print_to_except_in_dynamic_raw__returns_data_not), + cmocka_unit_test(test__f_print_to_except_in_dynamic_raw__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_in_dynamic_raw__works), cmocka_unit_test(test__f_print_to_except_in_dynamic_raw_safely__fails), cmocka_unit_test(test__f_print_to_except_in_dynamic_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_except_in_dynamic_raw_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_in_dynamic_raw_safely__works), cmocka_unit_test(test__f_print_to_except_in_dynamic_safely__fails), cmocka_unit_test(test__f_print_to_except_in_dynamic_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_except_in_dynamic_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_in_dynamic_safely__works), cmocka_unit_test(test__f_print_to_except_in_raw__fails), cmocka_unit_test(test__f_print_to_except_in_raw__returns_data_not), + cmocka_unit_test(test__f_print_to_except_in_raw__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_in_raw__works), cmocka_unit_test(test__f_print_to_except_in_raw_safely__fails), cmocka_unit_test(test__f_print_to_except_in_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_except_in_raw_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_in_raw_safely__works), cmocka_unit_test(test__f_print_to_except_in_safely__fails), cmocka_unit_test(test__f_print_to_except_in_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_except_in_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_in_safely__works), cmocka_unit_test(test__f_print_to_except_raw__fails), cmocka_unit_test(test__f_print_to_except_raw__returns_data_not), + cmocka_unit_test(test__f_print_to_except_raw__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_raw__works), cmocka_unit_test(test__f_print_to_except_raw_safely__fails), cmocka_unit_test(test__f_print_to_except_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_except_raw_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_raw_safely__works), cmocka_unit_test(test__f_print_to_except_safely__fails), cmocka_unit_test(test__f_print_to_except_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_except_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_except_safely__works), cmocka_unit_test(test__f_print_to_raw__fails), cmocka_unit_test(test__f_print_to_raw__returns_data_not), + cmocka_unit_test(test__f_print_to_raw__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_raw__works), cmocka_unit_test(test__f_print_to_raw_safely__fails), cmocka_unit_test(test__f_print_to_raw_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_raw_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_raw_safely__works), cmocka_unit_test(test__f_print_to_raw_terminated__fails), cmocka_unit_test(test__f_print_to_raw_terminated__returns_data_not), + cmocka_unit_test(test__f_print_to_raw_terminated__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_raw_terminated__works), cmocka_unit_test(test__f_print_to_safely__fails), cmocka_unit_test(test__f_print_to_safely__returns_data_not), + cmocka_unit_test(test__f_print_to_safely__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_safely__works), cmocka_unit_test(test__f_print_to_safely_terminated__fails), cmocka_unit_test(test__f_print_to_safely_terminated__returns_data_not), + cmocka_unit_test(test__f_print_to_safely_terminated__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_safely_terminated__works), cmocka_unit_test(test__f_print_to_terminated__fails), cmocka_unit_test(test__f_print_to_terminated__returns_data_not), + cmocka_unit_test(test__f_print_to_terminated__returns_file_descriptor_not), cmocka_unit_test(test__f_print_to_terminated__works), #ifndef _di_level_0_parameter_checking_ - cmocka_unit_test(test__f_print__parameter_checking), - cmocka_unit_test(test__f_print_character__parameter_checking), - cmocka_unit_test(test__f_print_character_safely__parameter_checking), + // f_print() doesn't use parameter checking. + // f_print_character() doesn't use parameter checking. + // f_print_character_safely() doesn't use parameter checking. // f_print_character_safely_get() doesn't use parameter checking. - cmocka_unit_test(test__f_print_dynamic__parameter_checking), - cmocka_unit_test(test__f_print_dynamic_partial__parameter_checking), - cmocka_unit_test(test__f_print_dynamic_partial_raw__parameter_checking), - cmocka_unit_test(test__f_print_dynamic_partial_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_dynamic_partial_safely__parameter_checking), - cmocka_unit_test(test__f_print_dynamic_raw__parameter_checking), - cmocka_unit_test(test__f_print_dynamic_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_dynamic_safely__parameter_checking), - cmocka_unit_test(test__f_print_except__parameter_checking), - cmocka_unit_test(test__f_print_except_dynamic__parameter_checking), - cmocka_unit_test(test__f_print_except_dynamic_partial__parameter_checking), - cmocka_unit_test(test__f_print_except_dynamic_partial_raw__parameter_checking), - cmocka_unit_test(test__f_print_except_dynamic_partial_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_except_dynamic_partial_safely__parameter_checking), - cmocka_unit_test(test__f_print_except_dynamic_raw__parameter_checking), - cmocka_unit_test(test__f_print_except_dynamic_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_except_dynamic_safely__parameter_checking), - cmocka_unit_test(test__f_print_except_in__parameter_checking), - cmocka_unit_test(test__f_print_except_in_dynamic__parameter_checking), - cmocka_unit_test(test__f_print_except_in_dynamic_partial__parameter_checking), - cmocka_unit_test(test__f_print_except_in_dynamic_partial_raw__parameter_checking), - cmocka_unit_test(test__f_print_except_in_dynamic_partial_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_except_in_dynamic_partial_safely__parameter_checking), - cmocka_unit_test(test__f_print_except_in_dynamic_raw__parameter_checking), - cmocka_unit_test(test__f_print_except_in_dynamic_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_except_in_dynamic_safely__parameter_checking), - cmocka_unit_test(test__f_print_except_in_raw__parameter_checking), - cmocka_unit_test(test__f_print_except_in_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_except_in_safely__parameter_checking), - cmocka_unit_test(test__f_print_except_raw__parameter_checking), - cmocka_unit_test(test__f_print_except_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_except_safely__parameter_checking), - cmocka_unit_test(test__f_print_raw__parameter_checking), - cmocka_unit_test(test__f_print_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_raw_terminated__parameter_checking), - cmocka_unit_test(test__f_print_safely__parameter_checking), + // f_print_dynamic() doesn't use parameter checking. + // f_print_dynamic_partial() doesn't use parameter checking. + // f_print_dynamic_partial_raw() doesn't use parameter checking. + // f_print_dynamic_partial_raw_safely() doesn't use parameter checking. + // f_print_dynamic_partial_safely() doesn't use parameter checking. + // f_print_dynamic_raw() doesn't use parameter checking. + // f_print_dynamic_raw_safely() doesn't use parameter checking. + // f_print_dynamic_safely() doesn't use parameter checking. + // f_print_except() doesn't use parameter checking. + // f_print_except_dynamic() doesn't use parameter checking. + // f_print_except_dynamic_partial() doesn't use parameter checking. + // f_print_except_dynamic_partial_raw() doesn't use parameter checking. + // f_print_except_dynamic_partial_raw_safely() doesn't use parameter checking. + // f_print_except_dynamic_partial_safely() doesn't use parameter checking. + // f_print_except_dynamic_raw() doesn't use parameter checking. + // f_print_except_dynamic_raw_safely() doesn't use parameter checking. + // f_print_except_dynamic_safely() doesn't use parameter checking. + // f_print_except_in() doesn't use parameter checking. + // f_print_except_in_dynamic() doesn't use parameter checking. + // f_print_except_in_dynamic_partial() doesn't use parameter checking. + // f_print_except_in_dynamic_partial_raw() doesn't use parameter checking. + // f_print_except_in_dynamic_partial_raw_safely() doesn't use parameter checking. + // f_print_except_in_dynamic_partial_safely() doesn't use parameter checking. + // f_print_except_in_dynamic_raw() doesn't use parameter checking. + // f_print_except_in_dynamic_raw_safely() doesn't use parameter checking. + // f_print_except_in_dynamic_safely() doesn't use parameter checking. + // f_print_except_in_raw() doesn't use parameter checking. + // f_print_except_in_raw_safely() doesn't use parameter checking. + // f_print_except_in_safely() doesn't use parameter checking. + // f_print_except_raw() doesn't use parameter checking. + // f_print_except_raw_safely() doesn't use parameter checking. + // f_print_except_safely() doesn't use parameter checking. + // f_print_raw() doesn't use parameter checking. + // f_print_raw_safely() doesn't use parameter checking. + // f_print_raw_terminated() doesn't use parameter checking. + // f_print_safely() doesn't use parameter checking. // f_print_safely_get() doesn't use parameter checking. - cmocka_unit_test(test__f_print_safely_terminated__parameter_checking), - cmocka_unit_test(test__f_print_terminated__parameter_checking), - cmocka_unit_test(test__f_print_to__parameter_checking), - cmocka_unit_test(test__f_print_to_character__parameter_checking), - cmocka_unit_test(test__f_print_to_character_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_dynamic__parameter_checking), - cmocka_unit_test(test__f_print_to_dynamic_partial__parameter_checking), - cmocka_unit_test(test__f_print_to_dynamic_partial_raw__parameter_checking), - cmocka_unit_test(test__f_print_to_dynamic_partial_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_dynamic_partial_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_dynamic_raw__parameter_checking), - cmocka_unit_test(test__f_print_to_dynamic_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_dynamic_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_except__parameter_checking), - cmocka_unit_test(test__f_print_to_except_dynamic__parameter_checking), - cmocka_unit_test(test__f_print_to_except_dynamic_partial__parameter_checking), - cmocka_unit_test(test__f_print_to_except_dynamic_partial_raw__parameter_checking), - cmocka_unit_test(test__f_print_to_except_dynamic_partial_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_except_dynamic_partial_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_except_dynamic_raw__parameter_checking), - cmocka_unit_test(test__f_print_to_except_dynamic_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_except_dynamic_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_except_in__parameter_checking), - cmocka_unit_test(test__f_print_to_except_in_dynamic__parameter_checking), - cmocka_unit_test(test__f_print_to_except_in_dynamic_partial__parameter_checking), - cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_raw__parameter_checking), - cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_except_in_dynamic_partial_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_except_in_dynamic_raw__parameter_checking), - cmocka_unit_test(test__f_print_to_except_in_dynamic_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_except_in_dynamic_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_except_in_raw__parameter_checking), - cmocka_unit_test(test__f_print_to_except_in_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_except_in_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_except_raw__parameter_checking), - cmocka_unit_test(test__f_print_to_except_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_except_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_raw__parameter_checking), - cmocka_unit_test(test__f_print_to_raw_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_raw_terminated__parameter_checking), - cmocka_unit_test(test__f_print_to_safely__parameter_checking), - cmocka_unit_test(test__f_print_to_safely_terminated__parameter_checking), - cmocka_unit_test(test__f_print_to_terminated__parameter_checking), + // f_print_safely_terminated() doesn't use parameter checking. + // f_print_terminated() doesn't use parameter checking. + // f_print_to() doesn't use parameter checking. + // f_print_to_character() doesn't use parameter checking. + // f_print_to_character_safely() doesn't use parameter checking. + // f_print_to_dynamic() doesn't use parameter checking. + // f_print_to_dynamic_partial() doesn't use parameter checking. + // f_print_to_dynamic_partial_raw() doesn't use parameter checking. + // f_print_to_dynamic_partial_raw_safely() doesn't use parameter checking. + // f_print_to_dynamic_partial_safely() doesn't use parameter checking. + // f_print_to_dynamic_raw() doesn't use parameter checking. + // f_print_to_dynamic_raw_safely() doesn't use parameter checking. + // f_print_to_dynamic_safely() doesn't use parameter checking. + // f_print_to_except() doesn't use parameter checking. + // f_print_to_except_dynamic() doesn't use parameter checking. + // f_print_to_except_dynamic_partial() doesn't use parameter checking. + // f_print_to_except_dynamic_partial_raw() doesn't use parameter checking. + // f_print_to_except_dynamic_partial_raw_safely() doesn't use parameter checking. + // f_print_to_except_dynamic_partial_safely() doesn't use parameter checking. + // f_print_to_except_dynamic_raw() doesn't use parameter checking. + // f_print_to_except_dynamic_raw_safely() doesn't use parameter checking. + // f_print_to_except_dynamic_safely() doesn't use parameter checking. + // f_print_to_except_in() doesn't use parameter checking. + // f_print_to_except_in_dynamic() doesn't use parameter checking. + // f_print_to_except_in_dynamic_partial() doesn't use parameter checking. + // f_print_to_except_in_dynamic_partial_raw() doesn't use parameter checking. + // f_print_to_except_in_dynamic_partial_raw_safely() doesn't use parameter checking. + // f_print_to_except_in_dynamic_partial_safely() doesn't use parameter checking. + // f_print_to_except_in_dynamic_raw() doesn't use parameter checking. + // f_print_to_except_in_dynamic_raw_safely() doesn't use parameter checking. + // f_print_to_except_in_dynamic_safely() doesn't use parameter checking. + // f_print_to_except_in_raw() doesn't use parameter checking. + // f_print_to_except_in_raw_safely() doesn't use parameter checking. + // f_print_to_except_in_safely() doesn't use parameter checking. + // f_print_to_except_raw() doesn't use parameter checking. + // f_print_to_except_raw_safely() doesn't use parameter checking. + // f_print_to_except_safely() doesn't use parameter checking. + // f_print_to_raw() doesn't use parameter checking. + // f_print_to_raw_safely() doesn't use parameter checking. + // f_print_to_raw_terminated() doesn't use parameter checking. + // f_print_to_safely() doesn't use parameter checking. + // f_print_to_safely_terminated() doesn't use parameter checking. + // f_print_to_terminated() doesn't use parameter checking. #endif // _di_level_0_parameter_checking_ }; diff --git a/level_0/f_signal/tests/unit/c/test-signal-wait.c b/level_0/f_signal/tests/unit/c/test-signal-wait.c index 1e00c29..71e5dfe 100644 --- a/level_0/f_signal/tests/unit/c/test-signal-wait.c +++ b/level_0/f_signal/tests/unit/c/test-signal-wait.c @@ -15,8 +15,8 @@ void test__f_signal_wait__fails(void **state) { f_status_t statuss[] = { F_interrupt, - F_parameter, - F_failure, + F_status_set_error(F_parameter), + F_status_set_error(F_failure), }; for (int i = 0; i < 3; ++i) { @@ -32,7 +32,7 @@ void test__f_signal_wait__fails(void **state) { const f_status_t status = f_signal_wait(&set, &information); - assert_int_equal(status, F_status_set_error(statuss[i])); + assert_int_equal(status, statuss[i]); } // for } diff --git a/level_0/f_signal/tests/unit/c/test-signal-wait_until.c b/level_0/f_signal/tests/unit/c/test-signal-wait_until.c index 4018ee3..a245d09 100644 --- a/level_0/f_signal/tests/unit/c/test-signal-wait_until.c +++ b/level_0/f_signal/tests/unit/c/test-signal-wait_until.c @@ -16,7 +16,7 @@ void test__f_signal_wait_until__fails(void **state) { f_status_t statuss[] = { F_time_out, - F_status_set_error(F_interrupt), + F_interrupt, F_status_set_error(F_parameter), F_status_set_error(F_failure), }; diff --git a/level_0/f_status_string/tests/unit/c/test-status_string-to.c b/level_0/f_status_string/tests/unit/c/test-status_string-to.c index f3b4335..26272ea 100644 --- a/level_0/f_status_string/tests/unit/c/test-status_string-to.c +++ b/level_0/f_status_string/tests/unit/c/test-status_string-to.c @@ -107,12 +107,16 @@ void test__f_status_string_to__works(void **state) { F_ascii_not, F_atomic, F_atomic_not, + F_base, + F_base_not, F_begin, F_begin_not, F_block, F_block_not, F_body, F_body_not, + F_bottom, + F_bottom_not, F_bound, F_bound_not, F_break, @@ -121,6 +125,8 @@ void test__f_status_string_to__works(void **state) { F_call_not, F_capability, F_capability_not, + F_character, + F_character_not, F_child, F_child_not, F_complete, @@ -191,6 +197,8 @@ void test__f_status_string_to__works(void **state) { F_failure_not, F_family, F_family_not, + F_fifo, + F_fifo_not, F_first, F_first_not, F_footer, @@ -207,10 +215,10 @@ void test__f_status_string_to__works(void **state) { F_group_not, F_halt, F_halt_not, - F_help, - F_help_not, F_header, F_header_not, + F_help, + F_help_not, F_ignore, F_ignore_not, F_implemented, @@ -244,6 +252,8 @@ void test__f_status_string_to__works(void **state) { F_memory_not, F_message, F_message_not, + F_middle, + F_middle_not, F_minor, F_minor_not, F_moderate, @@ -307,6 +317,8 @@ void test__f_status_string_to__works(void **state) { F_recover_not, F_recurse, F_recurse_not, + F_regular, + F_regular_not, F_relative, F_relative_not, F_remote, @@ -366,6 +378,8 @@ void test__f_status_string_to__works(void **state) { F_time_out, F_too_large, F_too_small, + F_top, + F_top_not, F_type, F_type_not, F_user, @@ -472,12 +486,14 @@ void test__f_status_string_to__works(void **state) { F_complete_not_utf_eof, F_complete_not_utf_eol, F_complete_not_utf_eos, + F_complete_not_utf_start, F_complete_not_utf_stop, F_none_block, F_none_eoa, F_none_eof, F_none_eol, F_none_eos, + F_none_start, F_none_stop, F_data, F_data_not, @@ -486,6 +502,7 @@ void test__f_status_string_to__works(void **state) { F_data_not_eof, F_data_not_eol, F_data_not_eos, + F_data_not_start, F_data_not_stop, F_end, F_end_not, @@ -500,6 +517,7 @@ void test__f_status_string_to__works(void **state) { F_end_not_group_eof, F_end_not_group_eol, F_end_not_group_eos, + F_end_not_group_start, F_end_not_group_stop, F_end_not_nest, F_end_not_nest_block, @@ -507,7 +525,9 @@ void test__f_status_string_to__works(void **state) { F_end_not_nest_eof, F_end_not_nest_eol, F_end_not_nest_eos, + F_end_not_nest_start, F_end_not_nest_stop, + F_end_not_start, F_end_not_stop, F_process, F_process_not, @@ -701,12 +721,16 @@ void test__f_status_string_to__works(void **state) { f_status_ascii_not_s, f_status_atomic_s, f_status_atomic_not_s, + f_status_base_s, + f_status_base_not_s, f_status_begin_s, f_status_begin_not_s, f_status_block_s, f_status_block_not_s, f_status_body_s, f_status_body_not_s, + f_status_bottom_s, + f_status_bottom_not_s, f_status_bound_s, f_status_bound_not_s, f_status_break_s, @@ -715,6 +739,8 @@ void test__f_status_string_to__works(void **state) { f_status_call_not_s, f_status_capability_s, f_status_capability_not_s, + f_status_character_s, + f_status_character_not_s, f_status_child_s, f_status_child_not_s, f_status_complete_s, @@ -785,6 +811,8 @@ void test__f_status_string_to__works(void **state) { f_status_failure_not_s, f_status_family_s, f_status_family_not_s, + f_status_fifo_s, + f_status_fifo_not_s, f_status_first_s, f_status_first_not_s, f_status_footer_s, @@ -801,10 +829,10 @@ void test__f_status_string_to__works(void **state) { f_status_group_not_s, f_status_halt_s, f_status_halt_not_s, - f_status_help_s, - f_status_help_not_s, f_status_header_s, f_status_header_not_s, + f_status_help_s, + f_status_help_not_s, f_status_ignore_s, f_status_ignore_not_s, f_status_implemented_s, @@ -838,6 +866,8 @@ void test__f_status_string_to__works(void **state) { f_status_memory_not_s, f_status_message_s, f_status_message_not_s, + f_status_middle_s, + f_status_middle_not_s, f_status_minor_s, f_status_minor_not_s, f_status_moderate_s, @@ -901,6 +931,8 @@ void test__f_status_string_to__works(void **state) { f_status_recover_not_s, f_status_recurse_s, f_status_recurse_not_s, + f_status_regular_s, + f_status_regular_not_s, f_status_relative_s, f_status_relative_not_s, f_status_remote_s, @@ -960,6 +992,8 @@ void test__f_status_string_to__works(void **state) { f_status_time_out_s, f_status_too_large_s, f_status_too_small_s, + f_status_top_s, + f_status_top_not_s, f_status_type_s, f_status_type_not_s, f_status_user_s, @@ -1066,12 +1100,14 @@ void test__f_status_string_to__works(void **state) { f_status_complete_not_utf_eof_s, f_status_complete_not_utf_eol_s, f_status_complete_not_utf_eos_s, + f_status_complete_not_utf_start_s, f_status_complete_not_utf_stop_s, f_status_none_block_s, f_status_none_eoa_s, f_status_none_eof_s, f_status_none_eol_s, f_status_none_eos_s, + f_status_none_start_s, f_status_none_stop_s, f_status_data_s, f_status_data_not_s, @@ -1080,6 +1116,7 @@ void test__f_status_string_to__works(void **state) { f_status_data_not_eof_s, f_status_data_not_eol_s, f_status_data_not_eos_s, + f_status_data_not_start_s, f_status_data_not_stop_s, f_status_end_s, f_status_end_not_s, @@ -1094,6 +1131,7 @@ void test__f_status_string_to__works(void **state) { f_status_end_not_group_eof_s, f_status_end_not_group_eol_s, f_status_end_not_group_eos_s, + f_status_end_not_group_start_s, f_status_end_not_group_stop_s, f_status_end_not_nest_s, f_status_end_not_nest_block_s, @@ -1101,7 +1139,9 @@ void test__f_status_string_to__works(void **state) { f_status_end_not_nest_eof_s, f_status_end_not_nest_eol_s, f_status_end_not_nest_eos_s, + f_status_end_not_nest_start_s, f_status_end_not_nest_stop_s, + f_status_end_not_start_s, f_status_end_not_stop_s, f_status_process_s, f_status_process_not_s, @@ -1217,7 +1257,7 @@ void test__f_status_string_to__works(void **state) { f_status_status_code_last_s, }; - for (uint16_t i = 0; i < 591; ++i) { + for (uint16_t i = 0; i < 611; ++i) { f_string_static_t result = f_string_static_t_initialize; diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphore_file_open.c b/level_0/f_thread/tests/unit/c/test-thread-semaphore_file_open.c index 5e972be..73efe5d 100644 --- a/level_0/f_thread/tests/unit/c/test-thread-semaphore_file_open.c +++ b/level_0/f_thread/tests/unit/c/test-thread-semaphore_file_open.c @@ -45,7 +45,7 @@ void test__f_thread_semaphore_file_open__fails(void **state) { will_return(__wrap_sem_open, true); will_return(__wrap_sem_open, errnos[i]); - const f_status_t status = f_thread_semaphore_file_open(name, flag, mode, value, &semaphore_ptr); + const f_status_t status = f_thread_semaphore_file_open(name, flag, &mode, value, &semaphore_ptr); assert_int_equal(status, F_status_set_error(statuss[i])); } // for @@ -57,7 +57,7 @@ void test__f_thread_semaphore_file_open__fails(void **state) { will_return(__wrap_sem_open, true); will_return(__wrap_sem_open, errnos[i]); - const f_status_t status = f_thread_semaphore_file_open(name, flag, mode, value, &semaphore_ptr); + const f_status_t status = f_thread_semaphore_file_open(name, flag, &mode, value, &semaphore_ptr); assert_int_equal(status, F_status_set_error(statuss[i])); } // for @@ -66,12 +66,22 @@ void test__f_thread_semaphore_file_open__fails(void **state) { void test__f_thread_semaphore_file_open__parameter_checking(void **state) { f_string_static_t name = macro_f_string_static_t_initialize_1("test", 0, 4); + f_thread_semaphore_t semaphore = f_thread_semaphore_t_initialize; + f_thread_semaphore_t *semaphore_ptr = &semaphore; int flag = 0; mode_t mode = 0; unsigned value = 0; { - const f_status_t status = f_thread_semaphore_file_open(name, flag, mode, value, 0); + const f_status_t status = f_thread_semaphore_file_open(name, flag, &mode, value, 0); + + assert_int_equal(status, F_status_set_error(F_parameter)); + } + + { + flag = O_CREAT; + + const f_status_t status = f_thread_semaphore_file_open(name, flag, 0, value, &semaphore_ptr); assert_int_equal(status, F_status_set_error(F_parameter)); } @@ -89,7 +99,7 @@ void test__f_thread_semaphore_file_open__works(void **state) { { will_return(__wrap_sem_open, false); - const f_status_t status = f_thread_semaphore_file_open(name, flag, mode, value, &semaphore_ptr); + const f_status_t status = f_thread_semaphore_file_open(name, flag, &mode, value, &semaphore_ptr); assert_int_equal(status, F_none); } @@ -100,7 +110,7 @@ void test__f_thread_semaphore_file_open__works(void **state) { will_return(__wrap_sem_open, false); - const f_status_t status = f_thread_semaphore_file_open(name, flag, mode, value, &semaphore_ptr); + const f_status_t status = f_thread_semaphore_file_open(name, flag, &mode, value, &semaphore_ptr); assert_int_equal(status, F_none); } diff --git a/level_1/fl_path/tests/unit/c/test-path-canonical.c b/level_1/fl_path/tests/unit/c/test-path-canonical.c index 657e760..112c11c 100644 --- a/level_1/fl_path/tests/unit/c/test-path-canonical.c +++ b/level_1/fl_path/tests/unit/c/test-path-canonical.c @@ -101,7 +101,7 @@ void test__fll_path_canonical__back_paths(void **state) { for (uint8_t i = 0; i < 24; ++i) { - const f_status_t status = fll_path_canonical(contents[i], &path); + const f_status_t status = fl_path_canonical(contents[i], &path); assert_int_equal(status, F_none); @@ -160,7 +160,7 @@ void test__fll_path_canonical__empty_becomes_pwd(void **state) { f_string_dynamic_t path = f_string_dynamic_t_initialize; { - const f_status_t status = fll_path_canonical(f_string_empty_s, &path); + const f_status_t status = fl_path_canonical(f_string_empty_s, &path); assert_int_equal(status, F_none); assert_int_equal(pwd_length, path.used); @@ -227,7 +227,7 @@ void test__fll_path_canonical__present_paths(void **state) { for (uint8_t i = 0; i < 18; ++i) { - const f_status_t status = fll_path_canonical(contents[i], &path); + const f_status_t status = fl_path_canonical(contents[i], &path); assert_int_equal(status, F_none); @@ -315,7 +315,7 @@ void test__fll_path_canonical__root_paths(void **state) { for (uint8_t i = 0; i < 18; ++i) { - const f_status_t status = fll_path_canonical(contents[i], &path); + const f_status_t status = fl_path_canonical(contents[i], &path); // Assert_string_equal() is NULL terminated, so ensure NULL termination at end of path.used. if (status == F_none) { @@ -423,7 +423,7 @@ void test__fll_path_canonical__tilde_remains(void **state) { for (uint8_t i = 0; i < 23; ++i) { - const f_status_t status = fll_path_canonical(contents[i], &path); + const f_status_t status = fl_path_canonical(contents[i], &path); assert_int_equal(status, F_none); @@ -472,7 +472,7 @@ void test__fll_path_canonical__tilde_remains(void **state) { void test__fll_path_canonical__parameter_checking(void **state) { { - const f_status_t status = fll_path_canonical(f_string_empty_s, 0); + const f_status_t status = fl_path_canonical(f_string_empty_s, 0); assert_int_equal(status, F_status_set_error(F_parameter)); } diff --git a/level_1/fl_path/tests/unit/c/test-path-canonical.h b/level_1/fl_path/tests/unit/c/test-path-canonical.h index 6114e90..9b5f7ca 100644 --- a/level_1/fl_path/tests/unit/c/test-path-canonical.h +++ b/level_1/fl_path/tests/unit/c/test-path-canonical.h @@ -13,42 +13,42 @@ /** * Test that function works with back paths (such as '../'). * - * @see fll_path_canonical() + * @see fl_path_canonical() */ extern void test__fll_path_canonical__back_paths(void **state); /** * Test that function returns the present working directory when path is an empty string. * - * @see fll_path_canonical() + * @see fl_path_canonical() */ extern void test__fll_path_canonical__empty_becomes_pwd(void **state); /** * Test that function works with present directory paths. * - * @see fll_path_canonical() + * @see fl_path_canonical() */ extern void test__fll_path_canonical__present_paths(void **state); /** * Test that function works with root paths. * - * @see fll_path_canonical() + * @see fl_path_canonical() */ extern void test__fll_path_canonical__root_paths(void **state); /** * Test that function returns the string without expanding the tilde. * - * @see fll_path_canonical() + * @see fl_path_canonical() */ extern void test__fll_path_canonical__tilde_remains(void **state); /** * Test that parameter checking works as expected. * - * @see fll_path_canonical() + * @see fl_path_canonical() */ extern void test__fll_path_canonical__parameter_checking(void **state); diff --git a/level_1/fl_status_string/data/build/testfile b/level_1/fl_status_string/data/build/testfile index ea657b5..d62b69f 100644 --- a/level_1/fl_status_string/data/build/testfile +++ b/level_1/fl_status_string/data/build/testfile @@ -23,14 +23,14 @@ main: operate ld_library_path - if exist build/programs/shared/test-fll_status_string - shell build/programs/shared/test-fll_status_string + if exist build/programs/shared/test-fl_status_string + shell build/programs/shared/test-fl_status_string - if exist build/programs/static/test-fll_status_string - shell build/programs/static/test-fll_status_string + if exist build/programs/static/test-fl_status_string + shell build/programs/static/test-fl_status_string - if not exist build/programs/shared/test-fll_status_string - and not exist build/programs/static/test-fll_status_string + if not exist build/programs/shared/test-fl_status_string + and not exist build/programs/static/test-fl_status_string operate not_created not_created: -- 1.8.3.1