Given the size of the task and my relative inexperience with cmocka, I opted to keep the tests as simple as possible.
This means that my tests are likely not thorough.
These are intended to be good enough for a first pass tests.
After all, I have the entire rest of the FLL projects to write tests for (as well as for the programs).
--- /dev/null
+# fss-0000
+
+cmocka 1.*
--- /dev/null
+# fss-0001
+
+project_name test-f_type_array
+
+version_major 0
+version_file major
+version_target major
+
+modes individual level monolithic
+modes_default individual
+
+build_compiler gcc
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+build_libraries -lc -lcmocka
+build_libraries-individual -lf_memory -lf_type_array
+build_libraries-level -lfll_0
+build_libraries-monolithic -lfll
+build_sources_program test-type_array-array_lengths_adjust.c test-type_array-array_lengths_append.c test-type_array-array_lengths_decimate_by.c test-type_array-array_lengths_decrease_by.c test-type_array-array_lengths_increase.c test-type_array-array_lengths_increase_by.c test-type_array-array_lengths_resize.c
+build_sources_program test-type_array-array_lengthss_adjust.c test-type_array-array_lengthss_append.c test-type_array-array_lengthss_decimate_by.c test-type_array-array_lengthss_decrease_by.c test-type_array-array_lengthss_increase.c test-type_array-array_lengthss_increase_by.c test-type_array-array_lengthss_resize.c
+build_sources_program test-type_array-fll_ids_adjust.c test-type_array-fll_ids_append.c test-type_array-fll_ids_decimate_by.c test-type_array-fll_ids_decrease_by.c test-type_array-fll_ids_increase.c test-type_array-fll_ids_increase_by.c test-type_array-fll_ids_resize.c
+build_sources_program test-type_array-fll_idss_adjust.c test-type_array-fll_idss_append.c test-type_array-fll_idss_decimate_by.c test-type_array-fll_idss_decrease_by.c test-type_array-fll_idss_increase.c test-type_array-fll_idss_increase_by.c test-type_array-fll_idss_resize.c
+build_sources_program test-type_array-cells_adjust.c test-type_array-cells_append.c test-type_array-cells_decimate_by.c test-type_array-cells_decrease_by.c test-type_array-cells_increase.c test-type_array-cells_increase_by.c test-type_array-cells_resize.c
+build_sources_program test-type_array-states_adjust.c test-type_array-states_append.c test-type_array-states_decimate_by.c test-type_array-states_decrease_by.c test-type_array-states_increase.c test-type_array-states_increase_by.c test-type_array-states_resize.c
+build_sources_program test-type_array-statess_adjust.c test-type_array-statess_append.c test-type_array-statess_decimate_by.c test-type_array-statess_decrease_by.c test-type_array-statess_increase.c test-type_array-statess_increase_by.c test-type_array-statess_resize.c
+build_sources_program test-type_array-cellss_adjust.c test-type_array-cellss_append.c test-type_array-cellss_decimate_by.c test-type_array-cellss_decrease_by.c test-type_array-cellss_increase.c test-type_array-cellss_increase_by.c test-type_array-cellss_resize.c
+build_sources_program test-type_array-statuss_adjust.c test-type_array-statuss_append.c test-type_array-statuss_decimate_by.c test-type_array-statuss_decrease_by.c test-type_array-statuss_increase.c test-type_array-statuss_increase_by.c test-type_array-statuss_resize.c
+build_sources_program test-type_array-statusss_adjust.c test-type_array-statusss_append.c test-type_array-statusss_decimate_by.c test-type_array-statusss_decrease_by.c test-type_array-statusss_increase.c test-type_array-statusss_increase_by.c test-type_array-statusss_resize.c
+
+build_sources_program test-type_array.c
+build_script no
+build_shared yes
+build_static no
+
+path_headers tests/c
+path_headers_preserve no
+path_sources tests/c
+path_standard no
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+defines -Ibuild/includes
+defines_static -Lbuild/libraries/static
+defines_shared -Lbuild/libraries/shared
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-logical-op-parentheses -Wno-parentheses
+flags_program -fPIE
+flags_program_shared
+flags_program_static
+flags_shared
+flags_static
--- /dev/null
+# fss-0005 iki-0002
+
+settings:
+ load_build yes
+ fail exit
+
+ environment LD_LIBRARY_PATH
+
+main:
+ build settings
+ build settings-tests
+
+ if exists build/programs/shared/test-f_type_array
+ shell build/programs/shared/test-f_type_array
+
+ if exists build/programs/static/test-f_type_array
+ run build/programs/static/test-f_type_array
+
+ if not exists build/programs/shared/test-f_type_array
+ and not exists build/programs/static/test-f_type_array
+ operate not_created
+
+not_created:
+ print
+ print Faled to test due to being unable to find either a shared or static test binary to perform tests.
+
+ exit failure
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengths_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengths_adjust__works(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_array_lengths_adjust__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__array_lengths_adjust
+#define _TEST__F_type_array__array_lengths_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengths_adjust()
+ */
+extern void test__f_type_array_array_lengths_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengths_adjust()
+ */
+extern void test__f_type_array_array_lengths_adjust__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengths_adjust
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengths_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengths_append__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_array_lengths_t source = f_array_lengths_t_initialize;
+ f_array_lengths_t destination = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_type_array_lengths_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_array_lengths_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t source = f_array_lengths_t_initialize;
+ f_array_lengths_t destination = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_array_lengths_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ }
+
+ free((void *) source.array);
+ assert_null(destination.array);
+}
+
+void test__f_type_array_array_lengths_append__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__array_lengths_append
+#define _TEST__F_type_array__array_lengths_append
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengths_append()
+ */
+extern void test__f_type_array_array_lengths_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_array_lengths_append()
+ */
+extern void test__f_type_array_array_lengths_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengths_append()
+ */
+extern void test__f_type_array_array_lengths_append__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengths_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengths_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengths_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_array_lengths_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_array_lengths_decimate_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__array_lengths_decimate_by
+#define _TEST__F_type_array__array_lengths_decimate_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengths_decimate_by()
+ */
+extern void test__f_type_array_array_lengths_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengths_decimate_by()
+ */
+extern void test__f_type_array_array_lengths_decimate_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengths_decimate_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengths_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengths_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_array_lengths_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_array_lengths_decrease_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__array_lengths_decrease_by
+#define _TEST__F_type_array__array_lengths_decrease_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengths_decrease_by()
+ */
+extern void test__f_type_array_array_lengths_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengths_decrease_by()
+ */
+extern void test__f_type_array_array_lengths_decrease_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengths_decrease_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengths_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengths_increase__works(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_array_lengths_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_array_lengths_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_array_lengths_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_array_lengths_increase__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#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_type_array__array_lengths_increase
+#define _TEST__F_type_array__array_lengths_increase
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengths_increase()
+ */
+extern void test__f_type_array_array_lengths_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_array_lengths_increase()
+ */
+extern void test__f_type_array_array_lengths_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengths_increase()
+ */
+extern void test__f_type_array_array_lengths_increase__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengths_increase
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengths_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengths_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_array_lengths_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_array_lengths_increase_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__array_lengths_increase_by
+#define _TEST__F_type_array__array_lengths_increase_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengths_increase_by()
+ */
+extern void test__f_type_array_array_lengths_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengths_increase_by()
+ */
+extern void test__f_type_array_array_lengths_increase_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengths_increase_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengths_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengths_resize__works(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_array_lengths_resize__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__array_lengths_resize
+#define _TEST__F_type_array__array_lengths_resize
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengths_resize()
+ */
+extern void test__f_type_array_array_lengths_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengths_resize()
+ */
+extern void test__f_type_array_array_lengths_resize__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengths_resize
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengthss_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengthss_adjust__works(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengthss_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_array_lengthss_adjust__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengthss_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__array_lengthss_adjust
+#define _TEST__F_type_array__array_lengthss_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengthss_adjust()
+ */
+extern void test__f_type_array_array_lengthss_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengthss_adjust()
+ */
+extern void test__f_type_array_array_lengthss_adjust__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengthss_adjust
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengthss_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengthss_append__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_array_lengthss_t source = f_array_lengths_t_initialize;
+ f_array_lengthss_t destination = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_type_array_lengths_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_type_array_lengthss_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_array_lengthss_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t source = f_array_lengths_t_initialize;
+ f_array_lengthss_t destination = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_array_lengthss_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ }
+
+ free((void *) source.array);
+ assert_null(destination.array);
+}
+
+void test__f_type_array_array_lengthss_append__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__array_lengthss_append
+#define _TEST__F_type_array__array_lengthss_append
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengthss_append()
+ */
+extern void test__f_type_array_array_lengthss_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_array_lengthss_append()
+ */
+extern void test__f_type_array_array_lengthss_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengthss_append()
+ */
+extern void test__f_type_array_array_lengthss_append__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengthss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengthss_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengthss_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_array_lengthss_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_array_lengthss_decimate_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__array_lengthss_decimate_by
+#define _TEST__F_type_array__array_lengthss_decimate_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengthss_decimate_by()
+ */
+extern void test__f_type_array_array_lengthss_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengthss_decimate_by()
+ */
+extern void test__f_type_array_array_lengthss_decimate_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengthss_decimate_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengthss_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengthss_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_array_lengthss_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_array_lengthss_decrease_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__array_lengthss_decrease_by
+#define _TEST__F_type_array__array_lengthss_decrease_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengthss_decrease_by()
+ */
+extern void test__f_type_array_array_lengthss_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengthss_decrease_by()
+ */
+extern void test__f_type_array_array_lengthss_decrease_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengthss_decrease_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengthss_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengthss_increase__works(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_array_lengthss_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_array_lengthss_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_array_lengthss_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_array_lengthss_increase__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#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_type_array__array_lengthss_increase
+#define _TEST__F_type_array__array_lengthss_increase
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengthss_increase()
+ */
+extern void test__f_type_array_array_lengthss_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_array_lengthss_increase()
+ */
+extern void test__f_type_array_array_lengthss_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengthss_increase()
+ */
+extern void test__f_type_array_array_lengthss_increase__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengthss_increase
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengthss_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengthss_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_array_lengthss_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_array_lengthss_increase_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__array_lengthss_increase_by
+#define _TEST__F_type_array__array_lengthss_increase_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengthss_increase_by()
+ */
+extern void test__f_type_array_array_lengthss_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengthss_increase_by()
+ */
+extern void test__f_type_array_array_lengthss_increase_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengthss_increase_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengthss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengthss_resize__works(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengthss_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_array_lengthss_resize__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t data = f_array_lengthss_t_initialize;
+
+ {
+ const f_status_t status = f_type_array_lengthss_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__array_lengthss_resize
+#define _TEST__F_type_array__array_lengthss_resize
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengthss_resize()
+ */
+extern void test__f_type_array_array_lengthss_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengthss_resize()
+ */
+extern void test__f_type_array_array_lengthss_resize__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__array_lengthss_resize
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cells_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cells_adjust__works(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_cells_adjust__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__cells_adjust
+#define _TEST__F_type_array__cells_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cells_adjust()
+ */
+extern void test__f_type_array_cells_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cells_adjust()
+ */
+extern void test__f_type_array_cells_adjust__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cells_adjust
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cells_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cells_append__works(void **state) {
+
+ const int length = 5;
+ f_cells_t source = f_cells_t_initialize;
+ f_cells_t destination = f_cells_t_initialize;
+
+ const f_cell_t cell_0 = { row: 1, column: 2 };
+ const f_cell_t cell_1 = { row: 3, column: 4 };
+
+ {
+ const f_status_t status = f_type_cells_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ memcpy(&source.array[source.used++], (void *) &cell_0, sizeof(f_cell_t));
+ memcpy(&source.array[source.used++], (void *) &cell_1, sizeof(f_cell_t));
+
+ {
+ const f_status_t status = f_type_cells_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ assert_int_equal(destination.array[0].row, cell_0.row);
+ assert_int_equal(destination.array[0].column, cell_0.column);
+
+ assert_int_equal(destination.array[1].row, cell_1.row);
+ assert_int_equal(destination.array[1].column, cell_1.column);
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_cells_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_cells_t source = f_cells_t_initialize;
+ f_cells_t destination = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_cells_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ }
+
+ free((void *) source.array);
+ assert_null(destination.array);
+}
+
+void test__f_type_array_cells_append__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__cells_append
+#define _TEST__F_type_array__cells_append
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cells_append()
+ */
+extern void test__f_type_array_cells_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_cells_append()
+ */
+extern void test__f_type_array_cells_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cells_append()
+ */
+extern void test__f_type_array_cells_append__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cells_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cells_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cells_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_cells_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_cells_decimate_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__cells_decimate_by
+#define _TEST__F_type_array__cells_decimate_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cells_decimate_by()
+ */
+extern void test__f_type_array_cells_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cells_decimate_by()
+ */
+extern void test__f_type_array_cells_decimate_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cells_decimate_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cells_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cells_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_cells_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_cells_decrease_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__cells_decrease_by
+#define _TEST__F_type_array__cells_decrease_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cells_decrease_by()
+ */
+extern void test__f_type_array_cells_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cells_decrease_by()
+ */
+extern void test__f_type_array_cells_decrease_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cells_decrease_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cells_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cells_increase__works(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_cells_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_cells_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_cells_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_cells_increase__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#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_type_array__cells_increase
+#define _TEST__F_type_array__cells_increase
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cells_increase()
+ */
+extern void test__f_type_array_cells_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_cells_increase()
+ */
+extern void test__f_type_array_cells_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cells_increase()
+ */
+extern void test__f_type_array_cells_increase__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cells_increase
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cells_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cells_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_cells_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_cells_increase_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__cells_increase_by
+#define _TEST__F_type_array__cells_increase_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cells_increase_by()
+ */
+extern void test__f_type_array_cells_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cells_increase_by()
+ */
+extern void test__f_type_array_cells_increase_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cells_increase_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cells_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cells_resize__works(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_cells_resize__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cells_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__cells_resize
+#define _TEST__F_type_array__cells_resize
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cells_resize()
+ */
+extern void test__f_type_array_cells_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cells_resize()
+ */
+extern void test__f_type_array_cells_resize__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cells_resize
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cellss_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cellss_adjust__works(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cellss_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_cellss_adjust__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cellss_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__cellss_adjust
+#define _TEST__F_type_array__cellss_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cellss_adjust()
+ */
+extern void test__f_type_array_cellss_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cellss_adjust()
+ */
+extern void test__f_type_array_cellss_adjust__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cellss_adjust
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cellss_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cellss_append__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_cellss_t source = f_cells_t_initialize;
+ f_cellss_t destination = f_cells_t_initialize;
+
+ const f_cell_t cell_0 = { row: 1, column: 2 };
+ const f_cell_t cell_1 = { row: 3, column: 4 };
+
+ {
+ const f_status_t status = f_type_cellss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_type_cells_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &cell_0, sizeof(f_cell_t));
+ memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &cell_1, sizeof(f_cell_t));
+ } // for
+ }
+
+ {
+ const f_status_t status = f_type_cellss_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ assert_int_equal(destination.array[i].array[0].row, cell_0.row);
+ assert_int_equal(destination.array[i].array[0].column, cell_0.column);
+
+ assert_int_equal(destination.array[i].array[1].row, cell_1.row);
+ assert_int_equal(destination.array[i].array[1].column, cell_1.column);
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_cellss_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_cellss_t source = f_cells_t_initialize;
+ f_cellss_t destination = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_cellss_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ }
+
+ free((void *) source.array);
+ assert_null(destination.array);
+}
+
+void test__f_type_array_cellss_append__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__cellss_append
+#define _TEST__F_type_array__cellss_append
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cellss_append()
+ */
+extern void test__f_type_array_cellss_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_cellss_append()
+ */
+extern void test__f_type_array_cellss_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cellss_append()
+ */
+extern void test__f_type_array_cellss_append__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cellss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cellss_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cellss_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_cellss_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_cellss_decimate_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__cellss_decimate_by
+#define _TEST__F_type_array__cellss_decimate_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cellss_decimate_by()
+ */
+extern void test__f_type_array_cellss_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cellss_decimate_by()
+ */
+extern void test__f_type_array_cellss_decimate_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cellss_decimate_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cellss_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cellss_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_cellss_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_cellss_decrease_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__cellss_decrease_by
+#define _TEST__F_type_array__cellss_decrease_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cellss_decrease_by()
+ */
+extern void test__f_type_array_cellss_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cellss_decrease_by()
+ */
+extern void test__f_type_array_cellss_decrease_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cellss_decrease_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cellss_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cellss_increase__works(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_cellss_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_cellss_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_cellss_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_cellss_increase__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#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_type_array__cellss_increase
+#define _TEST__F_type_array__cellss_increase
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cellss_increase()
+ */
+extern void test__f_type_array_cellss_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_cellss_increase()
+ */
+extern void test__f_type_array_cellss_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cellss_increase()
+ */
+extern void test__f_type_array_cellss_increase__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cellss_increase
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cellss_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cellss_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_cellss_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_cellss_increase_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__cellss_increase_by
+#define _TEST__F_type_array__cellss_increase_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cellss_increase_by()
+ */
+extern void test__f_type_array_cellss_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cellss_increase_by()
+ */
+extern void test__f_type_array_cellss_increase_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cellss_increase_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cellss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cellss_resize__works(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cellss_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_cellss_resize__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_cellss_t data = f_cellss_t_initialize;
+
+ {
+ const f_status_t status = f_type_cellss_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__cellss_resize
+#define _TEST__F_type_array__cellss_resize
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cellss_resize()
+ */
+extern void test__f_type_array_cellss_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cellss_resize()
+ */
+extern void test__f_type_array_cellss_resize__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__cellss_resize
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_ids_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_ids_adjust__works(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_fll_ids_adjust__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__fll_ids_adjust
+#define _TEST__F_type_array__fll_ids_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_ids_adjust()
+ */
+extern void test__f_type_array_fll_ids_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_ids_adjust()
+ */
+extern void test__f_type_array_fll_ids_adjust__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_ids_adjust
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_ids_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_ids_append__works(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t source = f_fll_ids_t_initialize;
+ f_fll_ids_t destination = f_fll_ids_t_initialize;
+
+ const f_fll_id_t fll_id_0 = { name: "test", type: 1, used: 4 };
+ const f_fll_id_t fll_id_1 = { name: "other", type: 2, used: 5 };
+
+ {
+ const f_status_t status = f_type_fll_ids_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ memcpy(&source.array[source.used++], (void *) &fll_id_0, sizeof(f_fll_id_t));
+ memcpy(&source.array[source.used++], (void *) &fll_id_1, sizeof(f_fll_id_t));
+
+ {
+ const f_status_t status = f_type_fll_ids_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ assert_string_equal(destination.array[0].name, fll_id_0.name);
+ assert_int_equal(destination.array[0].type, fll_id_0.type);
+ assert_int_equal(destination.array[0].used, fll_id_0.used);
+
+ assert_string_equal(destination.array[1].name, fll_id_1.name);
+ assert_int_equal(destination.array[1].type, fll_id_1.type);
+ assert_int_equal(destination.array[1].used, fll_id_1.used);
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_fll_ids_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t source = f_fll_ids_t_initialize;
+ f_fll_ids_t destination = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_fll_ids_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ }
+
+ free((void *) source.array);
+ assert_null(destination.array);
+}
+
+void test__f_type_array_fll_ids_append__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__fll_ids_append
+#define _TEST__F_type_array__fll_ids_append
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_ids_append()
+ */
+extern void test__f_type_array_fll_ids_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_fll_ids_append()
+ */
+extern void test__f_type_array_fll_ids_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_ids_append()
+ */
+extern void test__f_type_array_fll_ids_append__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_ids_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_ids_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_ids_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_fll_ids_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_fll_ids_decimate_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__fll_ids_decimate_by
+#define _TEST__F_type_array__fll_ids_decimate_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_ids_decimate_by()
+ */
+extern void test__f_type_array_fll_ids_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_ids_decimate_by()
+ */
+extern void test__f_type_array_fll_ids_decimate_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_ids_decimate_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_ids_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_ids_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_fll_ids_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_fll_ids_decrease_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__fll_ids_decrease_by
+#define _TEST__F_type_array__fll_ids_decrease_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_ids_decrease_by()
+ */
+extern void test__f_type_array_fll_ids_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_ids_decrease_by()
+ */
+extern void test__f_type_array_fll_ids_decrease_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_ids_decrease_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_ids_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_ids_increase__works(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_fll_ids_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_fll_ids_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_fll_ids_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_fll_ids_increase__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#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_type_array__fll_ids_increase
+#define _TEST__F_type_array__fll_ids_increase
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_ids_increase()
+ */
+extern void test__f_type_array_fll_ids_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_fll_ids_increase()
+ */
+extern void test__f_type_array_fll_ids_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_ids_increase()
+ */
+extern void test__f_type_array_fll_ids_increase__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_ids_increase
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_ids_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_ids_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_fll_ids_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_fll_ids_increase_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__fll_ids_increase_by
+#define _TEST__F_type_array__fll_ids_increase_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_ids_increase_by()
+ */
+extern void test__f_type_array_fll_ids_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_ids_increase_by()
+ */
+extern void test__f_type_array_fll_ids_increase_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_ids_increase_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_ids_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_ids_resize__works(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_fll_ids_resize__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_ids_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__fll_ids_resize
+#define _TEST__F_type_array__fll_ids_resize
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_ids_resize()
+ */
+extern void test__f_type_array_fll_ids_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_ids_resize()
+ */
+extern void test__f_type_array_fll_ids_resize__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_ids_resize
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_idss_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_idss_adjust__works(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_idss_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_fll_idss_adjust__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_idss_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__fll_idss_adjust
+#define _TEST__F_type_array__fll_idss_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_idss_adjust()
+ */
+extern void test__f_type_array_fll_idss_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_idss_adjust()
+ */
+extern void test__f_type_array_fll_idss_adjust__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_idss_adjust
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_idss_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_idss_append__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_fll_idss_t source = f_fll_ids_t_initialize;
+ f_fll_idss_t destination = f_fll_ids_t_initialize;
+
+ const f_fll_id_t fll_id_0 = { name: "test", type: 1, used: 4 };
+ const f_fll_id_t fll_id_1 = { name: "other", type: 2, used: 5 };
+
+ {
+ const f_status_t status = f_type_fll_idss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_type_fll_ids_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &fll_id_0, sizeof(f_fll_id_t));
+ memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &fll_id_1, sizeof(f_fll_id_t));
+ } // for
+ }
+
+ {
+ const f_status_t status = f_type_fll_idss_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ assert_string_equal(destination.array[i].array[0].name, fll_id_0.name);
+ assert_int_equal(destination.array[i].array[0].type, fll_id_0.type);
+ assert_int_equal(destination.array[i].array[0].used, fll_id_0.used);
+
+ assert_string_equal(destination.array[i].array[1].name, fll_id_1.name);
+ assert_int_equal(destination.array[i].array[1].type, fll_id_1.type);
+ assert_int_equal(destination.array[i].array[1].used, fll_id_1.used);
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_fll_idss_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t source = f_fll_ids_t_initialize;
+ f_fll_idss_t destination = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_fll_idss_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ }
+
+ free((void *) source.array);
+ assert_null(destination.array);
+}
+
+void test__f_type_array_fll_idss_append__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__fll_idss_append
+#define _TEST__F_type_array__fll_idss_append
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_idss_append()
+ */
+extern void test__f_type_array_fll_idss_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_fll_idss_append()
+ */
+extern void test__f_type_array_fll_idss_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_idss_append()
+ */
+extern void test__f_type_array_fll_idss_append__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_idss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_idss_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_idss_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_fll_idss_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_fll_idss_decimate_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__fll_idss_decimate_by
+#define _TEST__F_type_array__fll_idss_decimate_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_idss_decimate_by()
+ */
+extern void test__f_type_array_fll_idss_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_idss_decimate_by()
+ */
+extern void test__f_type_array_fll_idss_decimate_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_idss_decimate_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_idss_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_idss_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_fll_idss_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_fll_idss_decrease_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__fll_idss_decrease_by
+#define _TEST__F_type_array__fll_idss_decrease_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_idss_decrease_by()
+ */
+extern void test__f_type_array_fll_idss_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_idss_decrease_by()
+ */
+extern void test__f_type_array_fll_idss_decrease_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_idss_decrease_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_idss_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_idss_increase__works(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_fll_idss_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_fll_idss_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_fll_idss_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_fll_idss_increase__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#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_type_array__fll_idss_increase
+#define _TEST__F_type_array__fll_idss_increase
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_idss_increase()
+ */
+extern void test__f_type_array_fll_idss_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_fll_idss_increase()
+ */
+extern void test__f_type_array_fll_idss_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_idss_increase()
+ */
+extern void test__f_type_array_fll_idss_increase__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_idss_increase
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_idss_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_idss_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_fll_idss_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_fll_idss_increase_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__fll_idss_increase_by
+#define _TEST__F_type_array__fll_idss_increase_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_idss_increase_by()
+ */
+extern void test__f_type_array_fll_idss_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_idss_increase_by()
+ */
+extern void test__f_type_array_fll_idss_increase_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_idss_increase_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_idss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_idss_resize__works(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_idss_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_fll_idss_resize__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t data = f_fll_idss_t_initialize;
+
+ {
+ const f_status_t status = f_type_fll_idss_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__fll_idss_resize
+#define _TEST__F_type_array__fll_idss_resize
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_idss_resize()
+ */
+extern void test__f_type_array_fll_idss_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_idss_resize()
+ */
+extern void test__f_type_array_fll_idss_resize__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__fll_idss_resize
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-states_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_states_adjust__works(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_states_adjust__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__states_adjust
+#define _TEST__F_type_array__states_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_states_adjust()
+ */
+extern void test__f_type_array_states_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_states_adjust()
+ */
+extern void test__f_type_array_states_adjust__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__states_adjust
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-states_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_states_append__works(void **state) {
+
+ const int length = 5;
+ f_states_t source = f_states_t_initialize;
+ f_states_t destination = f_states_t_initialize;
+
+ const f_state_t state_0 = { step_large: 10, step_small: 1, handle: 0, interrupt: 0, callbacks: 0, custom: 0, data: 0 };
+ const f_state_t state_1 = { step_large: 20, step_small: 2, handle: 0, interrupt: 0, callbacks: 0, custom: 0, data: 0 };
+
+ {
+ const f_status_t status = f_type_states_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ memcpy(&source.array[source.used++], (void *) &state_0, sizeof(f_state_t));
+ memcpy(&source.array[source.used++], (void *) &state_1, sizeof(f_state_t));
+
+ {
+ const f_status_t status = f_type_states_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ assert_int_equal(destination.array[0].step_large, state_0.step_large);
+ assert_int_equal(destination.array[0].step_small, state_0.step_small);
+ assert_null(destination.array[0].handle);
+ assert_null(destination.array[0].interrupt);
+ assert_null(destination.array[0].callbacks);
+ assert_null(destination.array[0].custom);
+ assert_null(destination.array[0].data);
+
+ assert_int_equal(destination.array[1].step_large, state_1.step_large);
+ assert_int_equal(destination.array[1].step_small, state_1.step_small);
+ assert_null(destination.array[1].handle);
+ assert_null(destination.array[1].interrupt);
+ assert_null(destination.array[1].callbacks);
+ assert_null(destination.array[1].custom);
+ assert_null(destination.array[1].data);
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_states_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_states_t source = f_states_t_initialize;
+ f_states_t destination = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_states_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ }
+
+ free((void *) source.array);
+ assert_null(destination.array);
+}
+
+void test__f_type_array_states_append__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__states_append
+#define _TEST__F_type_array__states_append
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_states_append()
+ */
+extern void test__f_type_array_states_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_states_append()
+ */
+extern void test__f_type_array_states_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_states_append()
+ */
+extern void test__f_type_array_states_append__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__states_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-states_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_states_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_states_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_states_decimate_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__states_decimate_by
+#define _TEST__F_type_array__states_decimate_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_states_decimate_by()
+ */
+extern void test__f_type_array_states_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_states_decimate_by()
+ */
+extern void test__f_type_array_states_decimate_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__states_decimate_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-states_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_states_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_states_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_states_decrease_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__states_decrease_by
+#define _TEST__F_type_array__states_decrease_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_states_decrease_by()
+ */
+extern void test__f_type_array_states_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_states_decrease_by()
+ */
+extern void test__f_type_array_states_decrease_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__states_decrease_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-states_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_states_increase__works(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_states_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_states_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_states_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_states_increase__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#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_type_array__states_increase
+#define _TEST__F_type_array__states_increase
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_states_increase()
+ */
+extern void test__f_type_array_states_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_states_increase()
+ */
+extern void test__f_type_array_states_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_states_increase()
+ */
+extern void test__f_type_array_states_increase__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__states_increase
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-states_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_states_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_states_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_states_increase_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__states_increase_by
+#define _TEST__F_type_array__states_increase_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_states_increase_by()
+ */
+extern void test__f_type_array_states_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_states_increase_by()
+ */
+extern void test__f_type_array_states_increase_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__states_increase_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-states_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_states_resize__works(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_states_resize__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_states_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__states_resize
+#define _TEST__F_type_array__states_resize
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_states_resize()
+ */
+extern void test__f_type_array_states_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_states_resize()
+ */
+extern void test__f_type_array_states_resize__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__states_resize
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statess_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statess_adjust__works(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_statess_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statess_adjust__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_statess_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statess_adjust
+#define _TEST__F_type_array__statess_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statess_adjust()
+ */
+extern void test__f_type_array_statess_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statess_adjust()
+ */
+extern void test__f_type_array_statess_adjust__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statess_adjust
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statess_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statess_append__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_statess_t source = f_states_t_initialize;
+ f_statess_t destination = f_states_t_initialize;
+
+ const f_state_t state_0 = { step_large: 10, step_small: 1, handle: 0, interrupt: 0, callbacks: 0, custom: 0, data: 0 };
+ const f_state_t state_1 = { step_large: 20, step_small: 2, handle: 0, interrupt: 0, callbacks: 0, custom: 0, data: 0 };
+
+ {
+ const f_status_t status = f_type_statess_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_type_states_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &state_0, sizeof(f_state_t));
+ memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &state_1, sizeof(f_state_t));
+ } // for
+ }
+
+ {
+ const f_status_t status = f_type_statess_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ assert_int_equal(destination.array[i].array[0].step_large, state_0.step_large);
+ assert_int_equal(destination.array[i].array[0].step_small, state_0.step_small);
+ assert_null(destination.array[i].array[0].handle);
+ assert_null(destination.array[i].array[0].interrupt);
+ assert_null(destination.array[i].array[0].callbacks);
+ assert_null(destination.array[i].array[0].custom);
+ assert_null(destination.array[i].array[0].data);
+
+ assert_int_equal(destination.array[i].array[1].step_large, state_1.step_large);
+ assert_int_equal(destination.array[i].array[1].step_small, state_1.step_small);
+ assert_null(destination.array[i].array[1].handle);
+ assert_null(destination.array[i].array[1].interrupt);
+ assert_null(destination.array[i].array[1].callbacks);
+ assert_null(destination.array[i].array[1].custom);
+ assert_null(destination.array[i].array[1].data);
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_statess_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_statess_t source = f_states_t_initialize;
+ f_statess_t destination = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_statess_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ }
+
+ free((void *) source.array);
+ assert_null(destination.array);
+}
+
+void test__f_type_array_statess_append__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statess_append
+#define _TEST__F_type_array__statess_append
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statess_append()
+ */
+extern void test__f_type_array_statess_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_statess_append()
+ */
+extern void test__f_type_array_statess_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statess_append()
+ */
+extern void test__f_type_array_statess_append__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statess_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statess_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statess_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_statess_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_statess_decimate_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statess_decimate_by
+#define _TEST__F_type_array__statess_decimate_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statess_decimate_by()
+ */
+extern void test__f_type_array_statess_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statess_decimate_by()
+ */
+extern void test__f_type_array_statess_decimate_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statess_decimate_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statess_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statess_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_statess_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_statess_decrease_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statess_decrease_by
+#define _TEST__F_type_array__statess_decrease_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statess_decrease_by()
+ */
+extern void test__f_type_array_statess_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statess_decrease_by()
+ */
+extern void test__f_type_array_statess_decrease_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statess_decrease_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statess_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statess_increase__works(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_statess_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statess_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_statess_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statess_increase__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#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_type_array__statess_increase
+#define _TEST__F_type_array__statess_increase
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statess_increase()
+ */
+extern void test__f_type_array_statess_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_statess_increase()
+ */
+extern void test__f_type_array_statess_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statess_increase()
+ */
+extern void test__f_type_array_statess_increase__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statess_increase
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statess_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statess_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_statess_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statess_increase_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statess_increase_by
+#define _TEST__F_type_array__statess_increase_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statess_increase_by()
+ */
+extern void test__f_type_array_statess_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statess_increase_by()
+ */
+extern void test__f_type_array_statess_increase_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statess_increase_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statess_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statess_resize__works(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_statess_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statess_resize__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statess_t data = f_statess_t_initialize;
+
+ {
+ const f_status_t status = f_type_statess_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statess_resize
+#define _TEST__F_type_array__statess_resize
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statess_resize()
+ */
+extern void test__f_type_array_statess_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statess_resize()
+ */
+extern void test__f_type_array_statess_resize__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statess_resize
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statuss_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statuss_adjust__works(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statuss_adjust__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statuss_adjust
+#define _TEST__F_type_array__statuss_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statuss_adjust()
+ */
+extern void test__f_type_array_statuss_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statuss_adjust()
+ */
+extern void test__f_type_array_statuss_adjust__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statuss_adjust
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statuss_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statuss_append__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_statuss_t source = f_statuss_t_initialize;
+ f_statuss_t destination = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_type_statuss_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_statuss_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_statuss_t source = f_statuss_t_initialize;
+ f_statuss_t destination = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_statuss_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ }
+
+ free((void *) source.array);
+ assert_null(destination.array);
+}
+
+void test__f_type_array_statuss_append__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statuss_append
+#define _TEST__F_type_array__statuss_append
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statuss_append()
+ */
+extern void test__f_type_array_statuss_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_statuss_append()
+ */
+extern void test__f_type_array_statuss_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statuss_append()
+ */
+extern void test__f_type_array_statuss_append__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statuss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statuss_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statuss_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_statuss_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_statuss_decimate_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statuss_decimate_by
+#define _TEST__F_type_array__statuss_decimate_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statuss_decimate_by()
+ */
+extern void test__f_type_array_statuss_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statuss_decimate_by()
+ */
+extern void test__f_type_array_statuss_decimate_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statuss_decimate_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statuss_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statuss_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_statuss_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_statuss_decrease_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statuss_decrease_by
+#define _TEST__F_type_array__statuss_decrease_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statuss_decrease_by()
+ */
+extern void test__f_type_array_statuss_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statuss_decrease_by()
+ */
+extern void test__f_type_array_statuss_decrease_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statuss_decrease_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statuss_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statuss_increase__works(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_statuss_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statuss_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_statuss_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statuss_increase__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#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_type_array__statuss_increase
+#define _TEST__F_type_array__statuss_increase
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statuss_increase()
+ */
+extern void test__f_type_array_statuss_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_statuss_increase()
+ */
+extern void test__f_type_array_statuss_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statuss_increase()
+ */
+extern void test__f_type_array_statuss_increase__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statuss_increase
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statuss_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statuss_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_statuss_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statuss_increase_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statuss_increase_by
+#define _TEST__F_type_array__statuss_increase_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statuss_increase_by()
+ */
+extern void test__f_type_array_statuss_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statuss_increase_by()
+ */
+extern void test__f_type_array_statuss_increase_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statuss_increase_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statuss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statuss_resize__works(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statuss_resize__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statuss_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statuss_resize
+#define _TEST__F_type_array__statuss_resize
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statuss_resize()
+ */
+extern void test__f_type_array_statuss_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statuss_resize()
+ */
+extern void test__f_type_array_statuss_resize__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statuss_resize
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statusss_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statusss_adjust__works(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statusss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statusss_adjust__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statusss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statusss_adjust
+#define _TEST__F_type_array__statusss_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statusss_adjust()
+ */
+extern void test__f_type_array_statusss_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statusss_adjust()
+ */
+extern void test__f_type_array_statusss_adjust__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statusss_adjust
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statusss_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statusss_append__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_statusss_t source = f_statuss_t_initialize;
+ f_statusss_t destination = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_type_statuss_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_type_statusss_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_statusss_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_statusss_t source = f_statuss_t_initialize;
+ f_statusss_t destination = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_statusss_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ }
+
+ free((void *) source.array);
+ assert_null(destination.array);
+}
+
+void test__f_type_array_statusss_append__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statusss_append
+#define _TEST__F_type_array__statusss_append
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statusss_append()
+ */
+extern void test__f_type_array_statusss_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_statusss_append()
+ */
+extern void test__f_type_array_statusss_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statusss_append()
+ */
+extern void test__f_type_array_statusss_append__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statusss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statusss_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statusss_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_statusss_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_statusss_decimate_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statusss_decimate_by
+#define _TEST__F_type_array__statusss_decimate_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statusss_decimate_by()
+ */
+extern void test__f_type_array_statusss_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statusss_decimate_by()
+ */
+extern void test__f_type_array_statusss_decimate_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statusss_decimate_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statusss_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statusss_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_statusss_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_type_array_statusss_decrease_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statusss_decrease_by
+#define _TEST__F_type_array__statusss_decrease_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statusss_decrease_by()
+ */
+extern void test__f_type_array_statusss_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statusss_decrease_by()
+ */
+extern void test__f_type_array_statusss_decrease_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statusss_decrease_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statusss_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statusss_increase__works(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_statusss_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statusss_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_type_statusss_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statusss_increase__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#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_type_array__statusss_increase
+#define _TEST__F_type_array__statusss_increase
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statusss_increase()
+ */
+extern void test__f_type_array_statusss_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_statusss_increase()
+ */
+extern void test__f_type_array_statusss_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statusss_increase()
+ */
+extern void test__f_type_array_statusss_increase__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statusss_increase
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statusss_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statusss_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_type_statusss_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statusss_increase_by__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statusss_increase_by
+#define _TEST__F_type_array__statusss_increase_by
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statusss_increase_by()
+ */
+extern void test__f_type_array_statusss_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statusss_increase_by()
+ */
+extern void test__f_type_array_statusss_increase_by__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statusss_increase_by
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statusss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statusss_resize__works(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statusss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_type_array_statusss_resize__fails_on_invalid_parameter(void **state) {
+
+ const int length = 5;
+ f_statusss_t data = f_statusss_t_initialize;
+
+ {
+ const f_status_t status = f_type_statusss_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#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_type_array__statusss_resize
+#define _TEST__F_type_array__statusss_resize
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statusss_resize()
+ */
+extern void test__f_type_array_statusss_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statusss_resize()
+ */
+extern void test__f_type_array_statusss_resize__fails_on_invalid_parameter(void **state);
+
+#endif // _TEST__F_type_array__statusss_resize
--- /dev/null
+#include "test-type_array.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int setup(void **state) {
+
+ return 0;
+}
+
+int setdown(void **state) {
+
+ return 0;
+}
+
+int main(void) {
+
+ const struct CMUnitTest tests[] = {
+ cmocka_unit_test(test__f_type_array_array_lengths_adjust__works),
+ cmocka_unit_test(test__f_type_array_array_lengths_adjust__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengths_append__works),
+ cmocka_unit_test(test__f_type_array_array_lengths_append__returns_data_not),
+ cmocka_unit_test(test__f_type_array_array_lengths_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengths_decimate_by__works),
+ cmocka_unit_test(test__f_type_array_array_lengths_decimate_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengths_decrease_by__works),
+ cmocka_unit_test(test__f_type_array_array_lengths_decrease_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengths_increase__works),
+ cmocka_unit_test(test__f_type_array_array_lengths_increase__returns_data_not),
+ cmocka_unit_test(test__f_type_array_array_lengths_increase__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengths_increase_by__works),
+ cmocka_unit_test(test__f_type_array_array_lengths_increase_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengths_resize__works),
+ cmocka_unit_test(test__f_type_array_array_lengths_resize__fails_on_invalid_parameter),
+
+ cmocka_unit_test(test__f_type_array_array_lengthss_adjust__works),
+ cmocka_unit_test(test__f_type_array_array_lengthss_adjust__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengthss_append__works),
+ cmocka_unit_test(test__f_type_array_array_lengthss_append__returns_data_not),
+ cmocka_unit_test(test__f_type_array_array_lengthss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengthss_decimate_by__works),
+ cmocka_unit_test(test__f_type_array_array_lengthss_decimate_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengthss_decrease_by__works),
+ cmocka_unit_test(test__f_type_array_array_lengthss_decrease_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengthss_increase__works),
+ cmocka_unit_test(test__f_type_array_array_lengthss_increase__returns_data_not),
+ cmocka_unit_test(test__f_type_array_array_lengthss_increase__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengthss_increase_by__works),
+ cmocka_unit_test(test__f_type_array_array_lengthss_increase_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengthss_resize__works),
+ cmocka_unit_test(test__f_type_array_array_lengthss_resize__fails_on_invalid_parameter),
+
+ cmocka_unit_test(test__f_type_array_cells_adjust__works),
+ cmocka_unit_test(test__f_type_array_cells_adjust__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cells_append__works),
+ cmocka_unit_test(test__f_type_array_cells_append__returns_data_not),
+ cmocka_unit_test(test__f_type_array_cells_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cells_decimate_by__works),
+ cmocka_unit_test(test__f_type_array_cells_decimate_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cells_decrease_by__works),
+ cmocka_unit_test(test__f_type_array_cells_decrease_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cells_increase__works),
+ cmocka_unit_test(test__f_type_array_cells_increase__returns_data_not),
+ cmocka_unit_test(test__f_type_array_cells_increase__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cells_increase_by__works),
+ cmocka_unit_test(test__f_type_array_cells_increase_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cells_resize__works),
+ cmocka_unit_test(test__f_type_array_cells_resize__fails_on_invalid_parameter),
+
+ cmocka_unit_test(test__f_type_array_cellss_adjust__works),
+ cmocka_unit_test(test__f_type_array_cellss_adjust__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cellss_append__works),
+ cmocka_unit_test(test__f_type_array_cellss_append__returns_data_not),
+ cmocka_unit_test(test__f_type_array_cellss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cellss_decimate_by__works),
+ cmocka_unit_test(test__f_type_array_cellss_decimate_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cellss_decrease_by__works),
+ cmocka_unit_test(test__f_type_array_cellss_decrease_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cellss_increase__works),
+ cmocka_unit_test(test__f_type_array_cellss_increase__returns_data_not),
+ cmocka_unit_test(test__f_type_array_cellss_increase__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cellss_increase_by__works),
+ cmocka_unit_test(test__f_type_array_cellss_increase_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cellss_resize__works),
+ cmocka_unit_test(test__f_type_array_cellss_resize__fails_on_invalid_parameter),
+
+ cmocka_unit_test(test__f_type_array_fll_ids_adjust__works),
+ cmocka_unit_test(test__f_type_array_fll_ids_adjust__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_ids_append__works),
+ cmocka_unit_test(test__f_type_array_fll_ids_append__returns_data_not),
+ cmocka_unit_test(test__f_type_array_fll_ids_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_ids_decimate_by__works),
+ cmocka_unit_test(test__f_type_array_fll_ids_decimate_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_ids_decrease_by__works),
+ cmocka_unit_test(test__f_type_array_fll_ids_decrease_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_ids_increase__works),
+ cmocka_unit_test(test__f_type_array_fll_ids_increase__returns_data_not),
+ cmocka_unit_test(test__f_type_array_fll_ids_increase__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_ids_increase_by__works),
+ cmocka_unit_test(test__f_type_array_fll_ids_increase_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_ids_resize__works),
+ cmocka_unit_test(test__f_type_array_fll_ids_resize__fails_on_invalid_parameter),
+
+ cmocka_unit_test(test__f_type_array_fll_idss_adjust__works),
+ cmocka_unit_test(test__f_type_array_fll_idss_adjust__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_idss_append__works),
+ cmocka_unit_test(test__f_type_array_fll_idss_append__returns_data_not),
+ cmocka_unit_test(test__f_type_array_fll_idss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_idss_decimate_by__works),
+ cmocka_unit_test(test__f_type_array_fll_idss_decimate_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_idss_decrease_by__works),
+ cmocka_unit_test(test__f_type_array_fll_idss_decrease_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_idss_increase__works),
+ cmocka_unit_test(test__f_type_array_fll_idss_increase__returns_data_not),
+ cmocka_unit_test(test__f_type_array_fll_idss_increase__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_idss_increase_by__works),
+ cmocka_unit_test(test__f_type_array_fll_idss_increase_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_idss_resize__works),
+ cmocka_unit_test(test__f_type_array_fll_idss_resize__fails_on_invalid_parameter),
+
+ cmocka_unit_test(test__f_type_array_states_adjust__works),
+ cmocka_unit_test(test__f_type_array_states_adjust__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_states_append__works),
+ cmocka_unit_test(test__f_type_array_states_append__returns_data_not),
+ cmocka_unit_test(test__f_type_array_states_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_states_decimate_by__works),
+ cmocka_unit_test(test__f_type_array_states_decimate_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_states_decrease_by__works),
+ cmocka_unit_test(test__f_type_array_states_decrease_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_states_increase__works),
+ cmocka_unit_test(test__f_type_array_states_increase__returns_data_not),
+ cmocka_unit_test(test__f_type_array_states_increase__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_states_increase_by__works),
+ cmocka_unit_test(test__f_type_array_states_increase_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_states_resize__works),
+ cmocka_unit_test(test__f_type_array_states_resize__fails_on_invalid_parameter),
+
+ cmocka_unit_test(test__f_type_array_statess_adjust__works),
+ cmocka_unit_test(test__f_type_array_statess_adjust__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statess_append__works),
+ cmocka_unit_test(test__f_type_array_statess_append__returns_data_not),
+ cmocka_unit_test(test__f_type_array_statess_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statess_decimate_by__works),
+ cmocka_unit_test(test__f_type_array_statess_decimate_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statess_decrease_by__works),
+ cmocka_unit_test(test__f_type_array_statess_decrease_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statess_increase__works),
+ cmocka_unit_test(test__f_type_array_statess_increase__returns_data_not),
+ cmocka_unit_test(test__f_type_array_statess_increase__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statess_increase_by__works),
+ cmocka_unit_test(test__f_type_array_statess_increase_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statess_resize__works),
+ cmocka_unit_test(test__f_type_array_statess_resize__fails_on_invalid_parameter),
+
+ cmocka_unit_test(test__f_type_array_statuss_adjust__works),
+ cmocka_unit_test(test__f_type_array_statuss_adjust__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statuss_append__works),
+ cmocka_unit_test(test__f_type_array_statuss_append__returns_data_not),
+ cmocka_unit_test(test__f_type_array_statuss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statuss_decimate_by__works),
+ cmocka_unit_test(test__f_type_array_statuss_decimate_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statuss_decrease_by__works),
+ cmocka_unit_test(test__f_type_array_statuss_decrease_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statuss_increase__works),
+ cmocka_unit_test(test__f_type_array_statuss_increase__returns_data_not),
+ cmocka_unit_test(test__f_type_array_statuss_increase__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statuss_increase_by__works),
+ cmocka_unit_test(test__f_type_array_statuss_increase_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statuss_resize__works),
+ cmocka_unit_test(test__f_type_array_statuss_resize__fails_on_invalid_parameter),
+
+ cmocka_unit_test(test__f_type_array_statusss_adjust__works),
+ cmocka_unit_test(test__f_type_array_statusss_adjust__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statusss_append__works),
+ cmocka_unit_test(test__f_type_array_statusss_append__returns_data_not),
+ cmocka_unit_test(test__f_type_array_statusss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statusss_decimate_by__works),
+ cmocka_unit_test(test__f_type_array_statusss_decimate_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statusss_decrease_by__works),
+ cmocka_unit_test(test__f_type_array_statusss_decrease_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statusss_increase__works),
+ cmocka_unit_test(test__f_type_array_statusss_increase__returns_data_not),
+ cmocka_unit_test(test__f_type_array_statusss_increase__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statusss_increase_by__works),
+ cmocka_unit_test(test__f_type_array_statusss_increase_by__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statusss_resize__works),
+ cmocka_unit_test(test__f_type_array_statusss_resize__fails_on_invalid_parameter),
+ };
+
+ return cmocka_run_group_tests(tests, setup, setdown);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the type arrays in the project.
+ */
+#ifndef _TEST__F_type_array_h
+#define _TEST__F_type_array_h
+
+// libc includes.
+#include <stdarg.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <stdint.h>
+
+// cmocka includes.
+#include <cmocka.h>
+
+// fll-0 includes.
+#include <fll/level_0/type.h>
+#include <fll/level_0/memory.h>
+#include <fll/level_0/type_array.h>
+
+// test includes.
+#include "test-type_array-array_lengths_adjust.h"
+#include "test-type_array-array_lengths_append.h"
+#include "test-type_array-array_lengths_decimate_by.h"
+#include "test-type_array-array_lengths_decrease_by.h"
+#include "test-type_array-array_lengths_increase.h"
+#include "test-type_array-array_lengths_increase_by.h"
+#include "test-type_array-array_lengths_resize.h"
+#include "test-type_array-array_lengthss_adjust.h"
+#include "test-type_array-array_lengthss_append.h"
+#include "test-type_array-array_lengthss_decimate_by.h"
+#include "test-type_array-array_lengthss_decrease_by.h"
+#include "test-type_array-array_lengthss_increase.h"
+#include "test-type_array-array_lengthss_increase_by.h"
+#include "test-type_array-array_lengthss_resize.h"
+#include "test-type_array-cells_adjust.h"
+#include "test-type_array-cells_append.h"
+#include "test-type_array-cells_decimate_by.h"
+#include "test-type_array-cells_decrease_by.h"
+#include "test-type_array-cells_increase.h"
+#include "test-type_array-cells_increase_by.h"
+#include "test-type_array-cells_resize.h"
+#include "test-type_array-cellss_adjust.h"
+#include "test-type_array-cellss_append.h"
+#include "test-type_array-cellss_decimate_by.h"
+#include "test-type_array-cellss_decrease_by.h"
+#include "test-type_array-cellss_increase.h"
+#include "test-type_array-cellss_increase_by.h"
+#include "test-type_array-cellss_resize.h"
+#include "test-type_array-fll_ids_adjust.h"
+#include "test-type_array-fll_ids_append.h"
+#include "test-type_array-fll_ids_decimate_by.h"
+#include "test-type_array-fll_ids_decrease_by.h"
+#include "test-type_array-fll_ids_increase.h"
+#include "test-type_array-fll_ids_increase_by.h"
+#include "test-type_array-fll_ids_resize.h"
+#include "test-type_array-fll_idss_adjust.h"
+#include "test-type_array-fll_idss_append.h"
+#include "test-type_array-fll_idss_decimate_by.h"
+#include "test-type_array-fll_idss_decrease_by.h"
+#include "test-type_array-fll_idss_increase.h"
+#include "test-type_array-fll_idss_increase_by.h"
+#include "test-type_array-fll_idss_resize.h"
+#include "test-type_array-states_adjust.h"
+#include "test-type_array-states_append.h"
+#include "test-type_array-states_decimate_by.h"
+#include "test-type_array-states_decrease_by.h"
+#include "test-type_array-states_increase.h"
+#include "test-type_array-states_increase_by.h"
+#include "test-type_array-states_resize.h"
+#include "test-type_array-statess_adjust.h"
+#include "test-type_array-statess_append.h"
+#include "test-type_array-statess_decimate_by.h"
+#include "test-type_array-statess_decrease_by.h"
+#include "test-type_array-statess_increase.h"
+#include "test-type_array-statess_increase_by.h"
+#include "test-type_array-statess_resize.h"
+#include "test-type_array-statuss_adjust.h"
+#include "test-type_array-statuss_append.h"
+#include "test-type_array-statuss_decimate_by.h"
+#include "test-type_array-statuss_decrease_by.h"
+#include "test-type_array-statuss_increase.h"
+#include "test-type_array-statuss_increase_by.h"
+#include "test-type_array-statuss_resize.h"
+#include "test-type_array-statusss_adjust.h"
+#include "test-type_array-statusss_append.h"
+#include "test-type_array-statusss_decimate_by.h"
+#include "test-type_array-statusss_decrease_by.h"
+#include "test-type_array-statusss_increase.h"
+#include "test-type_array-statusss_increase_by.h"
+#include "test-type_array-statusss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Perform any setup operations.
+ *
+ * @param state
+ * The test state.
+ *
+ * @return
+ * The status of this function, where 0 means success.
+ */
+extern int setup(void **state);
+
+/**
+ * Peform any setdown operations.
+ *
+ * @param state
+ * The test state.
+ *
+ * @return
+ * The status of this function, where 0 means success.
+ */
+extern int setdown(void **state);
+
+/**
+ * Run all tests.
+ *
+ * @return
+ * The final result of the tests.
+ *
+ * @see cmocka_run_group_tests()
+ * @see cmocka_unit_test()
+ */
+extern int main(void);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _TEST__F_type_array_h