build_libraries-level -lfll_0
build_libraries-monolithic -lfll
build_sources_program test-string-append.c test-string-append_assure.c test-string-append_assure_nulless.c test-string-append_nulless.c
-build_sources_program test-string-dynamic_append.c test-string-dynamic_append_assure.c test-string-dynamic_append_assure_nulless.c test-string-dynamic_append_nulless.c
+build_sources_program test-string-dynamic_adjust.c test-string-dynamic_append.c test-string-dynamic_append_assure.c test-string-dynamic_append_assure_nulless.c test-string-dynamic_append_nulless.c
+build_sources_program test-string-dynamic_decimate_by.c test-string-dynamic_decrease_by.c test-string-dynamic_increase.c test-string-dynamic_increase_by.c
build_sources_program test-string-dynamic_mash.c test-string-dynamic_mash_nulless.c
build_sources_program test-string-dynamic_mish.c test-string-dynamic_mish_nulless.c
+build_sources_program test-string-dynamic_partial_append.c test-string-dynamic_partial_append_assure.c test-string-dynamic_partial_append_assure_nulless.c test-string-dynamic_partial_append_nulless.c
+build_sources_program test-string-dynamic_partial_mash.c test-string-dynamic_partial_mash_nulless.c
+build_sources_program test-string-dynamic_partial_mish.c test-string-dynamic_partial_mish_nulless.c
+build_sources_program test-string-dynamic_partial_prepend.c test-string-dynamic_partial_prepend_assure.c test-string-dynamic_partial_prepend_assure_nulless.c test-string-dynamic_partial_prepend_nulless.c
build_sources_program test-string-dynamic_prepend.c test-string-dynamic_prepend_assure.c test-string-dynamic_prepend_assure_nulless.c test-string-dynamic_prepend_nulless.c
+build_sources_program test-string-dynamic_resize.c
build_sources_program test-string-dynamic_seek_line.c test-string-dynamic_seek_line_to.c test-string-dynamic_seek_to.c
+build_sources_program test-string-dynamic_terminate.c test-string-dynamic_terminate_after.c
build_sources_program test-string-dynamics_adjust.c test-string-dynamics_append.c test-string-dynamics_append_all.c test-string-dynamics_decimate_by.c test-string-dynamics_decrease_by.c test-string-dynamics_increase.c test-string-dynamics_increase_by.c test-string-dynamics_resize.c test-string-dynamicss_adjust.c test-string-dynamicss_append.c test-string-dynamicss_append_all.c test-string-dynamicss_decimate_by.c test-string-dynamicss_decrease_by.c test-string-dynamicss_increase.c test-string-dynamicss_increase_by.c test-string-dynamicss_resize.c
build_sources_program test-string-map_multis_adjust.c test-string-map_multis_append.c test-string-map_multis_append_all.c test-string-map_multis_decimate_by.c test-string-map_multis_decrease_by.c test-string-map_multis_increase.c test-string-map_multis_increase_by.c test-string-map_multis_resize.c test-string-map_multiss_adjust.c test-string-map_multiss_append.c test-string-map_multiss_append_all.c test-string-map_multiss_decimate_by.c test-string-map_multiss_decrease_by.c test-string-map_multiss_increase.c test-string-map_multiss_increase_by.c test-string-map_multiss_resize.c
build_sources_program test-string-maps_adjust.c test-string-maps_append.c test-string-maps_append_all.c test-string-maps_decimate_by.c test-string-maps_decrease_by.c test-string-maps_increase.c test-string-maps_increase_by.c test-string-maps_resize.c test-string-mapss_adjust.c test-string-mapss_append.c test-string-mapss_append_all.c test-string-mapss_decimate_by.c test-string-mapss_decrease_by.c test-string-mapss_increase.c test-string-mapss_increase_by.c test-string-mapss_resize.c
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_string_dynamic_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string__string_dynamic_adjust
+#define _TEST__F_string__string_dynamic_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_adjust()
+ */
+extern void test__f_string_dynamic_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_adjust()
+ */
+extern void test__f_string_dynamic_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string__string_dynamic_adjust
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+void test__f_string_dynamic_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_dynamic_decimate_by_h
+#define _TEST__F_dynamic_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_decimate_by()
+ */
+extern void test__f_string_dynamic_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_decimate_by()
+ */
+extern void test__f_string_dynamic_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_dynamic_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+void test__f_string_dynamic_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_decrease_by_h
+#define _TEST__F_string_dynamic_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_decrease_by()
+ */
+extern void test__f_string_dynamic_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_decrease_by()
+ */
+extern void test__f_string_dynamic_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_string_dynamic_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_string_dynamic_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_string_dynamic_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.string);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_increase_h
+#define _TEST__F_string_dynamic_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_increase()
+ */
+extern void test__f_string_dynamic_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_dynamic_increase()
+ */
+extern void test__f_string_dynamic_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_increase()
+ */
+extern void test__f_string_dynamic_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_string_dynamic_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_string_dynamic_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_increase_by_h
+#define _TEST__F_string_dynamic_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_increase_by()
+ */
+extern void test__f_string_dynamic_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_increase_by()
+ */
+extern void test__f_string_dynamic_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_partial_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_partial_append__works(void **state) {
+
+ const f_string_static_t source = macro_f_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_string_static_t expected = macro_f_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
+ f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_append(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_string_dynamic_partial_append__parameter_checking(void **state) {
+
+ const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_append(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_partial_append_h
+#define _TEST__F_string_dynamic_partial_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_partial_append()
+ */
+extern void test__f_string_dynamic_partial_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_partial_append()
+ */
+extern void test__f_string_dynamic_partial_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_partial_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_partial_append_assure.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_partial_append_assure__works(void **state) {
+
+ const f_string_static_t source = macro_f_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_string_static_t expected = macro_f_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
+ f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_append(expected, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_string_dynamic_partial_append_assure(source, partial, &destination);
+
+ printf("\nDEBUG: [%d]='%s %s'\n", destination.used, destination.string, destination.string + 3);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_string_dynamic_partial_append_assure__parameter_checking(void **state) {
+
+ const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_append_assure(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_partial_append_assure_h
+#define _TEST__F_string_dynamic_partial_append_assure_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_partial_append_assure()
+ */
+extern void test__f_string_dynamic_partial_append_assure__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_partial_append_assure()
+ */
+extern void test__f_string_dynamic_partial_append_assure__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_partial_append_assure_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_partial_append_assure_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_partial_append_assure_nulless__works(void **state) {
+
+ const f_string_static_t source = macro_f_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_string_static_t expected = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
+ f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_append(expected, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_string_dynamic_partial_append_assure_nulless(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_string_dynamic_partial_append_assure_nulless__parameter_checking(void **state) {
+
+ const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_append_assure_nulless(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_partial_append_assure_nulless_h
+#define _TEST__F_string_dynamic_partial_append_assure_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_partial_append_assure_nulless()
+ */
+extern void test__f_string_dynamic_partial_append_assure_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_partial_append_assure_nulless()
+ */
+extern void test__f_string_dynamic_partial_append_assure_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_partial_append_assure_nulless_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_partial_append_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_partial_append_nulless__works(void **state) {
+
+ const f_string_static_t source = macro_f_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_string_static_t expected = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
+ f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_append_nulless(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_string_dynamic_partial_append_nulless__parameter_checking(void **state) {
+
+ const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_append_nulless(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_partial_append_nulless_h
+#define _TEST__F_string_dynamic_partial_append_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_partial_append_nulless()
+ */
+extern void test__f_string_dynamic_partial_append_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_partial_append_nulless()
+ */
+extern void test__f_string_dynamic_partial_append_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_partial_append_nulless_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_partial_mash.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_partial_mash__works(void **state) {
+
+ const f_string_static_t glue = macro_f_string_static_t_initialize(":", 0, 1);
+ const f_string_static_t source = macro_f_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_string_static_t expected1 = macro_f_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_static_t expected2 = macro_f_string_static_t_initialize("te\0st:te\0st", 0, 11);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
+ f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_mash(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected1.used);
+
+ assert_string_equal(destination.string, expected1.string);
+ assert_string_equal(destination.string + 3, expected1.string + 3);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_string_dynamic_partial_mash(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected2.used);
+
+ assert_string_equal(destination.string, expected2.string);
+ assert_string_equal(destination.string + 3, expected2.string + 3);
+ assert_string_equal(destination.string + 9, expected2.string + 9);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_string_dynamic_partial_mash__parameter_checking(void **state) {
+
+ const f_string_static_t glue = macro_f_string_static_t_initialize(":", 0, 1);
+ const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_mash(glue, source, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_partial_mash_h
+#define _TEST__F_string_dynamic_partial_mash_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_partial_mash()
+ */
+extern void test__f_string_dynamic_partial_mash__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_partial_mash()
+ */
+extern void test__f_string_dynamic_partial_mash__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_partial_mash_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_partial_mash_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_partial_mash_nulless__works(void **state) {
+
+ const f_string_static_t glue = macro_f_string_static_t_initialize(":", 0, 1);
+ const f_string_static_t source = macro_f_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_string_static_t expected1 = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_static_t expected2 = macro_f_string_static_t_initialize("test:test", 0, 9);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
+ f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_mash_nulless(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected1.used);
+
+ assert_string_equal(destination.string, expected1.string);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_string_dynamic_partial_mash_nulless(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected2.used);
+
+ assert_string_equal(destination.string, expected2.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_string_dynamic_partial_mash_nulless__parameter_checking(void **state) {
+
+ const f_string_static_t glue = macro_f_string_static_t_initialize(":", 0, 1);
+ const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_mash_nulless(glue, source, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_partial_mash_nulless_h
+#define _TEST__F_string_dynamic_partial_mash_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_partial_mash_nulless()
+ */
+extern void test__f_string_dynamic_partial_mash_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_partial_mash_nulless()
+ */
+extern void test__f_string_dynamic_partial_mash_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_partial_mash_nulless_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_partial_mish.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_partial_mish__works(void **state) {
+
+ const f_string_static_t glue = macro_f_string_static_t_initialize(":", 0, 1);
+ const f_string_static_t source = macro_f_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_string_static_t expected1 = macro_f_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_static_t expected2 = macro_f_string_static_t_initialize("te\0st:te\0st", 0, 11);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
+ f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_mish(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected1.used);
+
+ assert_string_equal(destination.string, expected1.string);
+ assert_string_equal(destination.string + 3, expected1.string + 3);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_string_dynamic_partial_mish(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected2.used);
+
+ assert_string_equal(destination.string, expected2.string);
+ assert_string_equal(destination.string + 3, expected2.string + 3);
+ assert_string_equal(destination.string + 9, expected2.string + 9);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_string_dynamic_partial_mish__parameter_checking(void **state) {
+
+ const f_string_static_t glue = macro_f_string_static_t_initialize(":", 0, 1);
+ const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_mish(glue, source, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_partial_mish_h
+#define _TEST__F_string_dynamic_partial_mish_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_partial_mish()
+ */
+extern void test__f_string_dynamic_partial_mish__works(void **state);
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_partial_mish()
+ */
+extern void test__f_string_dynamic_partial_mish__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_partial_mish_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_partial_mish_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_partial_mish_nulless__works(void **state) {
+
+ const f_string_static_t glue = macro_f_string_static_t_initialize(":", 0, 1);
+ const f_string_static_t source = macro_f_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_string_static_t expected1 = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_static_t expected2 = macro_f_string_static_t_initialize("test:test", 0, 9);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
+ f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_mish_nulless(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected1.used);
+
+ assert_string_equal(destination.string, expected1.string);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_string_dynamic_partial_mish_nulless(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected2.used);
+
+ assert_string_equal(destination.string, expected2.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_string_dynamic_partial_mish_nulless__parameter_checking(void **state) {
+
+ const f_string_static_t glue = macro_f_string_static_t_initialize(":", 0, 1);
+ const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_mish_nulless(glue, source, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_partial_mish_nulless_h
+#define _TEST__F_string_dynamic_partial_mish_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_partial_mish_nulless()
+ */
+extern void test__f_string_dynamic_partial_mish_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_partial_mish_nulless()
+ */
+extern void test__f_string_dynamic_partial_mish_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_partial_mish_nulless_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_partial_prepend.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_partial_prepend__works(void **state) {
+
+ const f_string_static_t source = macro_f_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_string_static_t expected = macro_f_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
+ f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_prepend(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_string_dynamic_partial_prepend__parameter_checking(void **state) {
+
+ const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_prepend(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_partial_prepend_h
+#define _TEST__F_string_dynamic_partial_prepend_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_partial_prepend()
+ */
+extern void test__f_string_dynamic_partial_prepend__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_partial_prepend()
+ */
+extern void test__f_string_dynamic_partial_prepend__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_partial_prepend_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_partial_prepend_assure.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_partial_prepend_assure__works(void **state) {
+
+ const f_string_static_t source = macro_f_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_string_static_t expected = macro_f_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
+ f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_prepend_assure(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_string_dynamic_partial_prepend_assure(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_string_dynamic_partial_prepend_assure__parameter_checking(void **state) {
+
+ const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_prepend_assure(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_partial_prepend_assure_h
+#define _TEST__F_string_dynamic_partial_prepend_assure_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_partial_prepend_assure()
+ */
+extern void test__f_string_dynamic_partial_prepend_assure__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_partial_prepend_assure()
+ */
+extern void test__f_string_dynamic_partial_prepend_assure__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_partial_prepend_assure_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_partial_prepend_assure_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_partial_prepend_assure_nulless__works(void **state) {
+
+ const f_string_static_t source = macro_f_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_string_static_t expected = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
+ f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_prepend_assure_nulless(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_string_dynamic_partial_prepend_assure_nulless(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_string_dynamic_partial_prepend_assure_nulless__parameter_checking(void **state) {
+
+ const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_prepend_assure_nulless(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_partial_prepend_assure_nulless_h
+#define _TEST__F_string_dynamic_partial_prepend_assure_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_partial_prepend_assure_nulless()
+ */
+extern void test__f_string_dynamic_partial_prepend_assure_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_partial_prepend_assure_nulless()
+ */
+extern void test__f_string_dynamic_partial_prepend_assure_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_partial_prepend_assure_nulless_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_partial_prepend_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_partial_prepend_nulless__works(void **state) {
+
+ const f_string_static_t source = macro_f_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_string_static_t expected = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
+ f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_prepend_nulless(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_string_dynamic_partial_prepend_nulless__parameter_checking(void **state) {
+
+ const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_partial_prepend_nulless(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_partial_prepend_nulless_h
+#define _TEST__F_string_dynamic_partial_prepend_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_partial_prepend_nulless()
+ */
+extern void test__f_string_dynamic_partial_prepend_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_partial_prepend_nulless()
+ */
+extern void test__f_string_dynamic_partial_prepend_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_partial_prepend_nulless_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_string_dynamic_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_resize_h
+#define _TEST__F_string_dynamic_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_resize()
+ */
+extern void test__f_string_dynamic_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_resize()
+ */
+extern void test__f_string_dynamic_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_resize_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_terminate.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_terminate__appends_null(void **state) {
+
+ const f_array_length_t length = 2;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ // Put some value in the unused section at the end so that it gets overridden.
+ {
+ const f_status_t status = f_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+
+ data.string[0] = 'X';
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_terminate(&data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 1);
+ assert_int_equal(data.string[0], 0);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_string_dynamic_terminate__doesnt_append_null(void **state) {
+
+ const f_array_length_t length = 2;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ // Ensure a NULL already exists so that the test can confirm that another NULL is not appended.
+ {
+ const f_status_t status = f_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+
+ data.string[0] = 0;
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_terminate(&data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 1);
+ assert_int_equal(data.string[0], 0);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_string_dynamic_terminate__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_string_dynamic_terminate(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_terminate_h
+#define _TEST__F_string_dynamic_terminate_h
+
+/**
+ * Test that the function appends a NULL.
+ *
+ * @see f_string_dynamic_terminate()
+ */
+extern void test__f_string_dynamic_terminate__appends_null(void **state);
+
+/**
+ * Test that the function does not append a NULL.
+ *
+ * @see f_string_dynamic_terminate()
+ */
+extern void test__f_string_dynamic_terminate__doesnt_append_null(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_terminate()
+ */
+extern void test__f_string_dynamic_terminate__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_terminate_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamic_terminate_after.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+void test__f_string_dynamic_terminate_after__appends_null(void **state) {
+
+ const f_array_length_t length = 2;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ // Put some value in the unused section at the end so that it gets overridden.
+ {
+ const f_status_t status = f_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+
+ data.string[0] = 'X';
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_terminate_after(&data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_in_range(data.size, 1, 1 + F_memory_default_allocation_small_d);
+
+ assert_int_equal(data.string[data.used], 0);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_string_dynamic_terminate_after__doesnt_append_null(void **state) {
+
+ const f_array_length_t length = 2;
+ f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ // Ensure a NULL already exists so that the test can confirm that another NULL is not appended.
+ {
+ const f_status_t status = f_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_in_range(data.size, length, length + F_memory_default_allocation_small_d);
+
+ data.string[0] = 0;
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_terminate_after(&data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_in_range(data.size, length, length + F_memory_default_allocation_small_d);
+
+ assert_int_equal(data.string[data.used], 0);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_string_dynamic_terminate_after__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_string_dynamic_terminate_after(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_terminate_after_h
+#define _TEST__F_string_dynamic_terminate_after_h
+
+/**
+ * Test that the function appends a new line.
+ *
+ * @see f_string_dynamic_terminate_after()
+ */
+extern void test__f_string_dynamic_terminate_after__appends_null(void **state);
+
+/**
+ * Test that the function does not append a new line.
+ *
+ * @see f_string_dynamic_terminate_after()
+ */
+extern void test__f_string_dynamic_terminate_after__doesnt_append_null(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_terminate_after()
+ */
+extern void test__f_string_dynamic_terminate_after__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_terminate_after_h
cmocka_unit_test(test__f_string_append_assure_nulless__works),
cmocka_unit_test(test__f_string_append_nulless__works),
+ cmocka_unit_test(test__f_string_dynamic_adjust__works),
+
cmocka_unit_test(test__f_string_dynamic_append__works),
cmocka_unit_test(test__f_string_dynamic_append_assure__works),
cmocka_unit_test(test__f_string_dynamic_append_assure_nulless__works),
cmocka_unit_test(test__f_string_dynamic_append_nulless__works),
+ cmocka_unit_test(test__f_string_dynamic_decimate_by__works),
+ cmocka_unit_test(test__f_string_dynamic_decrease_by__works),
+ cmocka_unit_test(test__f_string_dynamic_increase__works),
+ cmocka_unit_test(test__f_string_dynamic_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_dynamic_increase_by__works),
+
cmocka_unit_test(test__f_string_dynamic_mash__works),
cmocka_unit_test(test__f_string_dynamic_mash_nulless__works),
cmocka_unit_test(test__f_string_dynamic_mish__works),
cmocka_unit_test(test__f_string_dynamic_mish_nulless__works),
+ cmocka_unit_test(test__f_string_dynamic_partial_append__works),
+ cmocka_unit_test(test__f_string_dynamic_partial_append_assure__works),
+ cmocka_unit_test(test__f_string_dynamic_partial_append_assure_nulless__works),
+ cmocka_unit_test(test__f_string_dynamic_partial_append_nulless__works),
+
+ cmocka_unit_test(test__f_string_dynamic_partial_mash__works),
+ cmocka_unit_test(test__f_string_dynamic_partial_mash_nulless__works),
+
+ cmocka_unit_test(test__f_string_dynamic_partial_mish__works),
+ cmocka_unit_test(test__f_string_dynamic_partial_mish_nulless__works),
+
+ cmocka_unit_test(test__f_string_dynamic_partial_prepend__works),
+ cmocka_unit_test(test__f_string_dynamic_partial_prepend_assure__works),
+ cmocka_unit_test(test__f_string_dynamic_partial_prepend_assure_nulless__works),
+ cmocka_unit_test(test__f_string_dynamic_partial_prepend_nulless__works),
+
cmocka_unit_test(test__f_string_dynamic_prepend__works),
cmocka_unit_test(test__f_string_dynamic_prepend_assure__works),
cmocka_unit_test(test__f_string_dynamic_prepend_assure_nulless__works),
cmocka_unit_test(test__f_string_dynamic_prepend_nulless__works),
+ cmocka_unit_test(test__f_string_dynamic_resize__works),
+
cmocka_unit_test(test__f_string_dynamic_seek_line__returns_data_not_stop),
cmocka_unit_test(test__f_string_dynamic_seek_line__returns_none_eos),
cmocka_unit_test(test__f_string_dynamic_seek_line__returns_none_stop),
cmocka_unit_test(test__f_string_dynamic_seek_to__returns_none_stop),
cmocka_unit_test(test__f_string_dynamic_seek_to__works),
+ cmocka_unit_test(test__f_string_dynamic_terminate__appends_null),
+ cmocka_unit_test(test__f_string_dynamic_terminate__doesnt_append_null),
+
+ cmocka_unit_test(test__f_string_dynamic_terminate_after__appends_null),
+ cmocka_unit_test(test__f_string_dynamic_terminate_after__doesnt_append_null),
+
cmocka_unit_test(test__f_string_dynamics_adjust__works),
cmocka_unit_test(test__f_string_dynamics_append__works),
cmocka_unit_test(test__f_string_dynamics_append_all__works),
cmocka_unit_test(test__f_string_append_assure_nulless__parameter_checking),
cmocka_unit_test(test__f_string_append_nulless__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_adjust__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamic_append__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_append_assure__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_append_assure_nulless__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_append_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamic_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_dynamic_increase_by__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamic_mash__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_mash_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamic_mish__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_mish_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamic_partial_append__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_partial_append_assure__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_partial_append_assure_nulless__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_partial_append_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamic_partial_mash__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_partial_mash_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamic_partial_mish__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_partial_mish_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamic_partial_prepend__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_partial_prepend_assure__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_partial_prepend_assure_nulless__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_partial_prepend_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamic_prepend__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_prepend_assure__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_prepend_assure_nulless__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_prepend_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamic_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamic_seek_line__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_seek_line_to__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_seek_to__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamic_terminate__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamic_terminate_after__parameter_checking),
+
cmocka_unit_test(test__f_string_dynamics_adjust__parameter_checking),
cmocka_unit_test(test__f_string_dynamics_append__parameter_checking),
cmocka_unit_test(test__f_string_dynamics_append_all__parameter_checking),
#include "test-string-append_assure.h"
#include "test-string-append_assure_nulless.h"
#include "test-string-append_nulless.h"
+#include "test-string-dynamic_adjust.h"
#include "test-string-dynamic_append.h"
#include "test-string-dynamic_append_assure.h"
#include "test-string-dynamic_append_assure_nulless.h"
#include "test-string-dynamic_append_nulless.h"
+#include "test-string-dynamic_decimate_by.h"
+#include "test-string-dynamic_decrease_by.h"
+#include "test-string-dynamic_increase.h"
+#include "test-string-dynamic_increase_by.h"
#include "test-string-dynamic_mash.h"
#include "test-string-dynamic_mash_nulless.h"
#include "test-string-dynamic_mish.h"
#include "test-string-dynamic_mish_nulless.h"
+#include "test-string-dynamic_partial_append.h"
+#include "test-string-dynamic_partial_append_assure.h"
+#include "test-string-dynamic_partial_append_assure_nulless.h"
+#include "test-string-dynamic_partial_append_nulless.h"
+#include "test-string-dynamic_partial_mash.h"
+#include "test-string-dynamic_partial_mash_nulless.h"
+#include "test-string-dynamic_partial_mish.h"
+#include "test-string-dynamic_partial_mish_nulless.h"
+#include "test-string-dynamic_partial_prepend.h"
+#include "test-string-dynamic_partial_prepend_assure.h"
+#include "test-string-dynamic_partial_prepend_assure_nulless.h"
+#include "test-string-dynamic_partial_prepend_nulless.h"
#include "test-string-dynamic_prepend.h"
#include "test-string-dynamic_prepend_assure.h"
#include "test-string-dynamic_prepend_assure_nulless.h"
#include "test-string-dynamic_prepend_nulless.h"
+#include "test-string-dynamic_resize.h"
#include "test-string-dynamic_seek_line.h"
#include "test-string-dynamic_seek_line_to.h"
#include "test-string-dynamic_seek_to.h"
+#include "test-string-dynamic_terminate.h"
+#include "test-string-dynamic_terminate_after.h"
#include "test-string-dynamics_adjust.h"
#include "test-string-dynamics_append.h"
#include "test-string-dynamics_append_all.h"