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.
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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_dynamic_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
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;
{
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);
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),
};
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
}
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
--- /dev/null
+#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
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_string_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
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),
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),
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),
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),
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),
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),
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_
};
//#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"