]> Kevux Git Server - fll/commitdiff
Update: Add additional tests for f_string project.
authorKevin Day <thekevinday@gmail.com>
Sun, 27 Mar 2022 16:00:28 +0000 (11:00 -0500)
committerKevin Day <thekevinday@gmail.com>
Sun, 27 Mar 2022 16:00:28 +0000 (11:00 -0500)
This adds tests for the f_string functions for functions defined in string.h.
This adds tests for the f_string functions for functions defined in dynamic.h that functionally mirror functions defined in string.h.

There are still more functions in dynamic.h that need to have tests written for them.

65 files changed:
level_0/f_string/data/build/settings-tests
level_0/f_string/tests/unit/c/test-string-append.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-append.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-append_assure.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-append_assure.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-append_assure_nulless.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-append_assure_nulless.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-append_nulless.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-append_nulless.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_append.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_append.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_append_assure.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_append_assure.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_append_assure_nulless.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_append_assure_nulless.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_append_nulless.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_append_nulless.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_mash.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_mash.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_mash_nulless.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_mash_nulless.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_mish.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_mish.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_mish_nulless.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_mish_nulless.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_prepend.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_prepend.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_prepend_assure.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_prepend_assure.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_prepend_assure_nulless.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_prepend_assure_nulless.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_prepend_nulless.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_prepend_nulless.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_seek_line.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_seek_line.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_seek_line_to.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_seek_line_to.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_seek_to.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamic_seek_to.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-dynamics_append.c
level_0/f_string/tests/unit/c/test-string-dynamics_append_all.c
level_0/f_string/tests/unit/c/test-string-mash.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-mash.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-mash_nulless.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-mash_nulless.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-mish.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-mish.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-mish_nulless.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-mish_nulless.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-prepend.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-prepend.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-prepend_assure.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-prepend_assure.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-prepend_assure_nulless.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-prepend_assure_nulless.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-prepend_nulless.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-prepend_nulless.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-seek_line.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-seek_line.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-seek_line_to.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-seek_line_to.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-seek_to.c [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string-seek_to.h [new file with mode: 0644]
level_0/f_string/tests/unit/c/test-string.c
level_0/f_string/tests/unit/c/test-string.h

index db3478f39f18e166b0a44183e586ee406a34d515..5187f8d3ed66d23cd3dba75f98d8f081829461b9 100644 (file)
@@ -20,11 +20,21 @@ build_libraries -lc -lcmocka
 build_libraries-individual -lf_memory -lf_string
 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_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_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_seek_line.c test-string-dynamic_seek_line_to.c test-string-dynamic_seek_to.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-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
 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
+build_sources_program test-string-mash.c test-string-mash_nulless.c
+build_sources_program test-string-mish.c test-string-mish_nulless.c
+build_sources_program test-string-prepend.c test-string-prepend_assure.c test-string-prepend_assure_nulless.c test-string-prepend_nulless.c
 build_sources_program test-string-quantitys_adjust.c test-string-quantitys_append.c test-string-quantitys_append_all.c test-string-quantitys_decimate_by.c test-string-quantitys_decrease_by.c test-string-quantitys_increase.c test-string-quantitys_increase_by.c test-string-quantitys_resize.c test-string-quantityss_adjust.c test-string-quantityss_append.c test-string-quantityss_append_all.c test-string-quantityss_decimate_by.c test-string-quantityss_decrease_by.c test-string-quantityss_increase.c test-string-quantityss_increase_by.c test-string-quantityss_resize.c
 build_sources_program test-string-ranges_adjust.c test-string-ranges_append.c test-string-ranges_append_all.c test-string-ranges_decimate_by.c test-string-ranges_decrease_by.c test-string-ranges_increase.c test-string-ranges_increase_by.c test-string-ranges_resize.c test-string-rangess_adjust.c test-string-rangess_append.c test-string-rangess_append_all.c test-string-rangess_decimate_by.c test-string-rangess_decrease_by.c test-string-rangess_increase.c test-string-rangess_increase_by.c test-string-rangess_resize.c
+build_sources_program test-string-seek_line.c test-string-seek_line_to.c test-string-seek_to.c
 build_sources_program test-string-triples_adjust.c test-string-triples_append.c test-string-triples_append_all.c test-string-triples_decimate_by.c test-string-triples_decrease_by.c test-string-triples_increase.c test-string-triples_increase_by.c test-string-triples_resize.c test-string-tripless_adjust.c test-string-tripless_append.c test-string-tripless_append_all.c test-string-tripless_decimate_by.c test-string-tripless_decrease_by.c test-string-tripless_increase.c test-string-tripless_increase_by.c test-string-tripless_resize.c
 build_sources_program test-string.c
 build_script no
diff --git a/level_0/f_string/tests/unit/c/test-string-append.c b/level_0/f_string/tests/unit/c/test-string-append.c
new file mode 100644 (file)
index 0000000..622c700
--- /dev/null
@@ -0,0 +1,39 @@
+#include "test-string.h"
+#include "test-string-append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_append__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_append(source.string, source.used, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  free((void *) destination.string);
+}
+
+void test__f_string_append__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_append(data.string, data.used, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-append.h b/level_0/f_string/tests/unit/c/test-string-append.h
new file mode 100644 (file)
index 0000000..762afab
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_append_h
+#define _TEST__F_string_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_append()
+ */
+extern void test__f_string_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_append()
+ */
+extern void test__f_string_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_append_h
diff --git a/level_0/f_string/tests/unit/c/test-string-append_assure.c b/level_0/f_string/tests/unit/c/test-string-append_assure.c
new file mode 100644 (file)
index 0000000..e9b4e82
--- /dev/null
@@ -0,0 +1,50 @@
+#include "test-string.h"
+#include "test-string-append_assure.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_append_assure__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_append_assure(source.string, source.used, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  // The string already exists, so destination should be unchanged.
+  {
+    const f_status_t status = f_string_append_assure(source.string, source.used, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  free((void *) destination.string);
+}
+
+void test__f_string_append_assure__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_append_assure(data.string, data.used, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-append_assure.h b/level_0/f_string/tests/unit/c/test-string-append_assure.h
new file mode 100644 (file)
index 0000000..a72474d
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_append_assure_h
+#define _TEST__F_string_append_assure_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_append_assure()
+ */
+extern void test__f_string_append_assure__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_append_assure()
+ */
+extern void test__f_string_append_assure__parameter_checking(void **state);
+
+#endif // _TEST__F_string_append_assure_h
diff --git a/level_0/f_string/tests/unit/c/test-string-append_assure_nulless.c b/level_0/f_string/tests/unit/c/test-string-append_assure_nulless.c
new file mode 100644 (file)
index 0000000..797c7a7
--- /dev/null
@@ -0,0 +1,49 @@
+#include "test-string.h"
+#include "test-string-append_assure_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_append_assure_nulless__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  const f_string_static_t expected = macro_f_string_static_t_initialize("test", 0, 4);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_append_assure_nulless(source.string, source.used, &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_append_assure_nulless(source.string, source.used, &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_append_assure_nulless__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_append_assure_nulless(data.string, data.used, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-append_assure_nulless.h b/level_0/f_string/tests/unit/c/test-string-append_assure_nulless.h
new file mode 100644 (file)
index 0000000..ffa08e4
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_append_assure_nulless_h
+#define _TEST__F_string_append_assure_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_append_assure_nulless()
+ */
+extern void test__f_string_append_assure_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_append_assure_nulless()
+ */
+extern void test__f_string_append_assure_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_append_assure_nulless_h
diff --git a/level_0/f_string/tests/unit/c/test-string-append_nulless.c b/level_0/f_string/tests/unit/c/test-string-append_nulless.c
new file mode 100644 (file)
index 0000000..8d3cb5e
--- /dev/null
@@ -0,0 +1,39 @@
+#include "test-string.h"
+#include "test-string-append_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_append_nulless__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  const f_string_static_t expected = macro_f_string_static_t_initialize("test", 0, 4);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_append_nulless(source.string, source.used, &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_append_nulless__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_append_nulless(data.string, data.used, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-append_nulless.h b/level_0/f_string/tests/unit/c/test-string-append_nulless.h
new file mode 100644 (file)
index 0000000..0598faf
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_append_nulless_h
+#define _TEST__F_string_append_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_append_nulless()
+ */
+extern void test__f_string_append_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_append_nulless()
+ */
+extern void test__f_string_append_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_append_nulless_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_append.c b/level_0/f_string/tests/unit/c/test-string-dynamic_append.c
new file mode 100644 (file)
index 0000000..ba99c68
--- /dev/null
@@ -0,0 +1,39 @@
+#include "test-string.h"
+#include "test-string-dynamic_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_append__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_append(source, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  free((void *) destination.string);
+}
+
+void test__f_string_dynamic_append__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_append(data, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_append.h b/level_0/f_string/tests/unit/c/test-string-dynamic_append.h
new file mode 100644 (file)
index 0000000..4c25167
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_append_h
+#define _TEST__F_string_dynamic_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_append()
+ */
+extern void test__f_string_dynamic_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_append()
+ */
+extern void test__f_string_dynamic_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_append_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_append_assure.c b/level_0/f_string/tests/unit/c/test-string-dynamic_append_assure.c
new file mode 100644 (file)
index 0000000..008f7b8
--- /dev/null
@@ -0,0 +1,50 @@
+#include "test-string.h"
+#include "test-string-dynamic_append_assure.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_append_assure__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_append_assure(source, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  // The string already exists, so destination should be unchanged.
+  {
+    const f_status_t status = f_string_dynamic_append_assure(source, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  free((void *) destination.string);
+}
+
+void test__f_string_dynamic_append_assure__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_append_assure(data, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_append_assure.h b/level_0/f_string/tests/unit/c/test-string-dynamic_append_assure.h
new file mode 100644 (file)
index 0000000..6c1d7de
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_append_assure_h
+#define _TEST__F_string_dynamic_append_assure_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_append_assure()
+ */
+extern void test__f_string_dynamic_append_assure__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_append_assure()
+ */
+extern void test__f_string_dynamic_append_assure__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_append_assure_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_append_assure_nulless.c b/level_0/f_string/tests/unit/c/test-string-dynamic_append_assure_nulless.c
new file mode 100644 (file)
index 0000000..1f3f984
--- /dev/null
@@ -0,0 +1,49 @@
+#include "test-string.h"
+#include "test-string-dynamic_append_assure_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_append_assure_nulless__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  const f_string_static_t expected = macro_f_string_static_t_initialize("test", 0, 4);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_append_assure_nulless(source, &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_append_assure_nulless(source, &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_append_assure_nulless__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_append_assure_nulless(data, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_append_assure_nulless.h b/level_0/f_string/tests/unit/c/test-string-dynamic_append_assure_nulless.h
new file mode 100644 (file)
index 0000000..d164034
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_append_assure_nulless_h
+#define _TEST__F_string_dynamic_append_assure_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_append_assure_nulless()
+ */
+extern void test__f_string_dynamic_append_assure_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_append_assure_nulless()
+ */
+extern void test__f_string_dynamic_append_assure_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_append_assure_nulless_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_append_nulless.c b/level_0/f_string/tests/unit/c/test-string-dynamic_append_nulless.c
new file mode 100644 (file)
index 0000000..03309a1
--- /dev/null
@@ -0,0 +1,39 @@
+#include "test-string.h"
+#include "test-string-dynamic_append_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_append_nulless__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  const f_string_static_t expected = macro_f_string_static_t_initialize("test", 0, 4);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_append_nulless(source, &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_append_nulless__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_append_nulless(data, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_append_nulless.h b/level_0/f_string/tests/unit/c/test-string-dynamic_append_nulless.h
new file mode 100644 (file)
index 0000000..cb8a8cf
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_append_nulless_h
+#define _TEST__F_string_dynamic_append_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_append_nulless()
+ */
+extern void test__f_string_dynamic_append_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_append_nulless()
+ */
+extern void test__f_string_dynamic_append_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_append_nulless_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_mash.c b/level_0/f_string/tests/unit/c/test-string-dynamic_mash.c
new file mode 100644 (file)
index 0000000..3b437f9
--- /dev/null
@@ -0,0 +1,54 @@
+#include "test-string.h"
+#include "test-string-dynamic_mash.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_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, 5);
+  const f_string_static_t expected = macro_f_string_static_t_initialize("te\0st:te\0st", 0, 11);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_mash(glue, source, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  // Check that the glue is added.
+  {
+    const f_status_t status = f_string_dynamic_mash(glue, source, &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);
+    assert_string_equal(destination.string + 9, expected.string + 9);
+  }
+
+  free((void *) destination.string);
+}
+
+void test__f_string_dynamic_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_status_t status = f_string_dynamic_mash(glue, source, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_mash.h b/level_0/f_string/tests/unit/c/test-string-dynamic_mash.h
new file mode 100644 (file)
index 0000000..8024785
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_mash_h
+#define _TEST__F_string_dynamic_mash_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_mash()
+ */
+extern void test__f_string_dynamic_mash__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_mash()
+ */
+extern void test__f_string_dynamic_mash__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_mash_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_mash_nulless.c b/level_0/f_string/tests/unit/c/test-string-dynamic_mash_nulless.c
new file mode 100644 (file)
index 0000000..76e4a22
--- /dev/null
@@ -0,0 +1,52 @@
+#include "test-string.h"
+#include "test-string-dynamic_mash_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_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, 5);
+  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);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_mash_nulless(glue, source, &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_mash_nulless(glue, source, &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_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_status_t status = f_string_dynamic_mash_nulless(glue, source, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_mash_nulless.h b/level_0/f_string/tests/unit/c/test-string-dynamic_mash_nulless.h
new file mode 100644 (file)
index 0000000..5fbe538
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_mash_nulless_h
+#define _TEST__F_string_dynamic_mash_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_mash_nulless()
+ */
+extern void test__f_string_dynamic_mash_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_mash_nulless()
+ */
+extern void test__f_string_dynamic_mash_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_mash_nulless_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_mish.c b/level_0/f_string/tests/unit/c/test-string-dynamic_mish.c
new file mode 100644 (file)
index 0000000..6e9b2fb
--- /dev/null
@@ -0,0 +1,54 @@
+#include "test-string.h"
+#include "test-string-dynamic_mish.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_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, 5);
+  const f_string_static_t expected = macro_f_string_static_t_initialize("te\0st:te\0st", 0, 11);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_mish(glue, source, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  // Check that the glue is added.
+  {
+    const f_status_t status = f_string_dynamic_mish(glue, source, &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);
+    assert_string_equal(destination.string + 9, expected.string + 9);
+  }
+
+  free((void *) destination.string);
+}
+
+void test__f_string_dynamic_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_status_t status = f_string_dynamic_mish(glue, source, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_mish.h b/level_0/f_string/tests/unit/c/test-string-dynamic_mish.h
new file mode 100644 (file)
index 0000000..85d6526
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_mish_h
+#define _TEST__F_string_dynamic_mish_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_mish()
+ */
+extern void test__f_string_dynamic_mish__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_mish()
+ */
+extern void test__f_string_dynamic_mish__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_mish_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_mish_nulless.c b/level_0/f_string/tests/unit/c/test-string-dynamic_mish_nulless.c
new file mode 100644 (file)
index 0000000..02a9955
--- /dev/null
@@ -0,0 +1,52 @@
+#include "test-string.h"
+#include "test-string-dynamic_mish_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_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, 5);
+  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);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_mish_nulless(glue, source, &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_mish_nulless(glue, source, &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_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_status_t status = f_string_dynamic_mish_nulless(glue, source, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_mish_nulless.h b/level_0/f_string/tests/unit/c/test-string-dynamic_mish_nulless.h
new file mode 100644 (file)
index 0000000..04a066c
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_mish_nulless_h
+#define _TEST__F_string_dynamic_mish_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_mish_nulless()
+ */
+extern void test__f_string_dynamic_mish_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_mish_nulless()
+ */
+extern void test__f_string_dynamic_mish_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_mish_nulless_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_prepend.c b/level_0/f_string/tests/unit/c/test-string-dynamic_prepend.c
new file mode 100644 (file)
index 0000000..1a90d66
--- /dev/null
@@ -0,0 +1,39 @@
+#include "test-string.h"
+#include "test-string-dynamic_prepend.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_prepend__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_prepend(source, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  free((void *) destination.string);
+}
+
+void test__f_string_dynamic_prepend__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_prepend(data, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_prepend.h b/level_0/f_string/tests/unit/c/test-string-dynamic_prepend.h
new file mode 100644 (file)
index 0000000..29534c9
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_prepend_h
+#define _TEST__F_string_dynamic_prepend_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_prepend()
+ */
+extern void test__f_string_dynamic_prepend__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_prepend()
+ */
+extern void test__f_string_dynamic_prepend__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_prepend_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_prepend_assure.c b/level_0/f_string/tests/unit/c/test-string-dynamic_prepend_assure.c
new file mode 100644 (file)
index 0000000..a593a21
--- /dev/null
@@ -0,0 +1,50 @@
+#include "test-string.h"
+#include "test-string-dynamic_prepend_assure.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_prepend_assure__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_prepend_assure(source, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  // The string already exists, so destination should be unchanged.
+  {
+    const f_status_t status = f_string_dynamic_prepend_assure(source, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  free((void *) destination.string);
+}
+
+void test__f_string_dynamic_prepend_assure__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_prepend_assure(data, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_prepend_assure.h b/level_0/f_string/tests/unit/c/test-string-dynamic_prepend_assure.h
new file mode 100644 (file)
index 0000000..462d995
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_prepend_assure_h
+#define _TEST__F_string_dynamic_prepend_assure_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_prepend_assure()
+ */
+extern void test__f_string_dynamic_prepend_assure__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_prepend_assure()
+ */
+extern void test__f_string_dynamic_prepend_assure__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_prepend_assure_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_prepend_assure_nulless.c b/level_0/f_string/tests/unit/c/test-string-dynamic_prepend_assure_nulless.c
new file mode 100644 (file)
index 0000000..c3f1965
--- /dev/null
@@ -0,0 +1,49 @@
+#include "test-string.h"
+#include "test-string-dynamic_prepend_assure_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_prepend_assure_nulless__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  const f_string_static_t expected = macro_f_string_static_t_initialize("test", 0, 4);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_prepend_assure_nulless(source, &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_prepend_assure_nulless(source, &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_prepend_assure_nulless__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_prepend_assure_nulless(data, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_prepend_assure_nulless.h b/level_0/f_string/tests/unit/c/test-string-dynamic_prepend_assure_nulless.h
new file mode 100644 (file)
index 0000000..f8c64c0
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_prepend_assure_nulless_h
+#define _TEST__F_string_dynamic_prepend_assure_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_prepend_assure_nulless()
+ */
+extern void test__f_string_dynamic_prepend_assure_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_prepend_assure_nulless()
+ */
+extern void test__f_string_dynamic_prepend_assure_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_prepend_assure_nulless_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_prepend_nulless.c b/level_0/f_string/tests/unit/c/test-string-dynamic_prepend_nulless.c
new file mode 100644 (file)
index 0000000..dd70c48
--- /dev/null
@@ -0,0 +1,39 @@
+#include "test-string.h"
+#include "test-string-dynamic_prepend_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_prepend_nulless__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  const f_string_static_t expected = macro_f_string_static_t_initialize("test", 0, 4);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_prepend_nulless(source, &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_prepend_nulless__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_dynamic_prepend_nulless(data, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_prepend_nulless.h b/level_0/f_string/tests/unit/c/test-string-dynamic_prepend_nulless.h
new file mode 100644 (file)
index 0000000..760bd03
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_prepend_nulless_h
+#define _TEST__F_string_dynamic_prepend_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_prepend_nulless()
+ */
+extern void test__f_string_dynamic_prepend_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_prepend_nulless()
+ */
+extern void test__f_string_dynamic_prepend_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_prepend_nulless_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_seek_line.c b/level_0/f_string/tests/unit/c/test-string-dynamic_seek_line.c
new file mode 100644 (file)
index 0000000..98e36a2
--- /dev/null
@@ -0,0 +1,82 @@
+#include "test-string.h"
+#include "test-string-dynamic_seek_line.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_seek_line__returns_data_not_stop(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("test\nafter", 0, 10);
+
+  {
+    f_string_range_t range = f_string_range_t_initialize;
+
+    const f_status_t status = f_string_dynamic_seek_line(source, &range);
+
+    assert_int_equal(status, F_data_not_stop);
+  }
+}
+
+void test__f_string_dynamic_seek_line__returns_none_eos(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("test", 0, 4);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_dynamic_seek_line(source, &range);
+
+    assert_int_equal(status, F_none_eos);
+
+    assert_int_equal(range.start, source.used);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_dynamic_seek_line__returns_none_stop(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("test", 0, 4);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 2);
+
+    const f_status_t status = f_string_dynamic_seek_line(source, &range);
+
+    assert_int_equal(status, F_none_stop);
+
+    assert_int_equal(range.start, source.used - 1);
+    assert_int_equal(range.stop, source.used - 2);
+  }
+}
+
+void test__f_string_dynamic_seek_line__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("test\nafter", 0, 10);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_dynamic_seek_line(source, &range);
+
+    assert_int_equal(status, F_none);
+
+    assert_int_equal(range.start, 4);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_dynamic_seek_line__parameter_checking(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("teX\nst", 0, 6);
+
+  {
+    const f_status_t status = f_string_dynamic_seek_line(source, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_seek_line.h b/level_0/f_string/tests/unit/c/test-string-dynamic_seek_line.h
new file mode 100644 (file)
index 0000000..44f1d1f
--- /dev/null
@@ -0,0 +1,48 @@
+/**
+ * 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_seek_line_h
+#define _TEST__F_string_dynamic_seek_line_h
+
+/**
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ *
+ * @see f_string_dynamic_seek_line()
+ */
+extern void test__f_string_dynamic_seek_line__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_eos stopped after end of string because no newline is found.
+ *
+ * @see f_string_dynamic_seek_line()
+ */
+extern void test__f_string_dynamic_seek_line__returns_none_eos(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_string_dynamic_seek_line()
+ */
+extern void test__f_string_dynamic_seek_line__returns_none_stop(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_seek_line()
+ */
+extern void test__f_string_dynamic_seek_line__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_seek_line()
+ */
+extern void test__f_string_dynamic_seek_line__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_seek_line_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_seek_line_to.c b/level_0/f_string/tests/unit/c/test-string-dynamic_seek_line_to.c
new file mode 100644 (file)
index 0000000..807243d
--- /dev/null
@@ -0,0 +1,104 @@
+#include "test-string.h"
+#include "test-string-dynamic_seek_line_to.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_seek_line_to__at_newline(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\nXst", 0, 6);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_dynamic_seek_line_to(source, to.string[0], &range);
+
+    assert_int_equal(status, F_none_eol);
+
+    assert_int_equal(range.start, 2);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_dynamic_seek_line_to__returns_data_not_stop(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("test\nafter", 0, 10);
+
+  {
+    f_string_range_t range = f_string_range_t_initialize;
+
+    const f_status_t status = f_string_dynamic_seek_line_to(source, to.string[0], &range);
+
+    assert_int_equal(status, F_data_not_stop);
+  }
+}
+
+void test__f_string_dynamic_seek_line_to__returns_none_eos(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("test", 0, 4);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_dynamic_seek_line_to(source, to.string[0], &range);
+
+    assert_int_equal(status, F_none_eos);
+
+    assert_int_equal(range.start, source.used);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_dynamic_seek_line_to__returns_none_stop(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("test", 0, 4);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 2);
+
+    const f_status_t status = f_string_dynamic_seek_line_to(source, to.string[0], &range);
+
+    assert_int_equal(status, F_none_stop);
+
+    assert_int_equal(range.start, source.used - 1);
+    assert_int_equal(range.stop, source.used - 2);
+  }
+}
+
+void test__f_string_dynamic_seek_line_to__works(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("teX\nst", 0, 6);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_dynamic_seek_line_to(source, to.string[0], &range);
+
+    assert_int_equal(status, F_none);
+
+    assert_int_equal(range.start, 2);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_dynamic_seek_line_to__parameter_checking(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("teX\nst", 0, 6);
+
+  {
+    const f_status_t status = f_string_dynamic_seek_line_to(source, to.string[0], 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_seek_line_to.h b/level_0/f_string/tests/unit/c/test-string-dynamic_seek_line_to.h
new file mode 100644 (file)
index 0000000..1c63936
--- /dev/null
@@ -0,0 +1,55 @@
+/**
+ * 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_seek_line_to_h
+#define _TEST__F_string_dynamic_seek_line_to_h
+
+/**
+ * Test that the function works but stops at newline rather than search string.
+ *
+ * @see f_string_dynamic_seek_line_to()
+ */
+extern void test__f_string_dynamic_seek_line_to__at_newline(void **state);
+
+/**
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ *
+ * @see f_string_dynamic_seek_line_to()
+ */
+extern void test__f_string_dynamic_seek_line_to__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_eos stopped after end of string because no newline is found.
+ *
+ * @see f_string_dynamic_seek_line_to()
+ */
+extern void test__f_string_dynamic_seek_line_to__returns_none_eos(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_string_dynamic_seek_line_to()
+ */
+extern void test__f_string_dynamic_seek_line_to__returns_none_stop(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_seek_line_to()
+ */
+extern void test__f_string_dynamic_seek_line_to__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_seek_line_to()
+ */
+extern void test__f_string_dynamic_seek_line_to__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_seek_line_to_h
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_seek_to.c b/level_0/f_string/tests/unit/c/test-string-dynamic_seek_to.c
new file mode 100644 (file)
index 0000000..fc6aeb3
--- /dev/null
@@ -0,0 +1,87 @@
+#include "test-string.h"
+#include "test-string-dynamic_seek_to.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamic_seek_to__returns_data_not_stop(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("test\nafter", 0, 10);
+
+  {
+    f_string_range_t range = f_string_range_t_initialize;
+
+    const f_status_t status = f_string_dynamic_seek_to(source, to.string[0], &range);
+
+    assert_int_equal(status, F_data_not_stop);
+  }
+}
+
+void test__f_string_dynamic_seek_to__returns_none_eos(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("test\nafter", 0, 10);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_dynamic_seek_to(source, to.string[0], &range);
+
+    assert_int_equal(status, F_none_eos);
+
+    assert_int_equal(range.start, source.used);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_dynamic_seek_to__returns_none_stop(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("test\nafter", 0, 10);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 2);
+
+    const f_status_t status = f_string_dynamic_seek_to(source, to.string[0], &range);
+
+    assert_int_equal(status, F_none_stop);
+
+    assert_int_equal(range.start, source.used - 1);
+    assert_int_equal(range.stop, source.used - 2);
+  }
+}
+
+void test__f_string_dynamic_seek_to__works(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\nXst", 0, 6);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_dynamic_seek_to(source, to.string[0], &range);
+
+    assert_int_equal(status, F_none);
+
+    assert_int_equal(range.start, 3);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_dynamic_seek_to__parameter_checking(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("teX\nst", 0, 6);
+
+  {
+    const f_status_t status = f_string_dynamic_seek_to(source, to.string[0], 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-dynamic_seek_to.h b/level_0/f_string/tests/unit/c/test-string-dynamic_seek_to.h
new file mode 100644 (file)
index 0000000..b21325b
--- /dev/null
@@ -0,0 +1,48 @@
+/**
+ * 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_seek_to_h
+#define _TEST__F_string_dynamic_seek_to_h
+
+/**
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ *
+ * @see f_string_dynamic_seek_to()
+ */
+extern void test__f_string_dynamic_seek_to__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_eos stopped after end of string because no newline is found.
+ *
+ * @see f_string_dynamic_seek_to()
+ */
+extern void test__f_string_dynamic_seek_to__returns_none_eos(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_string_dynamic_seek_to()
+ */
+extern void test__f_string_dynamic_seek_to__returns_none_stop(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamic_seek_to()
+ */
+extern void test__f_string_dynamic_seek_to__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamic_seek_to()
+ */
+extern void test__f_string_dynamic_seek_to__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamic_seek_to_h
index 8f05603f760a47eb5ab82b8c46f532306dcdb66d..de7fde5015c9700c73e953db02a57c0e3cf8e238 100644 (file)
@@ -7,7 +7,7 @@ extern "C" {
 
 void test__f_string_dynamics_append__works(void **state) {
 
-  const f_string_static_t source = macro_f_string_static_t_initialize("test", 0, 4);
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
   f_string_dynamics_t destination = f_string_dynamics_t_initialize;
 
   {
@@ -18,6 +18,7 @@ void test__f_string_dynamics_append__works(void **state) {
     assert_int_equal(destination.array[0].used, source.used);
 
     assert_string_equal(destination.array[0].string, source.string);
+    assert_string_equal(destination.array[0].string + 3, source.string + 3);
   }
 
   free((void *) destination.array[0].string);
index 6f75af57a5799ae71b0ae391615ee64feed2abde..1646c2dd7c6ecbddc6dd299f24b7cd434eff53e2 100644 (file)
@@ -12,7 +12,7 @@ void test__f_string_dynamics_append_all__works(void **state) {
   f_string_dynamics_t destination = f_string_dynamics_t_initialize;
 
   const f_string_static_t test_sources[] = {
-    macro_f_string_static_t_initialize("test1", 0, 5),
+    macro_f_string_static_t_initialize("te\0st1", 0, 6),
     macro_f_string_static_t_initialize("test2", 0, 5),
   };
 
@@ -27,8 +27,10 @@ void test__f_string_dynamics_append_all__works(void **state) {
       status = f_string_dynamic_append(test_sources[source.used], &source.array[source.used]);
 
       assert_int_equal(status, F_none);
-      assert_string_equal(source.array[source.used].string, test_sources[source.used].string);
       assert_int_equal(source.array[source.used].used, test_sources[source.used].used);
+
+      assert_string_equal(source.array[source.used].string, test_sources[source.used].string);
+      assert_string_equal(source.array[source.used].string + 3, test_sources[source.used].string + 3);
     } // for
   }
 
diff --git a/level_0/f_string/tests/unit/c/test-string-mash.c b/level_0/f_string/tests/unit/c/test-string-mash.c
new file mode 100644 (file)
index 0000000..870c92b
--- /dev/null
@@ -0,0 +1,54 @@
+#include "test-string.h"
+#include "test-string-mash.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_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, 5);
+  const f_string_static_t expected = macro_f_string_static_t_initialize("te\0st:te\0st", 0, 11);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_mash(glue.string, glue.used, source.string, source.used, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  // Check that the glue is added.
+  {
+    const f_status_t status = f_string_mash(glue.string, glue.used, source.string, source.used, &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);
+    assert_string_equal(destination.string + 9, expected.string + 9);
+  }
+
+  free((void *) destination.string);
+}
+
+void test__f_string_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_status_t status = f_string_mash(glue.string, glue.used, source.string, source.used, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-mash.h b/level_0/f_string/tests/unit/c/test-string-mash.h
new file mode 100644 (file)
index 0000000..548f5b3
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_mash_h
+#define _TEST__F_string_mash_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mash()
+ */
+extern void test__f_string_mash__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_mash()
+ */
+extern void test__f_string_mash__parameter_checking(void **state);
+
+#endif // _TEST__F_string_mash_h
diff --git a/level_0/f_string/tests/unit/c/test-string-mash_nulless.c b/level_0/f_string/tests/unit/c/test-string-mash_nulless.c
new file mode 100644 (file)
index 0000000..55fabbb
--- /dev/null
@@ -0,0 +1,52 @@
+#include "test-string.h"
+#include "test-string-mash_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_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, 5);
+  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);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_mash_nulless(glue.string, glue.used, source.string, source.used, &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_mash_nulless(glue.string, glue.used, source.string, source.used, &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_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_status_t status = f_string_mash_nulless(glue.string, glue.used, source.string, source.used, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-mash_nulless.h b/level_0/f_string/tests/unit/c/test-string-mash_nulless.h
new file mode 100644 (file)
index 0000000..b63dc5d
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_mash_nulless_h
+#define _TEST__F_string_mash_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mash_nulless()
+ */
+extern void test__f_string_mash_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_mash_nulless()
+ */
+extern void test__f_string_mash_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_mash_nulless_h
diff --git a/level_0/f_string/tests/unit/c/test-string-mish.c b/level_0/f_string/tests/unit/c/test-string-mish.c
new file mode 100644 (file)
index 0000000..b090e98
--- /dev/null
@@ -0,0 +1,54 @@
+#include "test-string.h"
+#include "test-string-mish.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_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, 5);
+  const f_string_static_t expected = macro_f_string_static_t_initialize("te\0st:te\0st", 0, 11);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_mish(glue.string, glue.used, source.string, source.used, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  // Check that the glue is added.
+  {
+    const f_status_t status = f_string_mish(glue.string, glue.used, source.string, source.used, &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);
+    assert_string_equal(destination.string + 9, expected.string + 9);
+  }
+
+  free((void *) destination.string);
+}
+
+void test__f_string_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_status_t status = f_string_mish(glue.string, glue.used, source.string, source.used, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-mish.h b/level_0/f_string/tests/unit/c/test-string-mish.h
new file mode 100644 (file)
index 0000000..206ef67
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_mish_h
+#define _TEST__F_string_mish_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mish()
+ */
+extern void test__f_string_mish__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_mish()
+ */
+extern void test__f_string_mish__parameter_checking(void **state);
+
+#endif // _TEST__F_string_mish_h
diff --git a/level_0/f_string/tests/unit/c/test-string-mish_nulless.c b/level_0/f_string/tests/unit/c/test-string-mish_nulless.c
new file mode 100644 (file)
index 0000000..4024fe8
--- /dev/null
@@ -0,0 +1,52 @@
+#include "test-string.h"
+#include "test-string-mish_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_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, 5);
+  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);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_mish_nulless(glue.string, glue.used, source.string, source.used, &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_mish_nulless(glue.string, glue.used, source.string, source.used, &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_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_status_t status = f_string_mish_nulless(glue.string, glue.used, source.string, source.used, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-mish_nulless.h b/level_0/f_string/tests/unit/c/test-string-mish_nulless.h
new file mode 100644 (file)
index 0000000..7344f28
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_mish_nulless_h
+#define _TEST__F_string_mish_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mish_nulless()
+ */
+extern void test__f_string_mish_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_mish_nulless()
+ */
+extern void test__f_string_mish_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_mish_nulless_h
diff --git a/level_0/f_string/tests/unit/c/test-string-prepend.c b/level_0/f_string/tests/unit/c/test-string-prepend.c
new file mode 100644 (file)
index 0000000..d1a6f71
--- /dev/null
@@ -0,0 +1,39 @@
+#include "test-string.h"
+#include "test-string-prepend.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_prepend__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_prepend(source.string, source.used, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  free((void *) destination.string);
+}
+
+void test__f_string_prepend__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_prepend(data.string, data.used, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-prepend.h b/level_0/f_string/tests/unit/c/test-string-prepend.h
new file mode 100644 (file)
index 0000000..70ffe88
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_prepend_h
+#define _TEST__F_string_prepend_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_prepend()
+ */
+extern void test__f_string_prepend__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_prepend()
+ */
+extern void test__f_string_prepend__parameter_checking(void **state);
+
+#endif // _TEST__F_string_prepend_h
diff --git a/level_0/f_string/tests/unit/c/test-string-prepend_assure.c b/level_0/f_string/tests/unit/c/test-string-prepend_assure.c
new file mode 100644 (file)
index 0000000..6d2867a
--- /dev/null
@@ -0,0 +1,50 @@
+#include "test-string.h"
+#include "test-string-prepend_assure.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_prepend_assure__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_prepend_assure(source.string, source.used, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  // The string already exists, so destination should be unchanged.
+  {
+    const f_status_t status = f_string_prepend_assure(source.string, source.used, &destination);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(destination.used, source.used);
+
+    assert_string_equal(destination.string, source.string);
+    assert_string_equal(destination.string + 3, source.string + 3);
+  }
+
+  free((void *) destination.string);
+}
+
+void test__f_string_prepend_assure__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_prepend_assure(data.string, data.used, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-prepend_assure.h b/level_0/f_string/tests/unit/c/test-string-prepend_assure.h
new file mode 100644 (file)
index 0000000..a13c8e6
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_prepend_assure_h
+#define _TEST__F_string_prepend_assure_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_prepend_assure()
+ */
+extern void test__f_string_prepend_assure__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_prepend_assure()
+ */
+extern void test__f_string_prepend_assure__parameter_checking(void **state);
+
+#endif // _TEST__F_string_prepend_assure_h
diff --git a/level_0/f_string/tests/unit/c/test-string-prepend_assure_nulless.c b/level_0/f_string/tests/unit/c/test-string-prepend_assure_nulless.c
new file mode 100644 (file)
index 0000000..0fb73a1
--- /dev/null
@@ -0,0 +1,49 @@
+#include "test-string.h"
+#include "test-string-prepend_assure_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_prepend_assure_nulless__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  const f_string_static_t expected = macro_f_string_static_t_initialize("test", 0, 4);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_prepend_assure_nulless(source.string, source.used, &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_prepend_assure_nulless(source.string, source.used, &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_prepend_assure_nulless__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_prepend_assure_nulless(data.string, data.used, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-prepend_assure_nulless.h b/level_0/f_string/tests/unit/c/test-string-prepend_assure_nulless.h
new file mode 100644 (file)
index 0000000..ed9b295
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_prepend_assure_nulless_h
+#define _TEST__F_string_prepend_assure_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_prepend_assure_nulless()
+ */
+extern void test__f_string_prepend_assure_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_prepend_assure_nulless()
+ */
+extern void test__f_string_prepend_assure_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_prepend_assure_nulless_h
diff --git a/level_0/f_string/tests/unit/c/test-string-prepend_nulless.c b/level_0/f_string/tests/unit/c/test-string-prepend_nulless.c
new file mode 100644 (file)
index 0000000..9da9e99
--- /dev/null
@@ -0,0 +1,39 @@
+#include "test-string.h"
+#include "test-string-prepend_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_prepend_nulless__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\0st", 0, 5);
+  const f_string_static_t expected = macro_f_string_static_t_initialize("test", 0, 4);
+  f_string_dynamic_t destination = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_prepend_nulless(source.string, source.used, &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_prepend_nulless__parameter_checking(void **state) {
+
+  const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+  {
+    const f_status_t status = f_string_prepend_nulless(data.string, data.used, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-prepend_nulless.h b/level_0/f_string/tests/unit/c/test-string-prepend_nulless.h
new file mode 100644 (file)
index 0000000..3b96a1d
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * 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_prepend_nulless_h
+#define _TEST__F_string_prepend_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_prepend_nulless()
+ */
+extern void test__f_string_prepend_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_prepend_nulless()
+ */
+extern void test__f_string_prepend_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_string_prepend_nulless_h
diff --git a/level_0/f_string/tests/unit/c/test-string-seek_line.c b/level_0/f_string/tests/unit/c/test-string-seek_line.c
new file mode 100644 (file)
index 0000000..7732e53
--- /dev/null
@@ -0,0 +1,66 @@
+#include "test-string.h"
+#include "test-string-seek_line.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_seek_line__returns_data_not_stop(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("test\nafter", 0, 10);
+
+  {
+    f_string_range_t range = f_string_range_t_initialize;
+
+    const f_status_t status = f_string_seek_line(source.string, &range);
+
+    assert_int_equal(status, F_data_not_stop);
+  }
+}
+
+void test__f_string_seek_line__returns_none_stop(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("test", 0, 4);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_seek_line(source.string, &range);
+
+    assert_int_equal(status, F_none_stop);
+
+    assert_int_equal(range.start, source.used);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_seek_line__works(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("test\nafter", 0, 10);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_seek_line(source.string, &range);
+
+    assert_int_equal(status, F_none);
+
+    assert_int_equal(range.start, 4);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_seek_line__parameter_checking(void **state) {
+
+  const f_string_static_t source = macro_f_string_static_t_initialize("teX\nst", 0, 6);
+
+  {
+    const f_status_t status = f_string_seek_line(source.string, 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-seek_line.h b/level_0/f_string/tests/unit/c/test-string-seek_line.h
new file mode 100644 (file)
index 0000000..ab8d7e6
--- /dev/null
@@ -0,0 +1,41 @@
+/**
+ * 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_seek_line_h
+#define _TEST__F_string_seek_line_h
+
+/**
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ *
+ * @see f_string_seek_line()
+ */
+extern void test__f_string_seek_line__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_string_seek_line()
+ */
+extern void test__f_string_seek_line__returns_none_stop(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_seek_line()
+ */
+extern void test__f_string_seek_line__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_seek_line()
+ */
+extern void test__f_string_seek_line__parameter_checking(void **state);
+
+#endif // _TEST__F_string_seek_line_h
diff --git a/level_0/f_string/tests/unit/c/test-string-seek_line_to.c b/level_0/f_string/tests/unit/c/test-string-seek_line_to.c
new file mode 100644 (file)
index 0000000..ee1a1a4
--- /dev/null
@@ -0,0 +1,87 @@
+#include "test-string.h"
+#include "test-string-seek_line_to.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_seek_line_to__at_newline(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\nXst", 0, 6);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_seek_line_to(source.string, to.string[0], &range);
+
+    assert_int_equal(status, F_none_eol);
+
+    assert_int_equal(range.start, 2);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_seek_line_to__returns_data_not_stop(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("test\nafter", 0, 10);
+
+  {
+    f_string_range_t range = f_string_range_t_initialize;
+
+    const f_status_t status = f_string_seek_line_to(source.string, to.string[0], &range);
+
+    assert_int_equal(status, F_data_not_stop);
+  }
+}
+
+void test__f_string_seek_line_to__returns_none_stop(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("test", 0, 4);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_seek_line_to(source.string, to.string[0], &range);
+
+    assert_int_equal(status, F_none_stop);
+
+    assert_int_equal(range.start, source.used);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_seek_line_to__works(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("teX\nst", 0, 6);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_seek_line_to(source.string, to.string[0], &range);
+
+    assert_int_equal(status, F_none);
+
+    assert_int_equal(range.start, 2);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_seek_line_to__parameter_checking(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("teX\nst", 0, 6);
+
+  {
+    const f_status_t status = f_string_seek_line_to(source.string, to.string[0], 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-seek_line_to.h b/level_0/f_string/tests/unit/c/test-string-seek_line_to.h
new file mode 100644 (file)
index 0000000..7a8e5f8
--- /dev/null
@@ -0,0 +1,48 @@
+/**
+ * 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_seek_line_to_h
+#define _TEST__F_string_seek_line_to_h
+
+/**
+ * Test that the function works but stops at newline rather than search string.
+ *
+ * @see f_string_seek_line_to()
+ */
+extern void test__f_string_seek_line_to__at_newline(void **state);
+
+/**
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ *
+ * @see f_string_seek_line_to()
+ */
+extern void test__f_string_seek_line_to__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_string_seek_line_to()
+ */
+extern void test__f_string_seek_line_to__returns_none_stop(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_seek_line_to()
+ */
+extern void test__f_string_seek_line_to__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_seek_line_to()
+ */
+extern void test__f_string_seek_line_to__parameter_checking(void **state);
+
+#endif // _TEST__F_string_seek_line_to_h
diff --git a/level_0/f_string/tests/unit/c/test-string-seek_to.c b/level_0/f_string/tests/unit/c/test-string-seek_to.c
new file mode 100644 (file)
index 0000000..55a8cdf
--- /dev/null
@@ -0,0 +1,70 @@
+#include "test-string.h"
+#include "test-string-seek_to.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_seek_to__returns_data_not_stop(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("test\nafter", 0, 10);
+
+  {
+    f_string_range_t range = f_string_range_t_initialize;
+
+    const f_status_t status = f_string_seek_to(source.string, to.string[0], &range);
+
+    assert_int_equal(status, F_data_not_stop);
+  }
+}
+
+void test__f_string_seek_to__returns_none_stop(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("test\nafter", 0, 10);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_seek_to(source.string, to.string[0], &range);
+
+    assert_int_equal(status, F_none_stop);
+
+    assert_int_equal(range.start, source.used);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_seek_to__works(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("te\nXst", 0, 6);
+
+  {
+    f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+    const f_status_t status = f_string_seek_to(source.string, to.string[0], &range);
+
+    assert_int_equal(status, F_none);
+
+    assert_int_equal(range.start, 3);
+    assert_int_equal(range.stop, source.used - 1);
+  }
+}
+
+void test__f_string_seek_to__parameter_checking(void **state) {
+
+  const f_string_static_t to = macro_f_string_static_t_initialize("X", 0, 1);
+  const f_string_static_t source = macro_f_string_static_t_initialize("teX\nst", 0, 6);
+
+  {
+    const f_status_t status = f_string_seek_to(source.string, to.string[0], 0);
+
+    assert_int_equal(status, F_status_set_error(F_parameter));
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_string/tests/unit/c/test-string-seek_to.h b/level_0/f_string/tests/unit/c/test-string-seek_to.h
new file mode 100644 (file)
index 0000000..3596d2f
--- /dev/null
@@ -0,0 +1,41 @@
+/**
+ * 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_seek_to_h
+#define _TEST__F_string_seek_to_h
+
+/**
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ *
+ * @see f_string_seek_to()
+ */
+extern void test__f_string_seek_to__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_string_seek_to()
+ */
+extern void test__f_string_seek_to__returns_none_stop(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_seek_to()
+ */
+extern void test__f_string_seek_to__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_seek_to()
+ */
+extern void test__f_string_seek_to__parameter_checking(void **state);
+
+#endif // _TEST__F_string_seek_to_h
index 1508cd3dadd3d5ddd64cf6e1c36c958836565823..0b5e2205de462ed6d902ebd68b09473ec3ed20a6 100644 (file)
@@ -19,6 +19,43 @@ int setdown(void **state) {
 int main(void) {
 
   const struct CMUnitTest tests[] = {
+    cmocka_unit_test(test__f_string_append__works),
+    cmocka_unit_test(test__f_string_append_assure__works),
+    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_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_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_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_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_line__works),
+
+    cmocka_unit_test(test__f_string_dynamic_seek_line_to__at_newline),
+    cmocka_unit_test(test__f_string_dynamic_seek_line_to__returns_data_not_stop),
+    cmocka_unit_test(test__f_string_dynamic_seek_line_to__returns_none_eos),
+    cmocka_unit_test(test__f_string_dynamic_seek_line_to__returns_none_stop),
+    cmocka_unit_test(test__f_string_dynamic_seek_line_to__works),
+
+    cmocka_unit_test(test__f_string_dynamic_seek_to__returns_data_not_stop),
+    cmocka_unit_test(test__f_string_dynamic_seek_to__returns_none_eos),
+    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_dynamics_adjust__works),
     cmocka_unit_test(test__f_string_dynamics_append__works),
     cmocka_unit_test(test__f_string_dynamics_append_all__works),
@@ -42,6 +79,29 @@ int main(void) {
     cmocka_unit_test(test__f_string_dynamicss_increase_by__works),
     cmocka_unit_test(test__f_string_dynamicss_resize__works),
 
+    cmocka_unit_test(test__f_string_map_multis_adjust__works),
+    cmocka_unit_test(test__f_string_map_multis_append__works),
+    cmocka_unit_test(test__f_string_map_multis_append_all__works),
+    cmocka_unit_test(test__f_string_map_multis_append_all__returns_data_not),
+    cmocka_unit_test(test__f_string_map_multis_decimate_by__works),
+    cmocka_unit_test(test__f_string_map_multis_decrease_by__works),
+    cmocka_unit_test(test__f_string_map_multis_increase__works),
+    cmocka_unit_test(test__f_string_map_multis_increase__returns_data_not),
+    cmocka_unit_test(test__f_string_map_multis_increase_by__works),
+    cmocka_unit_test(test__f_string_map_multis_resize__works),
+
+    cmocka_unit_test(test__f_string_map_multiss_adjust__works),
+    cmocka_unit_test(test__f_string_map_multiss_append__works),
+    cmocka_unit_test(test__f_string_map_multiss_append__returns_data_not),
+    cmocka_unit_test(test__f_string_map_multiss_append_all__works),
+    cmocka_unit_test(test__f_string_map_multiss_append_all__returns_data_not),
+    cmocka_unit_test(test__f_string_map_multiss_decimate_by__works),
+    cmocka_unit_test(test__f_string_map_multiss_decrease_by__works),
+    cmocka_unit_test(test__f_string_map_multiss_increase__works),
+    cmocka_unit_test(test__f_string_map_multiss_increase__returns_data_not),
+    cmocka_unit_test(test__f_string_map_multiss_increase_by__works),
+    cmocka_unit_test(test__f_string_map_multiss_resize__works),
+
     cmocka_unit_test(test__f_string_maps_adjust__works),
     cmocka_unit_test(test__f_string_maps_append__works),
     cmocka_unit_test(test__f_string_maps_append_all__works),
@@ -65,28 +125,16 @@ int main(void) {
     cmocka_unit_test(test__f_string_mapss_increase_by__works),
     cmocka_unit_test(test__f_string_mapss_resize__works),
 
-    cmocka_unit_test(test__f_string_map_multis_adjust__works),
-    cmocka_unit_test(test__f_string_map_multis_append__works),
-    cmocka_unit_test(test__f_string_map_multis_append_all__works),
-    cmocka_unit_test(test__f_string_map_multis_append_all__returns_data_not),
-    cmocka_unit_test(test__f_string_map_multis_decimate_by__works),
-    cmocka_unit_test(test__f_string_map_multis_decrease_by__works),
-    cmocka_unit_test(test__f_string_map_multis_increase__works),
-    cmocka_unit_test(test__f_string_map_multis_increase__returns_data_not),
-    cmocka_unit_test(test__f_string_map_multis_increase_by__works),
-    cmocka_unit_test(test__f_string_map_multis_resize__works),
+    cmocka_unit_test(test__f_string_mash__works),
+    cmocka_unit_test(test__f_string_mash_nulless__works),
 
-    cmocka_unit_test(test__f_string_map_multiss_adjust__works),
-    cmocka_unit_test(test__f_string_map_multiss_append__works),
-    cmocka_unit_test(test__f_string_map_multiss_append__returns_data_not),
-    cmocka_unit_test(test__f_string_map_multiss_append_all__works),
-    cmocka_unit_test(test__f_string_map_multiss_append_all__returns_data_not),
-    cmocka_unit_test(test__f_string_map_multiss_decimate_by__works),
-    cmocka_unit_test(test__f_string_map_multiss_decrease_by__works),
-    cmocka_unit_test(test__f_string_map_multiss_increase__works),
-    cmocka_unit_test(test__f_string_map_multiss_increase__returns_data_not),
-    cmocka_unit_test(test__f_string_map_multiss_increase_by__works),
-    cmocka_unit_test(test__f_string_map_multiss_resize__works),
+    cmocka_unit_test(test__f_string_mish__works),
+    cmocka_unit_test(test__f_string_mish_nulless__works),
+
+    cmocka_unit_test(test__f_string_prepend__works),
+    cmocka_unit_test(test__f_string_prepend_assure__works),
+    cmocka_unit_test(test__f_string_prepend_assure_nulless__works),
+    cmocka_unit_test(test__f_string_prepend_nulless__works),
 
     cmocka_unit_test(test__f_string_quantitys_adjust__works),
     cmocka_unit_test(test__f_string_quantitys_append__works),
@@ -157,7 +205,25 @@ int main(void) {
     cmocka_unit_test(test__f_string_tripless_increase_by__works),
     cmocka_unit_test(test__f_string_tripless_resize__works),
 
+    cmocka_unit_test(test__f_string_seek_line__returns_data_not_stop),
+    cmocka_unit_test(test__f_string_seek_line__returns_none_stop),
+    cmocka_unit_test(test__f_string_seek_line__works),
+
+    cmocka_unit_test(test__f_string_seek_line_to__at_newline),
+    cmocka_unit_test(test__f_string_seek_line_to__returns_data_not_stop),
+    cmocka_unit_test(test__f_string_seek_line_to__returns_none_stop),
+    cmocka_unit_test(test__f_string_seek_line_to__works),
+
+    cmocka_unit_test(test__f_string_seek_to__returns_data_not_stop),
+    cmocka_unit_test(test__f_string_seek_to__returns_none_stop),
+    cmocka_unit_test(test__f_string_seek_to__works),
+
     #ifndef _di_level_0_parameter_checking_
+      cmocka_unit_test(test__f_string_append__parameter_checking),
+      cmocka_unit_test(test__f_string_append_assure__parameter_checking),
+      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_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),
@@ -176,6 +242,24 @@ int main(void) {
       cmocka_unit_test(test__f_string_dynamicss_increase_by__parameter_checking),
       cmocka_unit_test(test__f_string_dynamicss_resize__parameter_checking),
 
+      cmocka_unit_test(test__f_string_map_multis_adjust__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multis_append__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multis_append_all__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multis_decimate_by__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multis_decrease_by__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multis_increase__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multis_increase_by__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multis_resize__parameter_checking),
+
+      cmocka_unit_test(test__f_string_map_multiss_adjust__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multiss_append__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multiss_append_all__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multiss_decimate_by__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multiss_decrease_by__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multiss_increase__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multiss_increase_by__parameter_checking),
+      cmocka_unit_test(test__f_string_map_multiss_resize__parameter_checking),
+
       cmocka_unit_test(test__f_string_maps_adjust__parameter_checking),
       cmocka_unit_test(test__f_string_maps_append__parameter_checking),
       cmocka_unit_test(test__f_string_maps_append_all__parameter_checking),
@@ -194,23 +278,16 @@ int main(void) {
       cmocka_unit_test(test__f_string_mapss_increase_by__parameter_checking),
       cmocka_unit_test(test__f_string_mapss_resize__parameter_checking),
 
-      cmocka_unit_test(test__f_string_map_multis_adjust__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multis_append__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multis_append_all__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multis_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multis_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multis_increase__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multis_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multis_resize__parameter_checking),
+      cmocka_unit_test(test__f_string_mash__parameter_checking),
+      cmocka_unit_test(test__f_string_mash_nulless__parameter_checking),
 
-      cmocka_unit_test(test__f_string_map_multiss_adjust__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multiss_append__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multiss_append_all__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multiss_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multiss_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multiss_increase__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multiss_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_string_map_multiss_resize__parameter_checking),
+      cmocka_unit_test(test__f_string_mish__parameter_checking),
+      cmocka_unit_test(test__f_string_mish_nulless__parameter_checking),
+
+      cmocka_unit_test(test__f_string_prepend__parameter_checking),
+      cmocka_unit_test(test__f_string_prepend_assure__parameter_checking),
+      cmocka_unit_test(test__f_string_prepend_assure_nulless__parameter_checking),
+      cmocka_unit_test(test__f_string_prepend_nulless__parameter_checking),
 
       cmocka_unit_test(test__f_string_quantitys_adjust__parameter_checking),
       cmocka_unit_test(test__f_string_quantitys_append__parameter_checking),
@@ -265,6 +342,12 @@ int main(void) {
       cmocka_unit_test(test__f_string_tripless_increase__parameter_checking),
       cmocka_unit_test(test__f_string_tripless_increase_by__parameter_checking),
       cmocka_unit_test(test__f_string_tripless_resize__parameter_checking),
+
+      cmocka_unit_test(test__f_string_seek_line__parameter_checking),
+
+      cmocka_unit_test(test__f_string_seek_line_to__parameter_checking),
+
+      cmocka_unit_test(test__f_string_seek_to__parameter_checking),
     #endif // _di_level_0_parameter_checking_
   };
 
index ac58762a8aa89a27619d8caecba0b73e66ffcc55..5f6fb386ff90a2f818babc1d9e4d1309d2c7c3c6 100644 (file)
 //#include "mock-string.h"
 
 // Test includes.
+#include "test-string-append.h"
+#include "test-string-append_assure.h"
+#include "test-string-append_assure_nulless.h"
+#include "test-string-append_nulless.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_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_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_seek_line.h"
+#include "test-string-dynamic_seek_line_to.h"
+#include "test-string-dynamic_seek_to.h"
 #include "test-string-dynamics_adjust.h"
 #include "test-string-dynamics_append.h"
 #include "test-string-dynamics_append_all.h"
 #include "test-string-dynamicss_increase.h"
 #include "test-string-dynamicss_increase_by.h"
 #include "test-string-dynamicss_resize.h"
-#include "test-string-maps_adjust.h"
-#include "test-string-maps_append.h"
-#include "test-string-maps_append_all.h"
-#include "test-string-maps_decimate_by.h"
-#include "test-string-maps_decrease_by.h"
-#include "test-string-maps_increase.h"
-#include "test-string-maps_increase_by.h"
-#include "test-string-maps_resize.h"
-#include "test-string-mapss_adjust.h"
-#include "test-string-mapss_append.h"
-#include "test-string-mapss_append_all.h"
-#include "test-string-mapss_decimate_by.h"
-#include "test-string-mapss_decrease_by.h"
-#include "test-string-mapss_increase.h"
-#include "test-string-mapss_increase_by.h"
-#include "test-string-mapss_resize.h"
 #include "test-string-map_multis_adjust.h"
 #include "test-string-map_multis_append.h"
 #include "test-string-map_multis_append_all.h"
 #include "test-string-map_multiss_increase.h"
 #include "test-string-map_multiss_increase_by.h"
 #include "test-string-map_multiss_resize.h"
+#include "test-string-maps_adjust.h"
+#include "test-string-maps_append.h"
+#include "test-string-maps_append_all.h"
+#include "test-string-maps_decimate_by.h"
+#include "test-string-maps_decrease_by.h"
+#include "test-string-maps_increase.h"
+#include "test-string-maps_increase_by.h"
+#include "test-string-maps_resize.h"
+#include "test-string-mapss_adjust.h"
+#include "test-string-mapss_append.h"
+#include "test-string-mapss_append_all.h"
+#include "test-string-mapss_decimate_by.h"
+#include "test-string-mapss_decrease_by.h"
+#include "test-string-mapss_increase.h"
+#include "test-string-mapss_increase_by.h"
+#include "test-string-mapss_resize.h"
+#include "test-string-mash.h"
+#include "test-string-mash_nulless.h"
+#include "test-string-mish.h"
+#include "test-string-mish_nulless.h"
+#include "test-string-prepend.h"
+#include "test-string-prepend_assure.h"
+#include "test-string-prepend_assure_nulless.h"
+#include "test-string-prepend_nulless.h"
 #include "test-string-quantitys_adjust.h"
 #include "test-string-quantitys_append.h"
 #include "test-string-quantitys_append_all.h"
 #include "test-string-rangess_increase.h"
 #include "test-string-rangess_increase_by.h"
 #include "test-string-rangess_resize.h"
+#include "test-string-seek_line.h"
+#include "test-string-seek_line_to.h"
+#include "test-string-seek_to.h"
 #include "test-string-triples_adjust.h"
 #include "test-string-triples_append.h"
 #include "test-string-triples_append_all.h"