I opted to perform the bare minimum needed tests due to the size of this.
Eventually I need to check to see that the correct characters are printed.
--- /dev/null
+# fss-0001
+
+cmocka 1.*
--- /dev/null
+# fss-0001
+#
+# Build the project with appropriate mocks linked in via the dynamic linker's "--wrap" functionality.
+#
+# The -Wl,--wrap does not work across shared files.
+# Therefore, this file is a work-around to inject the mocks into the library for testing purposes.
+# This should exactly match the "settings" file, except for the additional "-Wl,--wrap" parts and the additional mock source file.
+#
+# The flags -o0 must be passed to prevent the compiler from optimizing away any functions being mocked (which results in the mock not happening and a real function being called).
+# Alternatively, figure out which optimization that is disabled by -o0 and have that specific optimization disabled.
+#
+
+build_name f_print
+
+version_major 0
+version_minor 5
+version_micro 9
+version_file micro
+version_target minor
+
+modes individual clang test coverage
+modes_default individual
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc
+build_libraries-individual -lf_memory -lf_string -lf_utf
+
+build_sources_library print.c private-print.c print/common.c print/to.c print/private-to.c ../../tests/unit/c/mock-print.c
+
+build_sources_headers print.h print/common.h print/to.h
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers fll/level_0
+path_library_script script
+path_library_shared shared
+path_library_static static
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+flags -O0 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
+flags-clang -Wno-logical-op-parentheses
+flags-test -fstack-protector -Wall
+flags-coverage --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+
+# Inject mocks.
+flags -Wl,--wrap=clearerr_unlocked
+flags -Wl,--wrap=ferror_unlocked
+flags -Wl,--wrap=fwrite_unlocked
+flags -Wl,--wrap=write
--- /dev/null
+# fss-0001
+#
+# Builds a program that is links to the generated library and is executed to perform tests.
+#
+# Memory leaks in the test program can be checked for by running valgrind with this executable.
+#
+
+build_name test-f_print
+
+version_major 0
+version_minor 5
+version_micro 9
+version_file major
+version_target major
+
+modes individual clang test coverage
+modes_default individual
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lcmocka
+build_libraries-individual -lf_memory -lf_string -lf_type_array -lf_print -lf_utf
+
+build_sources_program test-print-.c
+build_sources_program test-print-character.c test-print-character_safely.c test-print-character_safely_get.c
+build_sources_program test-print-dynamic.c test-print-dynamic_partial.c test-print-dynamic_partial_raw.c test-print-dynamic_partial_raw_safely.c test-print-dynamic_partial_safely.c test-print-dynamic_raw.c test-print-dynamic_raw_safely.c test-print-dynamic_safely.c
+build_sources_program test-print-except_dynamic.c test-print-except_dynamic_partial.c test-print-except_dynamic_partial_raw.c test-print-except_dynamic_partial_raw_safely.c test-print-except_dynamic_partial_safely.c test-print-except_dynamic_raw.c test-print-except_dynamic_raw_safely.c test-print-except_dynamic_safely.c
+build_sources_program test-print-except_in_dynamic.c test-print-except_in_dynamic_partial.c test-print-except_in_dynamic_partial_raw.c test-print-except_in_dynamic_partial_raw_safely.c test-print-except_in_dynamic_partial_safely.c test-print-except_in_dynamic_raw.c test-print-except_in_dynamic_raw_safely.c test-print-except_in_dynamic_safely.c
+build_sources_program test-print-except.c test-print-except_in.c test-print-except_in_raw.c test-print-except_in_raw_safely.c test-print-except_in_safely.c
+build_sources_program test-print-except_raw.c test-print-except_raw_safely.c test-print-except_safely.c
+build_sources_program test-print-raw.c test-print-raw_safely.c test-print-raw_terminated.c
+build_sources_program test-print-safely.c test-print-safely_get.c test-print-safely_terminated.c
+build_sources_program test-print-terminated.c
+build_sources_program test-print-to.c
+build_sources_program test-print-to_character.c test-print-to_character_safely.c
+build_sources_program test-print-to_dynamic.c test-print-to_dynamic_partial.c test-print-to_dynamic_partial_raw.c test-print-to_dynamic_partial_raw_safely.c test-print-to_dynamic_partial_safely.c test-print-to_dynamic_raw.c test-print-to_dynamic_raw_safely.c test-print-to_dynamic_safely.c
+build_sources_program test-print-to_except_dynamic.c test-print-to_except_dynamic_partial.c test-print-to_except_dynamic_partial_raw.c test-print-to_except_dynamic_partial_raw_safely.c test-print-to_except_dynamic_partial_safely.c test-print-to_except_dynamic_raw.c test-print-to_except_dynamic_raw_safely.c test-print-to_except_dynamic_safely.c
+build_sources_program test-print-to_except_in_dynamic.c test-print-to_except_in_dynamic_partial.c test-print-to_except_in_dynamic_partial_raw.c test-print-to_except_in_dynamic_partial_raw_safely.c test-print-to_except_in_dynamic_partial_safely.c test-print-to_except_in_dynamic_raw.c test-print-to_except_in_dynamic_raw_safely.c test-print-to_except_in_dynamic_safely.c
+build_sources_program test-print-to_except.c test-print-to_except_in.c test-print-to_except_in_raw.c test-print-to_except_in_raw_safely.c test-print-to_except_in_safely.c
+build_sources_program test-print-to_except_raw.c test-print-to_except_raw_safely.c test-print-to_except_safely.c
+build_sources_program test-print-to_raw.c test-print-to_raw_safely.c test-print-to_raw_terminated.c
+build_sources_program test-print-to_safely.c test-print-to_safely_terminated.c
+build_sources_program test-print-to_terminated.c
+build_sources_program test-print.c
+
+build_script no
+build_shared yes
+build_static no
+
+path_headers tests/unit/c
+path_sources tests/unit/c
+
+has_path_standard no
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+defines -Ibuild/includes
+defines_static -Lbuild/libraries/static
+defines_shared -Lbuild/libraries/shared
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
+flags-clang -Wno-logical-op-parentheses
+flags-test -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_program -fPIE
--- /dev/null
+# fss-0005 iki-0002
+
+settings:
+ load_build yes
+ fail exit
+
+ environment LD_LIBRARY_PATH
+ environment CMOCKA_XML_FILE CMOCKA_MESSAGE_OUTPUT CMOCKA_TEST_ABORT
+
+ # Cmcka is not fully thread-safe, set this to "1" to have cmocka call abort() on a test failure.
+ #CMOCKA_TEST_ABORT 1
+
+ # One of: STDOUT, SUBUNIT, TAP, or XML.
+ #define CMOCKA_MESSAGE_OUTPUT STDOUT
+
+ # When in "XML" output mode, output to this file rather than stdout.
+ #define CMOCKA_XML_FILE ./out.xml
+
+main:
+ build settings-mocks
+ build settings-tests
+
+ operate ld_library_path
+
+ if exists build/programs/shared/test-f_print
+ shell build/programs/shared/test-f_print
+
+ if exists build/programs/static/test-f_print
+ shell build/programs/static/test-f_print
+
+ if not exists build/programs/shared/test-f_print
+ and not exists build/programs/static/test-f_print
+ operate not_created
+
+not_created:
+ print
+ print 'context:"error"Failed to test due to being unable to find either a shared or static test binary to perform tests. context:"reset"'
+
+ exit failure
+
+ld_library_path:
+ if defined environment LD_LIBRARY_PATH
+ and defined parameter work
+ define LD_LIBRARY_PATH 'build/libraries/shared:parameter:"work:value"libraries/shared:define:"LD_LIBRARY_PATH"'
+
+ else
+ if defined environment LD_LIBRARY_PATH
+ define LD_LIBRARY_PATH 'build/libraries/shared:parameter:define:"LD_LIBRARY_PATH"'
+
+ else
+ if defined parameter work
+ define LD_LIBRARY_PATH 'build/libraries/shared:parameter:"work:value"libraries/shared'
+
+ else
+ define LD_LIBRARY_PATH build/libraries/shared
--- /dev/null
+#include "mock-print.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void __wrap_clearerr_unlocked(FILE *stream) {
+}
+
+int __wrap_ferror_unlocked(FILE *stream) {
+
+ return mock_type(int);
+}
+
+size_t __wrap_fwrite_unlocked(const void *ptr, size_t size, size_t n, FILE *stream) {
+
+ return mock_type(size_t);
+}
+
+ssize_t __wrap_write(int fd, const void *buf, size_t count) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ errno = mock_type(int);
+
+ return -1;
+ }
+
+ return mock_type(ssize_t);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _MOCK__print_h
+#define _MOCK__print_h
+
+// Libc includes.
+#include <stdarg.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <stdint.h>
+
+// cmocka includes.
+#include <cmocka.h>
+
+// FLL-0 includes.
+#include <fll/level_0/print.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+const static int mock_errno_generic = 32767;
+
+extern void __wrap_clearerr_unlocked(FILE *stream);
+extern int __wrap_ferror_unlocked(FILE *stream);
+extern size_t __wrap_fwrite_unlocked(const void *ptr, size_t size, size_t n, FILE *stream);
+extern ssize_t __wrap_write(int fd, const void *buf, size_t count);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _MOCK__print_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print(test.string, test.used, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print(test.string, test.used, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print(f_string_empty_s.string, f_string_empty_s.used, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print(test.string, f_string_empty_s.used, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print(0, test.used, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print(test.string, test.used, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print__h
+#define _TEST__F_print__h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print()
+ */
+extern void test__f_print__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print()
+ */
+extern void test__f_print__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print()
+ */
+extern void test__f_print__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print()
+ */
+extern void test__f_print__works(void **state);
+
+#endif // _TEST__F_print__h
--- /dev/null
+#include "test-print.h"
+#include "test-print-character.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_character__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+
+ const f_status_t status = f_print_character(test.string[0], stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_character__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_character(test.string[0], 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_character__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 1);
+
+ const f_status_t status = f_print_character(test.string[0], stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_character_h
+#define _TEST__F_print_character_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_character()
+ */
+extern void test__f_print_character__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_character()
+ */
+extern void test__f_print_character__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_character()
+ */
+extern void test__f_print_character__works(void **state);
+
+#endif // _TEST__F_print_character_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-character_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_character_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+
+ const f_status_t status = f_print_character_safely(test.string[0], stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+
+ const f_status_t status = f_print_character_safely((f_char_t) 0x7f, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+
+ const f_status_t status = f_print_character_safely((f_char_t) F_utf_byte_1_d, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+
+ {
+ const f_string_static_t alternate = macro_f_string_static_t_initialize("è ‡", 0, 2);
+
+ will_return(__wrap_fwrite_unlocked, 0);
+
+ const f_status_t status = f_print_character_safely(alternate.string[0], stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+
+ const f_status_t status = f_print_character_safely(test.string[0], stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_character_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_character_safely(test.string[0], 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_character_safely__returns_utf(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("è ‡", 0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 1);
+
+ const f_status_t status = f_print_character_safely(test.string[0], stdout);
+
+ assert_int_equal(status, F_utf);
+ }
+}
+
+void test__f_print_character_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, f_print_sequence_delete_s.used);
+
+ const f_status_t status = f_print_character_safely((f_char_t) 0x7f, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ will_return(__wrap_fwrite_unlocked, f_print_sequence_unknown_s.used);
+
+ const f_status_t status = f_print_character_safely((f_char_t) F_utf_byte_1_d, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ will_return(__wrap_fwrite_unlocked, 1);
+
+ const f_status_t status = f_print_character_safely(test.string[0], stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_character_safely_h
+#define _TEST__F_print_character_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_character_safely()
+ */
+extern void test__f_print_character_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_character_safely()
+ */
+extern void test__f_print_character_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_utf.
+ *
+ * @see f_print_character_safely()
+ */
+extern void test__f_print_character_safely__returns_utf(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_character_safely()
+ */
+extern void test__f_print_character_safely__works(void **state);
+
+#endif // _TEST__F_print_character_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-character_safely_get.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_character_safely_get__returns_character_control(void **state) {
+
+ for (uint8_t i = 0; i < 32 ; ++i) {
+
+ const f_char_t character = (f_char_t) i;
+
+ const f_string_static_t safe = f_print_character_safely_get(character);
+
+ assert_int_equal(safe.used, f_print_sequence_set_control_s[i].used);
+ assert_string_equal(safe.string, f_print_sequence_set_control_s[i].string);
+ } // for
+}
+
+void test__f_print_character_safely_get__returns_character_delete(void **state) {
+
+ const f_char_t character = (f_char_t) 0x7f;
+
+ {
+ const f_string_static_t safe = f_print_character_safely_get(character);
+
+ assert_int_equal(safe.used, f_print_sequence_delete_s.used);
+ assert_string_equal(safe.string, f_print_sequence_delete_s.string);
+ }
+}
+
+void test__f_print_character_safely_get__returns_character_unknown(void **state) {
+
+ const f_char_t character = (f_char_t) F_utf_byte_1_d;
+
+ {
+ const f_string_static_t safe = f_print_character_safely_get(character);
+
+ assert_int_equal(safe.used, f_print_sequence_unknown_s.used);
+ assert_string_equal(safe.string, f_print_sequence_unknown_s.string);
+ }
+}
+
+void test__f_print_character_safely_get__returns_empty(void **state) {
+
+ {
+ const f_char_t character = 'a';
+
+ const f_string_static_t safe = f_print_character_safely_get(character);
+
+ assert_int_equal(safe.used, f_string_empty_s.used);
+ assert_string_equal(safe.string, f_string_empty_s.string);
+ }
+
+ {
+ const f_string_t string = "è ‡";
+
+ const f_string_static_t safe = f_print_character_safely_get(string[0]);
+
+ assert_int_equal(safe.used, f_string_empty_s.used);
+ assert_string_equal(safe.string, f_string_empty_s.string);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_character_safely_get_h
+#define _TEST__F_print_character_safely_get_h
+
+/**
+ * Test that function works but returns a control character safe alternative.
+ *
+ * @see f_print_character_safely_get()
+ */
+extern void test__f_print_character_safely_get__returns_character_control(void **state);
+
+/**
+ * Test that function works but returns a delete character safe alternative.
+ *
+ * @see f_print_character_safely_get()
+ */
+extern void test__f_print_character_safely_get__returns_character_delete(void **state);
+
+/**
+ * Test that function works but returns a unknown character safe alternative.
+ *
+ * @see f_print_character_safely_get()
+ */
+extern void test__f_print_character_safely_get__returns_character_unknown(void **state);
+
+/**
+ * Test that function works but returns an empty string.
+ *
+ * @see f_print_character_safely_get()
+ */
+extern void test__f_print_character_safely_get__returns_empty(void **state);
+
+#endif // _TEST__F_print_character_safely_get_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-dynamic.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_dynamic__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_dynamic(test, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_dynamic__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_dynamic(test, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_dynamic__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_dynamic(f_string_empty_s, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_dynamic__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_dynamic(test, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_dynamic_h
+#define _TEST__F_print_dynamic_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_dynamic()
+ */
+extern void test__f_print_dynamic__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_dynamic()
+ */
+extern void test__f_print_dynamic__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_dynamic()
+ */
+extern void test__f_print_dynamic__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_dynamic()
+ */
+extern void test__f_print_dynamic__works(void **state);
+
+#endif // _TEST__F_print_dynamic_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-dynamic_partial.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_dynamic_partial__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_dynamic_partial(test, partial, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_dynamic_partial__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_dynamic_partial(test, partial, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_dynamic_partial__returns_data_not(void **state) {
+
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_dynamic_partial(f_string_empty_s, partial, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_dynamic_partial__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_dynamic_partial(test, partial, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_dynamic_partial_h
+#define _TEST__F_print_dynamic_partial_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_dynamic_partial()
+ */
+extern void test__f_print_dynamic_partial__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_dynamic_partial()
+ */
+extern void test__f_print_dynamic_partial__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_dynamic_partial()
+ */
+extern void test__f_print_dynamic_partial__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_dynamic_partial()
+ */
+extern void test__f_print_dynamic_partial__works(void **state);
+
+#endif // _TEST__F_print_dynamic_partial_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-dynamic_partial_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_dynamic_partial_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_dynamic_partial_raw(test, partial, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_dynamic_partial_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_dynamic_partial_raw(test, partial, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_dynamic_partial_raw__returns_data_not(void **state) {
+
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_dynamic_partial_raw(f_string_empty_s, partial, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_dynamic_partial_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_dynamic_partial_raw(test, partial, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_dynamic_partial_raw_h
+#define _TEST__F_print_dynamic_partial_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_dynamic_partial_raw()
+ */
+extern void test__f_print_dynamic_partial_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_dynamic_partial_raw()
+ */
+extern void test__f_print_dynamic_partial_raw__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_dynamic_partial_raw()
+ */
+extern void test__f_print_dynamic_partial_raw__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_dynamic_partial_raw()
+ */
+extern void test__f_print_dynamic_partial_raw__works(void **state);
+
+#endif // _TEST__F_print_dynamic_partial_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-dynamic_partial_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_dynamic_partial_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_dynamic_partial_raw_safely(test, partial, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_dynamic_partial_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_dynamic_partial_raw_safely(test, partial, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_dynamic_partial_raw_safely__returns_data_not(void **state) {
+
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_dynamic_partial_raw_safely(f_string_empty_s, partial, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_dynamic_partial_raw_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_dynamic_partial_raw_safely(test, partial, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_dynamic_partial_raw_safely_h
+#define _TEST__F_print_dynamic_partial_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_dynamic_partial_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_dynamic_partial_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_dynamic_partial_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_dynamic_partial_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-dynamic_partial_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_dynamic_partial_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_dynamic_partial_safely(test, partial, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_dynamic_partial_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_dynamic_partial_safely(test, partial, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_dynamic_partial_safely__returns_data_not(void **state) {
+
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_dynamic_partial_safely(f_string_empty_s, partial, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_dynamic_partial_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_dynamic_partial_safely(test, partial, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_dynamic_partial_safely_h
+#define _TEST__F_print_dynamic_partial_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_dynamic_partial_safely()
+ */
+extern void test__f_print_dynamic_partial_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_dynamic_partial_safely()
+ */
+extern void test__f_print_dynamic_partial_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_dynamic_partial_safely()
+ */
+extern void test__f_print_dynamic_partial_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_dynamic_partial_safely()
+ */
+extern void test__f_print_dynamic_partial_safely__works(void **state);
+
+#endif // _TEST__F_print_dynamic_partial_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-dynamic_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_dynamic_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_dynamic_raw(test, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_dynamic_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_dynamic_raw(test, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_dynamic_raw__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_dynamic_raw(f_string_empty_s, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_dynamic_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_dynamic_raw(test, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_dynamic_raw_h
+#define _TEST__F_print_dynamic_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_dynamic_raw()
+ */
+extern void test__f_print_dynamic_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_dynamic_raw()
+ */
+extern void test__f_print_dynamic_raw__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_dynamic_raw()
+ */
+extern void test__f_print_dynamic_raw__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_dynamic_raw()
+ */
+extern void test__f_print_dynamic_raw__works(void **state);
+
+#endif // _TEST__F_print_dynamic_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-dynamic_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_dynamic_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_dynamic_raw_safely(test, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_dynamic_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_dynamic_raw_safely(test, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_dynamic_raw_safely__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_dynamic_raw_safely(f_string_empty_s, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_dynamic_raw_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_dynamic_raw_safely(test, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_dynamic_raw_safely_h
+#define _TEST__F_print_dynamic_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_dynamic_raw_safely()
+ */
+extern void test__f_print_dynamic_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_dynamic_raw_safely()
+ */
+extern void test__f_print_dynamic_raw_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_dynamic_raw_safely()
+ */
+extern void test__f_print_dynamic_raw_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_dynamic_raw_safely()
+ */
+extern void test__f_print_dynamic_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_dynamic_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-dynamic_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_dynamic_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_dynamic_safely(test, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_dynamic_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_dynamic_safely(test, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_dynamic_safely__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_dynamic_safely(f_string_empty_s, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_dynamic_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_dynamic_safely(test, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_dynamic_safely_h
+#define _TEST__F_print_dynamic_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_dynamic_safely()
+ */
+extern void test__f_print_dynamic_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_dynamic_safely()
+ */
+extern void test__f_print_dynamic_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_dynamic_safely()
+ */
+extern void test__f_print_dynamic_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_dynamic_safely()
+ */
+extern void test__f_print_dynamic_safely__works(void **state);
+
+#endif // _TEST__F_print_dynamic_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except(test.string, 0, test.used, except, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_except(test.string, 0, test.used, except, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_except(0, 0, test.used, except, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except(test.string, 0, test.used, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except(test.string, 2, test.used, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except(test.string, 1, test.used, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_h
+#define _TEST__F_print_except_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except()
+ */
+extern void test__f_print_except__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except()
+ */
+extern void test__f_print_except__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_except()
+ */
+extern void test__f_print_except__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except()
+ */
+extern void test__f_print_except__works(void **state);
+
+#endif // _TEST__F_print_except_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_dynamic.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_dynamic__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_dynamic(test, except, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_dynamic__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_except_dynamic(test, except, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_dynamic__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_except_dynamic(f_string_empty_s, except, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_dynamic__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic(test, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic(test, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_dynamic_h
+#define _TEST__F_print_except_dynamic_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_dynamic()
+ */
+extern void test__f_print_except_dynamic__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_dynamic()
+ */
+extern void test__f_print_except_dynamic__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_except_dynamic()
+ */
+extern void test__f_print_except_dynamic__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_dynamic()
+ */
+extern void test__f_print_except_dynamic__works(void **state);
+
+#endif // _TEST__F_print_except_dynamic_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_dynamic_partial.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_dynamic_partial__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_dynamic_partial(test, partial, except, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_dynamic_partial__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_except_dynamic_partial(test, partial, except, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_dynamic_partial__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_except_dynamic_partial(f_string_empty_s, partial, except, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_dynamic_partial__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_partial(test, partial, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_partial(test, partial, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_dynamic_partial_h
+#define _TEST__F_print_except_dynamic_partial_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_dynamic_partial()
+ */
+extern void test__f_print_except_dynamic_partial__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_dynamic_partial()
+ */
+extern void test__f_print_except_dynamic_partial__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_except_dynamic_partial()
+ */
+extern void test__f_print_except_dynamic_partial__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_dynamic_partial()
+ */
+extern void test__f_print_except_dynamic_partial__works(void **state);
+
+#endif // _TEST__F_print_except_dynamic_partial_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_dynamic_partial_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_dynamic_partial_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_dynamic_partial_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_dynamic_partial_raw__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_except_dynamic_partial_raw(f_string_empty_s, partial, except, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_dynamic_partial_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_dynamic_partial_raw_h
+#define _TEST__F_print_except_dynamic_partial_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_dynamic_partial_raw()
+ */
+extern void test__f_print_except_dynamic_partial_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_dynamic_partial_raw()
+ */
+extern void test__f_print_except_dynamic_partial_raw__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_dynamic_partial_raw()
+ */
+extern void test__f_print_except_dynamic_partial_raw__works(void **state);
+
+#endif // _TEST__F_print_except_dynamic_partial_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_dynamic_partial_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_dynamic_partial_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_dynamic_partial_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_dynamic_partial_raw_safely__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_except_dynamic_partial_raw_safely(f_string_empty_s, partial, except, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_dynamic_partial_raw_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_dynamic_partial_raw_safely_h
+#define _TEST__F_print_except_dynamic_partial_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_except_dynamic_partial_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_except_dynamic_partial_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_except_dynamic_partial_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_except_dynamic_partial_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_dynamic_partial_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_dynamic_partial_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_dynamic_partial_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_dynamic_partial_safely__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_except_dynamic_partial_safely(f_string_empty_s, partial, except, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_dynamic_partial_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_dynamic_partial_safely_h
+#define _TEST__F_print_except_dynamic_partial_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_dynamic_partial_safely()
+ */
+extern void test__f_print_except_dynamic_partial_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_dynamic_partial_safely()
+ */
+extern void test__f_print_except_dynamic_partial_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_dynamic_partial_safely()
+ */
+extern void test__f_print_except_dynamic_partial_safely__works(void **state);
+
+#endif // _TEST__F_print_except_dynamic_partial_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_dynamic_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_dynamic_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_dynamic_raw(test, except, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_dynamic_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_except_dynamic_raw(test, except, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_dynamic_raw__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_except_dynamic_raw(f_string_empty_s, except, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_dynamic_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_raw(test, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_raw(test, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_dynamic_raw_h
+#define _TEST__F_print_except_dynamic_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_dynamic_raw()
+ */
+extern void test__f_print_except_dynamic_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_dynamic_raw()
+ */
+extern void test__f_print_except_dynamic_raw__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_except_dynamic_raw()
+ */
+extern void test__f_print_except_dynamic_raw__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_dynamic_raw()
+ */
+extern void test__f_print_except_dynamic_raw__works(void **state);
+
+#endif // _TEST__F_print_except_dynamic_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_dynamic_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_dynamic_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_dynamic_raw_safely(test, except, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_dynamic_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_except_dynamic_raw_safely(test, except, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_dynamic_raw_safely__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_except_dynamic_raw_safely(f_string_empty_s, except, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_dynamic_raw_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_raw_safely(test, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_raw_safely(test, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_dynamic_raw_safely_h
+#define _TEST__F_print_except_dynamic_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_dynamic_raw_safely()
+ */
+extern void test__f_print_except_dynamic_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_dynamic_raw_safely()
+ */
+extern void test__f_print_except_dynamic_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_dynamic_raw_safely()
+ */
+extern void test__f_print_except_dynamic_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_except_dynamic_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_dynamic_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_dynamic_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_dynamic_safely(test, except, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_dynamic_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_except_dynamic_safely(test, except, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_dynamic_safely__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_except_dynamic_safely(f_string_empty_s, except, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_dynamic_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_safely(test, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_dynamic_safely(test, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_dynamic_safely_h
+#define _TEST__F_print_except_dynamic_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_dynamic_safely()
+ */
+extern void test__f_print_except_dynamic_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_dynamic_safely()
+ */
+extern void test__f_print_except_dynamic_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_except_dynamic_safely()
+ */
+extern void test__f_print_except_dynamic_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_dynamic_safely()
+ */
+extern void test__f_print_except_dynamic_safely__works(void **state);
+
+#endif // _TEST__F_print_except_dynamic_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_in.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_in__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_in(test.string, 0, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_in__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(test.string, 0, test.used, except, range, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_in__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_except_in(0, 0, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_in__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in(test.string, 0, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in(test.string, 2, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in(test.string, 1, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_in_h
+#define _TEST__F_print_except_in_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_in()
+ */
+extern void test__f_print_except_in__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_in()
+ */
+extern void test__f_print_except_in__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_except_in()
+ */
+extern void test__f_print_except_in__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_in()
+ */
+extern void test__f_print_except_in__works(void **state);
+
+#endif // _TEST__F_print_except_in_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_in_dynamic.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_in_dynamic__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_in_dynamic(test, except, range, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_in_dynamic__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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_dynamic(test, except, range, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_in_dynamic__returns_data_not(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_status_t status = f_print_except_in_dynamic(f_string_empty_s, except, range, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_in_dynamic__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic(test, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic(test, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_in_dynamic_h
+#define _TEST__F_print_except_in_dynamic_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_in_dynamic()
+ */
+extern void test__f_print_except_in_dynamic__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_in_dynamic()
+ */
+extern void test__f_print_except_in_dynamic__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_except_in_dynamic()
+ */
+extern void test__f_print_except_in_dynamic__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_in_dynamic()
+ */
+extern void test__f_print_except_in_dynamic__works(void **state);
+
+#endif // _TEST__F_print_except_in_dynamic_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_in_dynamic_partial.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_in_dynamic_partial__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_in_dynamic_partial__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_in_dynamic_partial__returns_data_not(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(0, 2);
+
+ {
+ const f_status_t status = f_print_except_in_dynamic_partial(f_string_empty_s, partial, except, range, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_in_dynamic_partial__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_in_dynamic_partial_h
+#define _TEST__F_print_except_in_dynamic_partial_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_in_dynamic_partial()
+ */
+extern void test__f_print_except_in_dynamic_partial__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_in_dynamic_partial()
+ */
+extern void test__f_print_except_in_dynamic_partial__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_in_dynamic_partial()
+ */
+extern void test__f_print_except_in_dynamic_partial__works(void **state);
+
+#endif // _TEST__F_print_except_in_dynamic_partial_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_in_dynamic_partial_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_in_dynamic_partial_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_in_dynamic_partial_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_in_dynamic_partial_raw__returns_data_not(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(0, 2);
+
+ {
+ const f_status_t status = f_print_except_in_dynamic_partial_raw(f_string_empty_s, partial, except, range, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_in_dynamic_partial_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_in_dynamic_partial_raw_h
+#define _TEST__F_print_except_in_dynamic_partial_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_in_dynamic_partial_raw()
+ */
+extern void test__f_print_except_in_dynamic_partial_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_in_dynamic_partial_raw()
+ */
+extern void test__f_print_except_in_dynamic_partial_raw__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_in_dynamic_partial_raw()
+ */
+extern void test__f_print_except_in_dynamic_partial_raw__works(void **state);
+
+#endif // _TEST__F_print_except_in_dynamic_partial_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_in_dynamic_partial_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_in_dynamic_partial_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_in_dynamic_partial_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_in_dynamic_partial_raw_safely__returns_data_not(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(0, 2);
+
+ {
+ const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(f_string_empty_s, partial, except, range, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+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("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_in_dynamic_partial_raw_safely_h
+#define _TEST__F_print_except_in_dynamic_partial_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_in_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_except_in_dynamic_partial_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_in_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_except_in_dynamic_partial_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_in_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_except_in_dynamic_partial_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_except_in_dynamic_partial_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_in_dynamic_partial_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_in_dynamic_partial_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_in_dynamic_partial_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_in_dynamic_partial_safely__returns_data_not(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(0, 2);
+
+ {
+ const f_status_t status = f_print_except_in_dynamic_partial_safely(f_string_empty_s, partial, except, range, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_in_dynamic_partial_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_in_dynamic_partial_safely_h
+#define _TEST__F_print_except_in_dynamic_partial_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_in_dynamic_partial_safely()
+ */
+extern void test__f_print_except_in_dynamic_partial_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_in_dynamic_partial_safely()
+ */
+extern void test__f_print_except_in_dynamic_partial_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_in_dynamic_partial_safely()
+ */
+extern void test__f_print_except_in_dynamic_partial_safely__works(void **state);
+
+#endif // _TEST__F_print_except_in_dynamic_partial_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_in_dynamic_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_in_dynamic_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_in_dynamic_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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_dynamic_raw(test, except, range, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_in_dynamic_raw__returns_data_not(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_status_t status = f_print_except_in_dynamic_raw(f_string_empty_s, except, range, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_in_dynamic_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_in_dynamic_raw_h
+#define _TEST__F_print_except_in_dynamic_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_in_dynamic_raw()
+ */
+extern void test__f_print_except_in_dynamic_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_in_dynamic_raw()
+ */
+extern void test__f_print_except_in_dynamic_raw__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_in_dynamic_raw()
+ */
+extern void test__f_print_except_in_dynamic_raw__works(void **state);
+
+#endif // _TEST__F_print_except_in_dynamic_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_in_dynamic_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_in_dynamic_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_in_dynamic_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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_dynamic_raw_safely(test, except, range, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_in_dynamic_raw_safely__returns_data_not(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_status_t status = f_print_except_in_dynamic_raw_safely(f_string_empty_s, except, range, stdout);
+
+ assert_int_equal(status, F_data_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("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;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_in_dynamic_raw_safely_h
+#define _TEST__F_print_except_in_dynamic_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_in_dynamic_raw_safely()
+ */
+extern void test__f_print_except_in_dynamic_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_in_dynamic_raw_safely()
+ */
+extern void test__f_print_except_in_dynamic_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_in_dynamic_raw_safely()
+ */
+extern void test__f_print_except_in_dynamic_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_except_in_dynamic_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_in_dynamic_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_in_dynamic_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_in_dynamic_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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_dynamic_safely(test, except, range, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_in_dynamic_safely__returns_data_not(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_status_t status = f_print_except_in_dynamic_safely(f_string_empty_s, except, range, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_in_dynamic_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_in_dynamic_safely_h
+#define _TEST__F_print_except_in_dynamic_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_in_dynamic_safely()
+ */
+extern void test__f_print_except_in_dynamic_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_in_dynamic_safely()
+ */
+extern void test__f_print_except_in_dynamic_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_in_dynamic_safely()
+ */
+extern void test__f_print_except_in_dynamic_safely__works(void **state);
+
+#endif // _TEST__F_print_except_in_dynamic_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_in_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_in_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_in_raw(test.string, 0, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_in_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(test.string, 0, test.used, except, range, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_in_raw__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_except_in_raw(0, 0, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_in_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_raw(test.string, 0, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_raw(test.string, 2, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_raw(test.string, 1, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_in_raw_h
+#define _TEST__F_print_except_in_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_in_raw()
+ */
+extern void test__f_print_except_in_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_in_raw()
+ */
+extern void test__f_print_except_in_raw__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_except_in_raw()
+ */
+extern void test__f_print_except_in_raw__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_in_raw()
+ */
+extern void test__f_print_except_in_raw__works(void **state);
+
+#endif // _TEST__F_print_except_in_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_in_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_in_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_in_raw_safely(test.string, 0, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_in_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(test.string, 0, test.used, except, range, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+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("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_except_in_raw_safely(0, 0, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_in_raw_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_raw_safely(test.string, 0, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_raw_safely(test.string, 2, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_raw_safely(test.string, 1, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_in_raw_safely_h
+#define _TEST__F_print_except_in_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_in_raw_safely()
+ */
+extern void test__f_print_except_in_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_in_raw_safely()
+ */
+extern void test__f_print_except_in_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_in_raw_safely()
+ */
+extern void test__f_print_except_in_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_except_in_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_in_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_in_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_in_safely(test.string, 0, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_in_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(test.string, 0, test.used, except, range, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_in_safely__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_except_in_safely(0, 0, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_in_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_safely(test.string, 0, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_safely(test.string, 2, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_in_safely(test.string, 1, test.used, except, range, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_in_safely_h
+#define _TEST__F_print_except_in_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_in_safely()
+ */
+extern void test__f_print_except_in_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_in_safely()
+ */
+extern void test__f_print_except_in_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_except_in_safely()
+ */
+extern void test__f_print_except_in_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_in_safely()
+ */
+extern void test__f_print_except_in_safely__works(void **state);
+
+#endif // _TEST__F_print_except_in_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_raw(test.string, 0, test.used, except, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_except_raw(test.string, 0, test.used, except, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_raw__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_except_raw(0, 0, test.used, except, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_raw(test.string, 0, test.used, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_raw(test.string, 2, test.used, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_raw(test.string, 1, test.used, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_raw_h
+#define _TEST__F_print_except_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_raw()
+ */
+extern void test__f_print_except_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_raw()
+ */
+extern void test__f_print_except_raw__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_except_raw()
+ */
+extern void test__f_print_except_raw__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_raw()
+ */
+extern void test__f_print_except_raw__works(void **state);
+
+#endif // _TEST__F_print_except_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_raw_safely(test.string, 0, test.used, except, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_except_raw_safely(test.string, 0, test.used, except, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_raw_safely__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_except_raw_safely(0, 0, test.used, except, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_raw_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_raw_safely(test.string, 0, test.used, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_raw_safely(test.string, 2, test.used, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_raw_safely(test.string, 1, test.used, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_raw_safely_h
+#define _TEST__F_print_except_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_raw_safely()
+ */
+extern void test__f_print_except_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_raw_safely()
+ */
+extern void test__f_print_except_raw_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_except_raw_safely()
+ */
+extern void test__f_print_except_raw_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_raw_safely()
+ */
+extern void test__f_print_except_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_except_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-except_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_except_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_except_safely(test.string, 0, test.used, except, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_except_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_except_safely(test.string, 0, test.used, except, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_except_safely__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_except_safely(0, 0, test.used, except, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_except_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_safely(test.string, 0, test.used, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_safely(test.string, 2, test.used, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_except_safely(test.string, 1, test.used, except, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_except_safely_h
+#define _TEST__F_print_except_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_except_safely()
+ */
+extern void test__f_print_except_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_except_safely()
+ */
+extern void test__f_print_except_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_except_safely()
+ */
+extern void test__f_print_except_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_except_safely()
+ */
+extern void test__f_print_except_safely__works(void **state);
+
+#endif // _TEST__F_print_except_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_raw(test.string, test.used, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_raw(test.string, test.used, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_raw__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_raw(f_string_empty_s.string, f_string_empty_s.used, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_raw(test.string, f_string_empty_s.used, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_raw(0, test.used, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_raw(test.string, test.used, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_raw_h
+#define _TEST__F_print_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_raw()
+ */
+extern void test__f_print_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_raw()
+ */
+extern void test__f_print_raw__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_raw()
+ */
+extern void test__f_print_raw__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_raw()
+ */
+extern void test__f_print_raw__works(void **state);
+
+#endif // _TEST__F_print_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_raw_safely(test.string, test.used, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_raw_safely(test.string, test.used, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_raw_safely__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_raw_safely(f_string_empty_s.string, f_string_empty_s.used, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_raw_safely(test.string, f_string_empty_s.used, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_raw_safely(0, test.used, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_raw_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_raw_safely(test.string, test.used, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_raw_safely_h
+#define _TEST__F_print_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_raw_safely()
+ */
+extern void test__f_print_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_raw_safely()
+ */
+extern void test__f_print_raw_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_raw_safely()
+ */
+extern void test__f_print_raw_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_raw_safely()
+ */
+extern void test__f_print_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-raw_terminated.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_raw_terminated__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_raw_terminated(test.string, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_raw_terminated__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_raw_terminated(test.string, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_raw_terminated__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_raw_terminated(0, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_raw_terminated__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_raw_terminated(test.string, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_raw_terminated_h
+#define _TEST__F_print_raw_terminated_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_raw_terminated()
+ */
+extern void test__f_print_raw_terminated__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_raw_terminated()
+ */
+extern void test__f_print_raw_terminated__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_raw_terminated()
+ */
+extern void test__f_print_raw_terminated__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_raw_terminated()
+ */
+extern void test__f_print_raw_terminated__works(void **state);
+
+#endif // _TEST__F_print_raw_terminated_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_safely(test.string, test.used, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_safely(test.string, test.used, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_safely__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_safely(f_string_empty_s.string, f_string_empty_s.used, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_safely(test.string, f_string_empty_s.used, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_safely(0, test.used, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_safely(test.string, test.used, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_safely_h
+#define _TEST__F_print_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_safely()
+ */
+extern void test__f_print_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_safely()
+ */
+extern void test__f_print_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_safely()
+ */
+extern void test__f_print_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_safely()
+ */
+extern void test__f_print_safely__works(void **state);
+
+#endif // _TEST__F_print_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-safely_get.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_safely_get__returns_character_control(void **state) {
+
+ for (uint8_t i = 0; i < 32 ; ++i) {
+
+ char string[2] = "";
+ string[0] = (f_char_t) i;
+
+ const f_string_static_t safe = f_print_safely_get(string, 1);
+
+ assert_int_equal(safe.used, f_print_sequence_set_control_s[i].used);
+ assert_string_equal(safe.string, f_print_sequence_set_control_s[i].string);
+ } // for
+}
+
+void test__f_print_safely_get__returns_character_delete(void **state) {
+
+ char string[2] = "";
+ string[0] = (f_char_t) 0x7f;
+
+ {
+ const f_string_static_t safe = f_print_safely_get(string, 1);
+
+ assert_int_equal(safe.used, f_print_sequence_delete_s.used);
+ assert_string_equal(safe.string, f_print_sequence_delete_s.string);
+ }
+}
+
+void test__f_print_safely_get__returns_character_unknown(void **state) {
+
+ char string[2] = "";
+ string[0] = (f_char_t) F_utf_byte_1_d;
+
+ {
+ const f_string_static_t safe = f_print_safely_get(string, 1);
+
+ assert_int_equal(safe.used, f_print_sequence_unknown_s.used);
+ assert_string_equal(safe.string, f_print_sequence_unknown_s.string);
+ }
+}
+
+void test__f_print_safely_get__returns_empty(void **state) {
+
+ {
+ char string[2] = "";
+ string[0] = 'a';
+
+ const f_string_static_t safe = f_print_safely_get(string, 1);
+
+ assert_int_equal(safe.used, f_string_empty_s.used);
+ assert_string_equal(safe.string, f_string_empty_s.string);
+ }
+
+ {
+ char string[3] = "è ‡";
+
+ const f_string_static_t safe = f_print_safely_get(string, 3);
+
+ assert_int_equal(safe.used, f_string_empty_s.used);
+ assert_string_equal(safe.string, f_string_empty_s.string);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_safely_get_h
+#define _TEST__F_print_safely_get_h
+
+/**
+ * Test that function works but returns a control character safe alternative.
+ *
+ * @see f_print_safely_get()
+ */
+extern void test__f_print_safely_get__returns_character_control(void **state);
+
+/**
+ * Test that function works but returns a delete character safe alternative.
+ *
+ * @see f_print_safely_get()
+ */
+extern void test__f_print_safely_get__returns_character_delete(void **state);
+
+/**
+ * Test that function works but returns a unknown character safe alternative.
+ *
+ * @see f_print_safely_get()
+ */
+extern void test__f_print_safely_get__returns_character_unknown(void **state);
+
+/**
+ * Test that function works but returns an empty string.
+ *
+ * @see f_print_safely_get()
+ */
+extern void test__f_print_safely_get__returns_empty(void **state);
+
+#endif // _TEST__F_print_safely_get_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-safely_terminated.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_safely_terminated__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_safely_terminated(test.string, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_safely_terminated__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_safely_terminated(test.string, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_safely_terminated__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_safely_terminated(0, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_safely_terminated__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_safely_terminated(test.string, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_safely_terminated_h
+#define _TEST__F_print_safely_terminated_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_safely_terminated()
+ */
+extern void test__f_print_safely_terminated__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_safely_terminated()
+ */
+extern void test__f_print_safely_terminated__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_safely_terminated()
+ */
+extern void test__f_print_safely_terminated__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_safely_terminated()
+ */
+extern void test__f_print_safely_terminated__works(void **state);
+
+#endif // _TEST__F_print_safely_terminated_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-terminated.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_terminated__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_print_terminated(test.string, stdout);
+
+ assert_int_equal(status, F_status_set_error(F_output));
+ }
+}
+
+void test__f_print_terminated__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_terminated(test.string, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_terminated__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_terminated(0, stdout);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_terminated__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_fwrite_unlocked, test.used);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_print_terminated(test.string, stdout);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_terminated_h
+#define _TEST__F_print_terminated_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_terminated()
+ */
+extern void test__f_print_terminated__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_terminated()
+ */
+extern void test__f_print_terminated__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_terminated()
+ */
+extern void test__f_print_terminated__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_terminated()
+ */
+extern void test__f_print_terminated__works(void **state);
+
+#endif // _TEST__F_print_terminated_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ will_return(__wrap_write, true);
+ will_return(__wrap_write, errnos[i]);
+
+ const f_status_t status = f_print_to(test.string, test.used, 0);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to(test.string, test.used, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to(f_string_empty_s.string, f_string_empty_s.used, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to(test.string, f_string_empty_s.used, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to(0, test.used, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, test.used);
+
+ const f_status_t status = f_print_to(test.string, test.used, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_h
+#define _TEST__F_print_to_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to()
+ */
+extern void test__f_print_to__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to()
+ */
+extern void test__f_print_to__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to()
+ */
+extern void test__f_print_to__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to()
+ */
+extern void test__f_print_to__works(void **state);
+
+#endif // _TEST__F_print_to_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_character.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_character__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ will_return(__wrap_write, true);
+ will_return(__wrap_write, errnos[i]);
+
+ const f_status_t status = f_print_to_character(test.string[0], 0);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_character__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_character(test.string[0], -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_character__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, 1);
+
+ const f_status_t status = f_print_to_character(test.string[0], 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_character_h
+#define _TEST__F_print_to_character_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_character()
+ */
+extern void test__f_print_to_character__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_character()
+ */
+extern void test__f_print_to_character__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_character()
+ */
+extern void test__f_print_to_character__works(void **state);
+
+#endif // _TEST__F_print_to_character_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_character_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_character_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+
+ for (int i = 0; i < 14; ++i) {
+
+ const f_string_static_t alternate = macro_f_string_static_t_initialize("è ‡", 0, 2);
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);;
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_character_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_character_safely(test.string[0], -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_character_safely__returns_utf(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("è ‡", 0, 2);
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, 1);
+
+ const f_status_t status = f_print_to_character_safely(test.string[0], 0);
+
+ assert_int_equal(status, F_utf);
+ }
+}
+
+void test__f_print_to_character_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, 1);
+
+ const f_status_t status = f_print_to_character_safely(test.string[0], 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_character_safely_h
+#define _TEST__F_print_to_character_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_character_safely()
+ */
+extern void test__f_print_to_character_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_character_safely()
+ */
+extern void test__f_print_to_character_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_utf.
+ *
+ * @see f_print_to_character_safely()
+ */
+extern void test__f_print_to_character_safely__returns_utf(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_character_safely()
+ */
+extern void test__f_print_to_character_safely__works(void **state);
+
+#endif // _TEST__F_print_to_character_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_dynamic.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_dynamic__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ will_return(__wrap_write, true);
+ will_return(__wrap_write, errnos[i]);
+
+ const f_status_t status = f_print_to_dynamic(test, 0);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_dynamic__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_dynamic(test, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_dynamic__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_to_dynamic(f_string_empty_s, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_dynamic__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, test.used);
+
+ const f_status_t status = f_print_to_dynamic(test, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_dynamic_h
+#define _TEST__F_print_to_dynamic_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_dynamic()
+ */
+extern void test__f_print_to_dynamic__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_dynamic()
+ */
+extern void test__f_print_to_dynamic__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_dynamic()
+ */
+extern void test__f_print_to_dynamic__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_dynamic()
+ */
+extern void test__f_print_to_dynamic__works(void **state);
+
+#endif // _TEST__F_print_to_dynamic_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_dynamic_partial.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_dynamic_partial__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ will_return(__wrap_write, true);
+ will_return(__wrap_write, errnos[i]);
+
+ const f_status_t status = f_print_to_dynamic_partial(test, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_dynamic_partial__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_to_dynamic_partial(test, partial, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_dynamic_partial__returns_data_not(void **state) {
+
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_to_dynamic_partial(f_string_empty_s, partial, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_dynamic_partial__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, test.used);
+
+ const f_status_t status = f_print_to_dynamic_partial(test, partial, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_dynamic_partial_h
+#define _TEST__F_print_to_dynamic_partial_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_dynamic_partial()
+ */
+extern void test__f_print_to_dynamic_partial__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_dynamic_partial()
+ */
+extern void test__f_print_to_dynamic_partial__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_dynamic_partial()
+ */
+extern void test__f_print_to_dynamic_partial__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_dynamic_partial()
+ */
+extern void test__f_print_to_dynamic_partial__works(void **state);
+
+#endif // _TEST__F_print_to_dynamic_partial_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_dynamic_partial_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_dynamic_partial_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_dynamic_partial_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_to_dynamic_partial_raw(test, partial, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_dynamic_partial_raw__returns_data_not(void **state) {
+
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_to_dynamic_partial_raw(f_string_empty_s, partial, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_dynamic_partial_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_dynamic_partial_raw_h
+#define _TEST__F_print_to_dynamic_partial_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_dynamic_partial_raw()
+ */
+extern void test__f_print_to_dynamic_partial_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_dynamic_partial_raw()
+ */
+extern void test__f_print_to_dynamic_partial_raw__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_dynamic_partial_raw()
+ */
+extern void test__f_print_to_dynamic_partial_raw__works(void **state);
+
+#endif // _TEST__F_print_to_dynamic_partial_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_dynamic_partial_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_dynamic_partial_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_dynamic_partial_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_to_dynamic_partial_raw_safely(test, partial, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_dynamic_partial_raw_safely__returns_data_not(void **state) {
+
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_to_dynamic_partial_raw_safely(f_string_empty_s, partial, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_dynamic_partial_raw_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_dynamic_partial_raw_safely_h
+#define _TEST__F_print_to_dynamic_partial_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_to_dynamic_partial_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_to_dynamic_partial_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_to_dynamic_partial_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_to_dynamic_partial_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_dynamic_partial_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_dynamic_partial_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_dynamic_partial_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_to_dynamic_partial_safely(test, partial, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_dynamic_partial_safely__returns_data_not(void **state) {
+
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_to_dynamic_partial_safely(f_string_empty_s, partial, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_dynamic_partial_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_dynamic_partial_safely_h
+#define _TEST__F_print_to_dynamic_partial_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_dynamic_partial_safely()
+ */
+extern void test__f_print_to_dynamic_partial_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_dynamic_partial_safely()
+ */
+extern void test__f_print_to_dynamic_partial_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_dynamic_partial_safely()
+ */
+extern void test__f_print_to_dynamic_partial_safely__works(void **state);
+
+#endif // _TEST__F_print_to_dynamic_partial_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_dynamic_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_dynamic_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ will_return(__wrap_write, true);
+ will_return(__wrap_write, errnos[i]);
+
+ const f_status_t status = f_print_to_dynamic_raw(test, 0);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_dynamic_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_dynamic_raw(test, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_dynamic_raw__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_to_dynamic_raw(f_string_empty_s, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_dynamic_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, test.used);
+
+ const f_status_t status = f_print_to_dynamic_raw(test, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_dynamic_raw_h
+#define _TEST__F_print_to_dynamic_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_dynamic_raw()
+ */
+extern void test__f_print_to_dynamic_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_dynamic_raw()
+ */
+extern void test__f_print_to_dynamic_raw__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_dynamic_raw()
+ */
+extern void test__f_print_to_dynamic_raw__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_dynamic_raw()
+ */
+extern void test__f_print_to_dynamic_raw__works(void **state);
+
+#endif // _TEST__F_print_to_dynamic_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_dynamic_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_dynamic_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ will_return(__wrap_write, true);
+ will_return(__wrap_write, errnos[i]);
+
+ const f_status_t status = f_print_to_dynamic_raw_safely(test, 0);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_dynamic_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_dynamic_raw_safely(test, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_dynamic_raw_safely__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_to_dynamic_raw_safely(f_string_empty_s, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_dynamic_raw_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, test.used);
+
+ const f_status_t status = f_print_to_dynamic_raw_safely(test, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_dynamic_raw_safely_h
+#define _TEST__F_print_to_dynamic_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_dynamic_raw_safely()
+ */
+extern void test__f_print_to_dynamic_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_dynamic_raw_safely()
+ */
+extern void test__f_print_to_dynamic_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_dynamic_raw_safely()
+ */
+extern void test__f_print_to_dynamic_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_to_dynamic_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_dynamic_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_dynamic_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ will_return(__wrap_write, true);
+ will_return(__wrap_write, errnos[i]);
+
+ const f_status_t status = f_print_to_dynamic_safely(test, 0);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_dynamic_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_dynamic_safely(test, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_dynamic_safely__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_to_dynamic_safely(f_string_empty_s, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_dynamic_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, test.used);
+
+ const f_status_t status = f_print_to_dynamic_safely(test, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_dynamic_safely_h
+#define _TEST__F_print_to_dynamic_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_dynamic_safely()
+ */
+extern void test__f_print_to_dynamic_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_dynamic_safely()
+ */
+extern void test__f_print_to_dynamic_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_dynamic_safely()
+ */
+extern void test__f_print_to_dynamic_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_dynamic_safely()
+ */
+extern void test__f_print_to_dynamic_safely__works(void **state);
+
+#endif // _TEST__F_print_to_dynamic_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_to_except(test.string, 0, test.used, except, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_except(0, 0, test.used, except, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_h
+#define _TEST__F_print_to_except_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except()
+ */
+extern void test__f_print_to_except__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except()
+ */
+extern void test__f_print_to_except__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_except()
+ */
+extern void test__f_print_to_except__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except()
+ */
+extern void test__f_print_to_except__works(void **state);
+
+#endif // _TEST__F_print_to_except_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_dynamic.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_dynamic__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ will_return(__wrap_write, true);
+ will_return(__wrap_write, errnos[i]);
+
+ const f_status_t status = f_print_to_except_dynamic(test, except, 0);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_dynamic__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_to_except_dynamic(test, except, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_dynamic__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_to_except_dynamic(f_string_empty_s, except, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_dynamic__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, test.used);
+
+ const f_status_t status = f_print_to_except_dynamic(test, except, 0);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, test.used);
+
+ const f_status_t status = f_print_to_except_dynamic(test, except, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_dynamic_h
+#define _TEST__F_print_to_except_dynamic_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_dynamic()
+ */
+extern void test__f_print_to_except_dynamic__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_dynamic()
+ */
+extern void test__f_print_to_except_dynamic__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_except_dynamic()
+ */
+extern void test__f_print_to_except_dynamic__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_dynamic()
+ */
+extern void test__f_print_to_except_dynamic__works(void **state);
+
+#endif // _TEST__F_print_to_except_dynamic_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_dynamic_partial.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_dynamic_partial__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_dynamic_partial__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_partial(test, partial, except, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_dynamic_partial__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_partial(f_string_empty_s, partial, except, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_dynamic_partial__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_dynamic_partial_h
+#define _TEST__F_print_to_except_dynamic_partial_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_dynamic_partial()
+ */
+extern void test__f_print_to_except_dynamic_partial__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_dynamic_partial()
+ */
+extern void test__f_print_to_except_dynamic_partial__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_dynamic_partial()
+ */
+extern void test__f_print_to_except_dynamic_partial__works(void **state);
+
+#endif // _TEST__F_print_to_except_dynamic_partial_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_dynamic_partial_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_dynamic_partial_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_dynamic_partial_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_partial_raw(test, partial, except, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_dynamic_partial_raw__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_partial_raw(f_string_empty_s, partial, except, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_dynamic_partial_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_dynamic_partial_raw_h
+#define _TEST__F_print_to_except_dynamic_partial_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_dynamic_partial_raw()
+ */
+extern void test__f_print_to_except_dynamic_partial_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_dynamic_partial_raw()
+ */
+extern void test__f_print_to_except_dynamic_partial_raw__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_dynamic_partial_raw()
+ */
+extern void test__f_print_to_except_dynamic_partial_raw__works(void **state);
+
+#endif // _TEST__F_print_to_except_dynamic_partial_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_dynamic_partial_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+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("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(0, 2);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ 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) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_partial_raw_safely(test, partial, except, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_dynamic_partial_raw_safely__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_partial_raw_safely(f_string_empty_s, partial, except, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+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("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_dynamic_partial_raw_safely_h
+#define _TEST__F_print_to_except_dynamic_partial_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_to_except_dynamic_partial_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_to_except_dynamic_partial_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_to_except_dynamic_partial_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_to_except_dynamic_partial_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_dynamic_partial_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_dynamic_partial_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_dynamic_partial_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_partial_safely(test, partial, except, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_dynamic_partial_safely__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_partial_safely(f_string_empty_s, partial, except, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_dynamic_partial_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_dynamic_partial_safely_h
+#define _TEST__F_print_to_except_dynamic_partial_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_dynamic_partial_safely()
+ */
+extern void test__f_print_to_except_dynamic_partial_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_dynamic_partial_safely()
+ */
+extern void test__f_print_to_except_dynamic_partial_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_dynamic_partial_safely()
+ */
+extern void test__f_print_to_except_dynamic_partial_safely__works(void **state);
+
+#endif // _TEST__F_print_to_except_dynamic_partial_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_dynamic_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_dynamic_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_dynamic_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_raw(test, except, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_dynamic_raw__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_raw(f_string_empty_s, except, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_dynamic_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_dynamic_raw_h
+#define _TEST__F_print_to_except_dynamic_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_dynamic_raw()
+ */
+extern void test__f_print_to_except_dynamic_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_dynamic_raw()
+ */
+extern void test__f_print_to_except_dynamic_raw__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_dynamic_raw()
+ */
+extern void test__f_print_to_except_dynamic_raw__works(void **state);
+
+#endif // _TEST__F_print_to_except_dynamic_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_dynamic_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_dynamic_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_dynamic_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_raw_safely(test, except, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_dynamic_raw_safely__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_raw_safely(f_string_empty_s, except, 0);
+
+ assert_int_equal(status, F_data_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("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_dynamic_raw_safely_h
+#define _TEST__F_print_to_except_dynamic_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_dynamic_raw_safely()
+ */
+extern void test__f_print_to_except_dynamic_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_dynamic_raw_safely()
+ */
+extern void test__f_print_to_except_dynamic_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_dynamic_raw_safely()
+ */
+extern void test__f_print_to_except_dynamic_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_to_except_dynamic_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_dynamic_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_dynamic_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_dynamic_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_safely(test, except, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_dynamic_safely__returns_data_not(void **state) {
+
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_to_except_dynamic_safely(f_string_empty_s, except, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_dynamic_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_dynamic_safely_h
+#define _TEST__F_print_to_except_dynamic_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_dynamic_safely()
+ */
+extern void test__f_print_to_except_dynamic_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_dynamic_safely()
+ */
+extern void test__f_print_to_except_dynamic_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_dynamic_safely()
+ */
+extern void test__f_print_to_except_dynamic_safely__works(void **state);
+
+#endif // _TEST__F_print_to_except_dynamic_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_in.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_in__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_in__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(test.string, 0, test.used, except, range, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_in__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_except_in(0, 0, test.used, except, range, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_in__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_in_h
+#define _TEST__F_print_to_except_in_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_in()
+ */
+extern void test__f_print_to_except_in__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_in()
+ */
+extern void test__f_print_to_except_in__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_except_in()
+ */
+extern void test__f_print_to_except_in__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_in()
+ */
+extern void test__f_print_to_except_in__works(void **state);
+
+#endif // _TEST__F_print_to_except_in_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_in_dynamic.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_in_dynamic__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_in_dynamic__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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_dynamic(test, except, range, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_in_dynamic__returns_data_not(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_status_t status = f_print_to_except_in_dynamic(f_string_empty_s, except, range, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_in_dynamic__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_in_dynamic_h
+#define _TEST__F_print_to_except_in_dynamic_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_in_dynamic()
+ */
+extern void test__f_print_to_except_in_dynamic__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_in_dynamic()
+ */
+extern void test__f_print_to_except_in_dynamic__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_in_dynamic()
+ */
+extern void test__f_print_to_except_in_dynamic__works(void **state);
+
+#endif // _TEST__F_print_to_except_in_dynamic_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_in_dynamic_partial.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_in_dynamic_partial__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_in_dynamic_partial__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_in_dynamic_partial(test, partial, except, range, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_in_dynamic_partial__returns_data_not(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(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_in_dynamic_partial(f_string_empty_s, partial, except, range, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_in_dynamic_partial__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_in_dynamic_partial_h
+#define _TEST__F_print_to_except_in_dynamic_partial_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_in_dynamic_partial()
+ */
+extern void test__f_print_to_except_in_dynamic_partial__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_in_dynamic_partial()
+ */
+extern void test__f_print_to_except_in_dynamic_partial__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_in_dynamic_partial()
+ */
+extern void test__f_print_to_except_in_dynamic_partial__works(void **state);
+
+#endif // _TEST__F_print_to_except_in_dynamic_partial_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_in_dynamic_partial_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_in_dynamic_partial_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ 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) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_in_dynamic_partial_raw(test, partial, except, range, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_in_dynamic_partial_raw__returns_data_not(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(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_in_dynamic_partial_raw(f_string_empty_s, partial, except, range, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+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("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_in_dynamic_partial_raw_h
+#define _TEST__F_print_to_except_in_dynamic_partial_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_in_dynamic_partial_raw()
+ */
+extern void test__f_print_to_except_in_dynamic_partial_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_in_dynamic_partial_raw()
+ */
+extern void test__f_print_to_except_in_dynamic_partial_raw__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_in_dynamic_partial_raw()
+ */
+extern void test__f_print_to_except_in_dynamic_partial_raw__works(void **state);
+
+#endif // _TEST__F_print_to_except_in_dynamic_partial_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_in_dynamic_partial_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_in_dynamic_partial_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ 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) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_in_dynamic_partial_raw_safely(test, partial, except, range, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_in_dynamic_partial_raw_safely__returns_data_not(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(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_in_dynamic_partial_raw_safely(f_string_empty_s, partial, except, range, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+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("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_in_dynamic_partial_raw_safely_h
+#define _TEST__F_print_to_except_in_dynamic_partial_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_in_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_to_except_in_dynamic_partial_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @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);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_in_dynamic_partial_raw_safely()
+ */
+extern void test__f_print_to_except_in_dynamic_partial_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_to_except_in_dynamic_partial_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_in_dynamic_partial_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_in_dynamic_partial_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ 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) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_in_dynamic_partial_safely(test, partial, except, range, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_in_dynamic_partial_safely__returns_data_not(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(0, 2);
+
+ {
+ const f_status_t status = f_print_to_except_in_dynamic_partial_safely(f_string_empty_s, partial, except, range, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+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("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(0, 2);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_in_dynamic_partial_safely_h
+#define _TEST__F_print_to_except_in_dynamic_partial_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_in_dynamic_partial_safely()
+ */
+extern void test__f_print_to_except_in_dynamic_partial_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_in_dynamic_partial_safely()
+ */
+extern void test__f_print_to_except_in_dynamic_partial_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_in_dynamic_partial_safely()
+ */
+extern void test__f_print_to_except_in_dynamic_partial_safely__works(void **state);
+
+#endif // _TEST__F_print_to_except_in_dynamic_partial_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_in_dynamic_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_in_dynamic_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_in_dynamic_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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_dynamic_raw(test, except, range, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_in_dynamic_raw__returns_data_not(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_status_t status = f_print_to_except_in_dynamic_raw(f_string_empty_s, except, range, 0);
+
+ assert_int_equal(status, F_data_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("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;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_in_dynamic_raw_h
+#define _TEST__F_print_to_except_in_dynamic_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_in_dynamic_raw()
+ */
+extern void test__f_print_to_except_in_dynamic_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_in_dynamic_raw()
+ */
+extern void test__f_print_to_except_in_dynamic_raw__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_in_dynamic_raw()
+ */
+extern void test__f_print_to_except_in_dynamic_raw__works(void **state);
+
+#endif // _TEST__F_print_to_except_in_dynamic_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_in_dynamic_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+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("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;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ 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) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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_dynamic_raw_safely(test, except, range, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_in_dynamic_raw_safely__returns_data_not(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_status_t status = f_print_to_except_in_dynamic_raw_safely(f_string_empty_s, except, range, 0);
+
+ assert_int_equal(status, F_data_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("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;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_in_dynamic_raw_safely_h
+#define _TEST__F_print_to_except_in_dynamic_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_in_dynamic_raw_safely()
+ */
+extern void test__f_print_to_except_in_dynamic_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_in_dynamic_raw_safely()
+ */
+extern void test__f_print_to_except_in_dynamic_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_in_dynamic_raw_safely()
+ */
+extern void test__f_print_to_except_in_dynamic_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_to_except_in_dynamic_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_in_dynamic_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_in_dynamic_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_in_dynamic_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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_dynamic_safely(test, except, range, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_in_dynamic_safely__returns_data_not(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_status_t status = f_print_to_except_in_dynamic_safely(f_string_empty_s, except, range, 0);
+
+ assert_int_equal(status, F_data_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("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;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_in_dynamic_safely_h
+#define _TEST__F_print_to_except_in_dynamic_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_in_dynamic_safely()
+ */
+extern void test__f_print_to_except_in_dynamic_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_in_dynamic_safely()
+ */
+extern void test__f_print_to_except_in_dynamic_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_in_dynamic_safely()
+ */
+extern void test__f_print_to_except_in_dynamic_safely__works(void **state);
+
+#endif // _TEST__F_print_to_except_in_dynamic_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_in_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_in_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_in_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(test.string, 0, test.used, except, range, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+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("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_except_in_raw(0, 0, test.used, except, range, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_in_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_in_raw_h
+#define _TEST__F_print_to_except_in_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_in_raw()
+ */
+extern void test__f_print_to_except_in_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_in_raw()
+ */
+extern void test__f_print_to_except_in_raw__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_in_raw()
+ */
+extern void test__f_print_to_except_in_raw__works(void **state);
+
+#endif // _TEST__F_print_to_except_in_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_in_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_in_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_in_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(test.string, 0, test.used, except, range, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+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("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_except_in_raw_safely(0, 0, test.used, except, range, 0);
+
+ assert_int_equal(status, F_data_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("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;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_in_raw_safely_h
+#define _TEST__F_print_to_except_in_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_in_raw_safely()
+ */
+extern void test__f_print_to_except_in_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_in_raw_safely()
+ */
+extern void test__f_print_to_except_in_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_in_raw_safely()
+ */
+extern void test__f_print_to_except_in_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_to_except_in_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_in_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_in_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_in_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(test.string, 0, test.used, except, range, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+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("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_except_in_safely(0, 0, test.used, except, range, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_in_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+ const f_string_ranges_t range = f_string_ranges_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ f_string_range_t ranges[] = {
+ macro_f_string_range_t_initialize(0, 1),
+ };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+ const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_in_safely_h
+#define _TEST__F_print_to_except_in_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_in_safely()
+ */
+extern void test__f_print_to_except_in_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_in_safely()
+ */
+extern void test__f_print_to_except_in_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_in_safely()
+ */
+extern void test__f_print_to_except_in_safely__works(void **state);
+
+#endif // _TEST__F_print_to_except_in_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_to_except_raw(test.string, 0, test.used, except, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_raw__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_except_raw(0, 0, test.used, except, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_raw_h
+#define _TEST__F_print_to_except_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_raw()
+ */
+extern void test__f_print_to_except_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_raw()
+ */
+extern void test__f_print_to_except_raw__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_except_raw()
+ */
+extern void test__f_print_to_except_raw__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_raw()
+ */
+extern void test__f_print_to_except_raw__works(void **state);
+
+#endif // _TEST__F_print_to_except_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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(test.string, 0, test.used, except, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+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("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_except_raw_safely(0, 0, test.used, except, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_raw_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_raw_safely_h
+#define _TEST__F_print_to_except_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_raw_safely()
+ */
+extern void test__f_print_to_except_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_raw_safely()
+ */
+extern void test__f_print_to_except_raw_safely__parameter_checking(void **state);
+
+/**
+ * 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__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_raw_safely()
+ */
+extern void test__f_print_to_except_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_to_except_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_except_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_except_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_except_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_print_to_except_safely(test.string, 0, test.used, except, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_except_safely__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("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);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_except_safely(0, 0, test.used, except, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_except_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ const f_array_lengths_t except = f_array_lengths_t_initialize;
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+
+ {
+ f_array_length_t lengths[] = { 3 };
+ const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
+
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_except_safely_h
+#define _TEST__F_print_to_except_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_except_safely()
+ */
+extern void test__f_print_to_except_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_except_safely()
+ */
+extern void test__f_print_to_except_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_except_safely()
+ */
+extern void test__f_print_to_except_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_except_safely()
+ */
+extern void test__f_print_to_except_safely__works(void **state);
+
+#endif // _TEST__F_print_to_except_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_raw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_raw__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_raw__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_raw(test.string, test.used, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_raw__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_raw(f_string_empty_s.string, f_string_empty_s.used, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_raw(test.string, f_string_empty_s.used, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_raw(0, test.used, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_raw__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, test.used);
+
+ /*will_return(__wrap_write, false);
+ will_return(__wrap_write, 1);*/
+
+ const f_status_t status = f_print_to_raw(test.string, test.used, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_raw_h
+#define _TEST__F_print_to_raw_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_raw()
+ */
+extern void test__f_print_to_raw__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_raw()
+ */
+extern void test__f_print_to_raw__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_raw()
+ */
+extern void test__f_print_to_raw__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_raw()
+ */
+extern void test__f_print_to_raw__works(void **state);
+
+#endif // _TEST__F_print_to_raw_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_raw_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_raw_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_raw_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_raw_safely(test.string, test.used, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_raw_safely__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_raw_safely(f_string_empty_s.string, f_string_empty_s.used, 0);
+
+ 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);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_raw_safely(0, test.used, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_raw_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_raw_safely_h
+#define _TEST__F_print_to_raw_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_raw_safely()
+ */
+extern void test__f_print_to_raw_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_raw_safely()
+ */
+extern void test__f_print_to_raw_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_raw_safely()
+ */
+extern void test__f_print_to_raw_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_raw_safely()
+ */
+extern void test__f_print_to_raw_safely__works(void **state);
+
+#endif // _TEST__F_print_to_raw_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_raw_terminated.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_raw_terminated__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ will_return(__wrap_write, true);
+ will_return(__wrap_write, errnos[i]);
+
+ const f_status_t status = f_print_to_raw_terminated(test.string, 0);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_raw_terminated__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_raw_terminated(test.string, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_raw_terminated__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_to_raw_terminated(0, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_raw_terminated__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, test.used);
+
+ const f_status_t status = f_print_to_raw_terminated(test.string, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_raw_terminated_h
+#define _TEST__F_print_to_raw_terminated_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_raw_terminated()
+ */
+extern void test__f_print_to_raw_terminated__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_raw_terminated()
+ */
+extern void test__f_print_to_raw_terminated__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_raw_terminated()
+ */
+extern void test__f_print_to_raw_terminated__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_raw_terminated()
+ */
+extern void test__f_print_to_raw_terminated__works(void **state);
+
+#endif // _TEST__F_print_to_raw_terminated_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_safely.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_safely__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ 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);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_safely__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_safely(test.string, test.used, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_safely__returns_data_not(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_safely(f_string_empty_s.string, f_string_empty_s.used, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_safely(test.string, f_string_empty_s.used, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_print_to_safely(0, test.used, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_safely__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ 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);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_safely_h
+#define _TEST__F_print_to_safely_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_safely()
+ */
+extern void test__f_print_to_safely__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_safely()
+ */
+extern void test__f_print_to_safely__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_safely()
+ */
+extern void test__f_print_to_safely__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_safely()
+ */
+extern void test__f_print_to_safely__works(void **state);
+
+#endif // _TEST__F_print_to_safely_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_safely_terminated.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_safely_terminated__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ will_return(__wrap_write, true);
+ will_return(__wrap_write, errnos[i]);
+
+ const f_status_t status = f_print_to_safely_terminated(test.string, 0);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_safely_terminated__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_safely_terminated(test.string, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_safely_terminated__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_to_safely_terminated(0, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_safely_terminated__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, test.used);
+
+ const f_status_t status = f_print_to_safely_terminated(test.string, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_safely_terminated_h
+#define _TEST__F_print_to_safely_terminated_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_safely_terminated()
+ */
+extern void test__f_print_to_safely_terminated__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_safely_terminated()
+ */
+extern void test__f_print_to_safely_terminated__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_safely_terminated()
+ */
+extern void test__f_print_to_safely_terminated__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_safely_terminated()
+ */
+extern void test__f_print_to_safely_terminated__works(void **state);
+
+#endif // _TEST__F_print_to_safely_terminated_h
--- /dev/null
+#include "test-print.h"
+#include "test-print-to_terminated.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_print_to_terminated__fails(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFBIG,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ ENOSPC,
+ EPIPE,
+ EWOULDBLOCK,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_socket_not,
+ F_filesystem_quota_block,
+ F_number_overflow,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_space_not,
+ F_pipe,
+ F_block,
+ F_output,
+ };
+
+ for (int i = 0; i < 14; ++i) {
+
+ will_return(__wrap_write, true);
+ will_return(__wrap_write, errnos[i]);
+
+ const f_status_t status = f_print_to_terminated(test.string, 0);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_print_to_terminated__parameter_checking(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_print_to_terminated(test.string, -1);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+}
+
+void test__f_print_to_terminated__returns_data_not(void **state) {
+
+ {
+ const f_status_t status = f_print_to_terminated(0, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+}
+
+void test__f_print_to_terminated__works(void **state) {
+
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ will_return(__wrap_write, false);
+ will_return(__wrap_write, test.used);
+
+ const f_status_t status = f_print_to_terminated(test.string, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_to_terminated_h
+#define _TEST__F_print_to_terminated_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_print_to_terminated()
+ */
+extern void test__f_print_to_terminated__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_print_to_terminated()
+ */
+extern void test__f_print_to_terminated__parameter_checking(void **state);
+
+/**
+ * Test that function works but returns F_data_not.
+ *
+ * @see f_print_to_terminated()
+ */
+extern void test__f_print_to_terminated__returns_data_not(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_print_to_terminated()
+ */
+extern void test__f_print_to_terminated__works(void **state);
+
+#endif // _TEST__F_print_to_terminated_h
--- /dev/null
+#include "test-print.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int setup(void **state) {
+
+ return 0;
+}
+
+int setdown(void **state) {
+
+ errno = 0;
+
+ return 0;
+}
+
+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__works),
+
+ cmocka_unit_test(test__f_print_character__fails),
+ 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_utf),
+ cmocka_unit_test(test__f_print_character_safely__works),
+
+ cmocka_unit_test(test__f_print_character_safely_get__returns_character_control),
+ cmocka_unit_test(test__f_print_character_safely_get__returns_character_delete),
+ cmocka_unit_test(test__f_print_character_safely_get__returns_character_unknown),
+ cmocka_unit_test(test__f_print_character_safely_get__returns_empty),
+
+ 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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__works),
+
+ cmocka_unit_test(test__f_print_safely_get__returns_character_control),
+ cmocka_unit_test(test__f_print_safely_get__returns_character_delete),
+ cmocka_unit_test(test__f_print_safely_get__returns_character_unknown),
+ cmocka_unit_test(test__f_print_safely_get__returns_empty),
+
+ 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__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__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__works),
+
+ cmocka_unit_test(test__f_print_to_character__fails),
+ 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_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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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__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_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_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),
+ #endif // _di_level_0_parameter_checking_
+ };
+
+ return cmocka_run_group_tests(tests, setup, setdown);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Print
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the print project.
+ */
+#ifndef _TEST__F_print_h
+#define _TEST__F_print_h
+
+// Libc includes.
+#include <stdarg.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <stdint.h>
+
+// cmocka includes.
+#include <cmocka.h>
+
+// FLL-0 includes.
+#include <fll/level_0/print.h>
+
+// Mock includes.
+#include "mock-print.h"
+
+// Test includes.
+#include "test-print-.h"
+#include "test-print-character.h"
+#include "test-print-character_safely.h"
+#include "test-print-character_safely_get.h"
+#include "test-print-dynamic.h"
+#include "test-print-dynamic_partial.h"
+#include "test-print-dynamic_partial_raw.h"
+#include "test-print-dynamic_partial_raw_safely.h"
+#include "test-print-dynamic_partial_safely.h"
+#include "test-print-dynamic_raw.h"
+#include "test-print-dynamic_raw_safely.h"
+#include "test-print-dynamic_safely.h"
+#include "test-print-except.h"
+#include "test-print-except_dynamic.h"
+#include "test-print-except_dynamic_partial.h"
+#include "test-print-except_dynamic_partial_raw.h"
+#include "test-print-except_dynamic_partial_raw_safely.h"
+#include "test-print-except_dynamic_partial_safely.h"
+#include "test-print-except_dynamic_raw.h"
+#include "test-print-except_dynamic_raw_safely.h"
+#include "test-print-except_dynamic_safely.h"
+#include "test-print-except_in.h"
+#include "test-print-except_in_dynamic.h"
+#include "test-print-except_in_dynamic_partial.h"
+#include "test-print-except_in_dynamic_partial_raw.h"
+#include "test-print-except_in_dynamic_partial_raw_safely.h"
+#include "test-print-except_in_dynamic_partial_safely.h"
+#include "test-print-except_in_dynamic_raw.h"
+#include "test-print-except_in_dynamic_raw_safely.h"
+#include "test-print-except_in_dynamic_safely.h"
+#include "test-print-except_in_raw.h"
+#include "test-print-except_in_raw_safely.h"
+#include "test-print-except_in_safely.h"
+#include "test-print-except_raw.h"
+#include "test-print-except_raw_safely.h"
+#include "test-print-except_safely.h"
+#include "test-print-raw.h"
+#include "test-print-raw_safely.h"
+#include "test-print-raw_terminated.h"
+#include "test-print-safely.h"
+#include "test-print-safely_get.h"
+#include "test-print-safely_terminated.h"
+#include "test-print-terminated.h"
+#include "test-print-to.h"
+#include "test-print-to_character.h"
+#include "test-print-to_character_safely.h"
+#include "test-print-to_dynamic.h"
+#include "test-print-to_dynamic_partial.h"
+#include "test-print-to_dynamic_partial_raw.h"
+#include "test-print-to_dynamic_partial_raw_safely.h"
+#include "test-print-to_dynamic_partial_safely.h"
+#include "test-print-to_dynamic_raw.h"
+#include "test-print-to_dynamic_raw_safely.h"
+#include "test-print-to_dynamic_safely.h"
+#include "test-print-to_except.h"
+#include "test-print-to_except_dynamic.h"
+#include "test-print-to_except_dynamic_partial.h"
+#include "test-print-to_except_dynamic_partial_raw.h"
+#include "test-print-to_except_dynamic_partial_raw_safely.h"
+#include "test-print-to_except_dynamic_partial_safely.h"
+#include "test-print-to_except_dynamic_raw.h"
+#include "test-print-to_except_dynamic_raw_safely.h"
+#include "test-print-to_except_dynamic_safely.h"
+#include "test-print-to_except_in.h"
+#include "test-print-to_except_in_dynamic.h"
+#include "test-print-to_except_in_dynamic_partial.h"
+#include "test-print-to_except_in_dynamic_partial_raw.h"
+#include "test-print-to_except_in_dynamic_partial_raw_safely.h"
+#include "test-print-to_except_in_dynamic_partial_safely.h"
+#include "test-print-to_except_in_dynamic_raw.h"
+#include "test-print-to_except_in_dynamic_raw_safely.h"
+#include "test-print-to_except_in_dynamic_safely.h"
+#include "test-print-to_except_in_raw.h"
+#include "test-print-to_except_in_raw_safely.h"
+#include "test-print-to_except_in_safely.h"
+#include "test-print-to_except_raw.h"
+#include "test-print-to_except_raw_safely.h"
+#include "test-print-to_except_safely.h"
+#include "test-print-to_raw.h"
+#include "test-print-to_raw_safely.h"
+#include "test-print-to_raw_terminated.h"
+#include "test-print-to_safely.h"
+#include "test-print-to_safely_terminated.h"
+#include "test-print-to_terminated.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Perform any setup operations.
+ *
+ * @param state
+ * The test state.
+ *
+ * @return
+ * The status of this function, where 0 means success.
+ */
+extern int setup(void **state);
+
+/**
+ * Peform any setdown operations.
+ *
+ * @param state
+ * The test state.
+ *
+ * @return
+ * The status of this function, where 0 means success.
+ */
+extern int setdown(void **state);
+
+/**
+ * Run all tests.
+ *
+ * @return
+ * The final result of the tests.
+ *
+ * @see cmocka_run_group_tests()
+ * @see cmocka_unit_test()
+ */
+extern int main(void);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _TEST__F_print_h