]> Kevux Git Server - fll/commitdiff
Update: Finish adding the unit tests to f_compare.
authorKevin Day <kevin@kevux.org>
Wed, 29 Mar 2023 04:21:56 +0000 (23:21 -0500)
committerKevin Day <kevin@kevux.org>
Wed, 29 Mar 2023 04:21:56 +0000 (23:21 -0500)
This wraps up a good enough for now set of unit tests for f_compare.

33 files changed:
level_0/f_compare/data/build/settings-tests
level_0/f_compare/tests/unit/c/test-compare-dynamic_except.c [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_except.h [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_except_string.c [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_except_string.h [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_except_trim.c [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_except_trim.h [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_except_trim_string.c [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_except_trim_string.h [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial.c
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_dynamic.c
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except.c [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except.h [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_dynamic.c [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_dynamic.h [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_string.c [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_string.h [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim.c [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim.h [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim_dynamic.c [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim_dynamic.h [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim_string.c [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim_string.h [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_string.c
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_trim.c
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_trim_dynamic.c
level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_trim_string.c
level_0/f_compare/tests/unit/c/test-compare-except.c
level_0/f_compare/tests/unit/c/test-compare-except.h
level_0/f_compare/tests/unit/c/test-compare-except_trim.c [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare-except_trim.h [new file with mode: 0644]
level_0/f_compare/tests/unit/c/test-compare.c
level_0/f_compare/tests/unit/c/test-compare.h

index bb31db4e7a6433733eb17a6fe121bb51643db0fe..a646ad427d68027aa43f7b8f630c7cba53f3e06e 100644 (file)
@@ -28,9 +28,12 @@ build_libraries-individual -lf_memory -lf_string -lf_utf -lf_compare
 build_sources_program test-compare-.c test-compare-dynamic.c test-compare-dynamic_string.c
 build_sources_program test-compare-dynamic_partial.c test-compare-dynamic_partial_dynamic.c test-compare-dynamic_partial_string.c
 build_sources_program test-compare-dynamic_partial_trim.c test-compare-dynamic_partial_trim_dynamic.c test-compare-dynamic_partial_trim_string.c
+build_sources_program test-compare-dynamic_partial_except.c test-compare-dynamic_partial_except_dynamic.c test-compare-dynamic_partial_except_string.c
+build_sources_program test-compare-dynamic_partial_except_trim.c test-compare-dynamic_partial_except_trim_dynamic.c test-compare-dynamic_partial_except_trim_string.c
+build_sources_program test-compare-except.c test-compare-dynamic_except.c test-compare-dynamic_except_string.c
 build_sources_program test-compare-trim.c test-compare-dynamic_trim.c test-compare-dynamic_trim_string.c
+build_sources_program test-compare-except_trim.c test-compare-dynamic_except_trim.c test-compare-dynamic_except_trim_string.c
 build_sources_program test-compare.c
-build_sources_program test-compare-except.c
 
 build_script no
 build_shared yes
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_except.c b/level_0/f_compare/tests/unit/c/test-compare-dynamic_except.c
new file mode 100644 (file)
index 0000000..d34ee74
--- /dev/null
@@ -0,0 +1,283 @@
+#include "test-compare.h"
+#include "test-compare-dynamic_except.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_compare_dynamic_except__works(void **state) {
+
+  const f_string_static_t string_1s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+
+    // 2.
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+
+    // 3.
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+
+    // 4.
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+
+    // 5.
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+
+    // 6.
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+
+    // 7.
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+
+    // 8.
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+  };
+
+  const f_string_static_t string_2s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 2.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 3.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 4.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 5.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 6.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 7.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 8.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+  };
+
+  const f_status_t expects[] = {
+
+    // 1.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 2.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 3.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 4.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 5.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 6.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 7.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 8.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+  };
+
+  f_array_length_t except_1[] = {
+    0, 1, 2, 3,
+  };
+  const f_array_lengths_t excepts_1 = macro_f_array_lengths_t_initialize(except_1, 0, 4);
+  const f_array_lengths_t excepts_2 = f_array_lengths_t_initialize;
+  uint8_t i = 0;
+
+  for (; i < 64; ++i) {
+
+    const f_status_t status = f_compare_dynamic_except(string_1s[i], string_2s[i], excepts_1, excepts_2);
+
+    assert_int_equal(status, expects[i]);
+  } // for
+
+  for (i = 0; i < 64; ++i) {
+
+    const f_status_t status = f_compare_dynamic_except(string_2s[i], string_1s[i], excepts_2, excepts_1);
+
+    assert_int_equal(status, expects[i]);
+  } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_except.h b/level_0/f_compare/tests/unit/c/test-compare-dynamic_except.h
new file mode 100644 (file)
index 0000000..6db1c4f
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Compare
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the compare project.
+ */
+#ifndef _TEST__F_compare_dynamic_except_h
+#define _TEST__F_compare_dynamic_except_h
+
+// f_compare_dynamic_except() only returns memory failures.
+
+/**
+ * Test that function works.
+ *
+ * @see f_compare_dynamic_except()
+ */
+extern void test__f_compare_dynamic_except__works(void **state);
+
+#endif // _TEST__F_compare_dynamic_except_h
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_except_string.c b/level_0/f_compare/tests/unit/c/test-compare-dynamic_except_string.c
new file mode 100644 (file)
index 0000000..f97c4be
--- /dev/null
@@ -0,0 +1,283 @@
+#include "test-compare.h"
+#include "test-compare-dynamic_except_string.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_compare_dynamic_except_string__works(void **state) {
+
+  const f_string_static_t string_1s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+
+    // 2.
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+
+    // 3.
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+
+    // 4.
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+
+    // 5.
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+
+    // 6.
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+
+    // 7.
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+
+    // 8.
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+  };
+
+  const f_string_static_t string_2s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 2.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 3.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 4.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 5.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 6.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 7.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 8.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+  };
+
+  const f_status_t expects[] = {
+
+    // 1.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 2.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 3.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 4.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 5.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 6.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 7.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 8.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+  };
+
+  f_array_length_t except_1[] = {
+    0, 1, 2, 3,
+  };
+  const f_array_lengths_t excepts_1 = macro_f_array_lengths_t_initialize(except_1, 0, 4);
+  const f_array_lengths_t excepts_2 = f_array_lengths_t_initialize;
+  uint8_t i = 0;
+
+  for (; i < 64; ++i) {
+
+    const f_status_t status = f_compare_dynamic_except_string(string_1s[i].string, string_2s[i], string_1s[i].used, excepts_1, excepts_2);
+
+    assert_int_equal(status, expects[i]);
+  } // for
+
+  for (i = 0; i < 64; ++i) {
+
+    const f_status_t status = f_compare_dynamic_except_string(string_2s[i].string, string_1s[i], string_2s[i].used, excepts_2, excepts_1);
+
+    assert_int_equal(status, expects[i]);
+  } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_except_string.h b/level_0/f_compare/tests/unit/c/test-compare-dynamic_except_string.h
new file mode 100644 (file)
index 0000000..b065dc6
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Compare
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the compare project.
+ */
+#ifndef _TEST__F_compare_dynamic_except_string_h
+#define _TEST__F_compare_dynamic_except_string_h
+
+// f_compare_dynamic_except_string() only returns memory failures.
+
+/**
+ * Test that function works.
+ *
+ * @see f_compare_dynamic_except_string()
+ */
+extern void test__f_compare_dynamic_except_string__works(void **state);
+
+#endif // _TEST__F_compare_dynamic_except_string_h
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_except_trim.c b/level_0/f_compare/tests/unit/c/test-compare-dynamic_except_trim.c
new file mode 100644 (file)
index 0000000..297ff7e
--- /dev/null
@@ -0,0 +1,296 @@
+#include "test-compare.h"
+#include "test-compare-dynamic_except_trim.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_compare_dynamic_except_trim__works(void **state) {
+
+  // A necessary work-around to to have "\01" with the "\0" being separate from the "1".
+  f_char_t null_before_one_1[] = {
+    'S', 'K', 'I', 'P', '\0', '1'
+  };
+
+  f_char_t null_before_one_2[] = {
+    'S', 'K', 'I', 'P', '\0', '1', ' ', '\0', '\t'
+  };
+
+  f_char_t null_before_one_3[] = {
+    'S', 'K', 'I', 'P', '\0', ' ', '\0', '1'
+  };
+
+  const f_string_static_t string_1s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+
+    // 2.
+    macro_f_string_static_t_initialize("SKIP ", 0, 5),
+    macro_f_string_static_t_initialize("SKIP\t", 0, 5),
+    macro_f_string_static_t_initialize("SKIP\0", 0, 5),
+    macro_f_string_static_t_initialize("SKIP    ", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  \t ", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0 \0\t", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0 \0", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0\0\t", 0, 7),
+
+    // 3.
+    macro_f_string_static_t_initialize("SKIP 1", 0, 6),
+    macro_f_string_static_t_initialize("SKIP\t1", 0, 6),
+    macro_f_string_static_t_initialize(null_before_one_1, 0, 6),
+    macro_f_string_static_t_initialize("SKIP  1  ", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  1\t ", 0, 9),
+    macro_f_string_static_t_initialize(null_before_one_2, 0, 9),
+    macro_f_string_static_t_initialize(null_before_one_3, 0, 8),
+    macro_f_string_static_t_initialize("SKIP1\0\0\t", 0, 8),
+
+    // 4.
+    macro_f_string_static_t_initialize("SKIP one", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\tone", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0one", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  one  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  one\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0one \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0one", 0, 10),
+    macro_f_string_static_t_initialize("SKIPone\0\0\t", 0, 10),
+
+    // 5.
+    macro_f_string_static_t_initialize("SKIP One", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\tOne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0One", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  One  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  One\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0One \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0One", 0, 10),
+    macro_f_string_static_t_initialize("SKIPOne\0\0\t", 0, 10),
+
+    // 6.
+    macro_f_string_static_t_initialize("SKIP \0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\t\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  \0ne  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  \0ne\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0\0ne \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0\0ne", 0, 10),
+    macro_f_string_static_t_initialize("SKIP\0ne\0\0\t", 0, 10),
+
+    // 7.
+    macro_f_string_static_t_initialize("SKIP o\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\to\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\0o\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  o\0ne  ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP  o\0ne\t ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0o\0ne \0\t", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0 \0o\0ne", 0, 11),
+    macro_f_string_static_t_initialize("SKIPo\0ne\0\0\t", 0, 11),
+
+    // 8.
+    macro_f_string_static_t_initialize("SKIP one\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\tone\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\0one\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  one\0  ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP  one\0\t ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0one\0 \0\t", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0 \0one\0", 0, 11),
+    macro_f_string_static_t_initialize("SKIPone\0\0\0\t", 0, 11),
+  };
+
+  const f_string_static_t string_2s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 2.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 3.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 4.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 5.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 6.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 7.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 8.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+  };
+
+  const f_status_t expects[] = {
+
+    // 1.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 2.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 3.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 4.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 5.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 6.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 7.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 8.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+  };
+
+  f_array_length_t except_1[] = {
+    0, 1, 2, 3,
+  };
+  const f_array_lengths_t excepts_1 = macro_f_array_lengths_t_initialize(except_1, 0, 4);
+  const f_array_lengths_t excepts_2 = f_array_lengths_t_initialize;
+  uint8_t i = 0;
+
+  for (; i < 64; ++i) {
+
+    const f_status_t status = f_compare_dynamic_except_trim(string_1s[i], string_2s[i], excepts_1, excepts_2);
+
+    assert_int_equal(status, expects[i]);
+  } // for
+
+  for (i = 0; i < 64; ++i) {
+
+    const f_status_t status = f_compare_dynamic_except_trim(string_2s[i], string_1s[i], excepts_2, excepts_1);
+
+    assert_int_equal(status, expects[i]);
+  } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_except_trim.h b/level_0/f_compare/tests/unit/c/test-compare-dynamic_except_trim.h
new file mode 100644 (file)
index 0000000..dc0cfca
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Compare
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the compare project.
+ */
+#ifndef _TEST__F_compare_dynamic_except_trim_h
+#define _TEST__F_compare_dynamic_except_trim_h
+
+// f_compare_dynamic_except_trim() only returns memory failures.
+
+/**
+ * Test that function works.
+ *
+ * @see f_compare_dynamic_except_trim()
+ */
+extern void test__f_compare_dynamic_except_trim__works(void **state);
+
+#endif // _TEST__F_compare_dynamic_except_trim_h
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_except_trim_string.c b/level_0/f_compare/tests/unit/c/test-compare-dynamic_except_trim_string.c
new file mode 100644 (file)
index 0000000..88ec477
--- /dev/null
@@ -0,0 +1,296 @@
+#include "test-compare.h"
+#include "test-compare-dynamic_except_trim_string.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_compare_dynamic_except_trim_string__works(void **state) {
+
+  // A necessary work-around to to have "\01" with the "\0" being separate from the "1".
+  f_char_t null_before_one_1[] = {
+    'S', 'K', 'I', 'P', '\0', '1'
+  };
+
+  f_char_t null_before_one_2[] = {
+    'S', 'K', 'I', 'P', '\0', '1', ' ', '\0', '\t'
+  };
+
+  f_char_t null_before_one_3[] = {
+    'S', 'K', 'I', 'P', '\0', ' ', '\0', '1'
+  };
+
+  const f_string_static_t string_1s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+
+    // 2.
+    macro_f_string_static_t_initialize("SKIP ", 0, 5),
+    macro_f_string_static_t_initialize("SKIP\t", 0, 5),
+    macro_f_string_static_t_initialize("SKIP\0", 0, 5),
+    macro_f_string_static_t_initialize("SKIP    ", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  \t ", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0 \0\t", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0 \0", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0\0\t", 0, 7),
+
+    // 3.
+    macro_f_string_static_t_initialize("SKIP 1", 0, 6),
+    macro_f_string_static_t_initialize("SKIP\t1", 0, 6),
+    macro_f_string_static_t_initialize(null_before_one_1, 0, 6),
+    macro_f_string_static_t_initialize("SKIP  1  ", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  1\t ", 0, 9),
+    macro_f_string_static_t_initialize(null_before_one_2, 0, 9),
+    macro_f_string_static_t_initialize(null_before_one_3, 0, 8),
+    macro_f_string_static_t_initialize("SKIP1\0\0\t", 0, 8),
+
+    // 4.
+    macro_f_string_static_t_initialize("SKIP one", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\tone", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0one", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  one  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  one\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0one \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0one", 0, 10),
+    macro_f_string_static_t_initialize("SKIPone\0\0\t", 0, 10),
+
+    // 5.
+    macro_f_string_static_t_initialize("SKIP One", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\tOne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0One", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  One  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  One\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0One \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0One", 0, 10),
+    macro_f_string_static_t_initialize("SKIPOne\0\0\t", 0, 10),
+
+    // 6.
+    macro_f_string_static_t_initialize("SKIP \0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\t\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  \0ne  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  \0ne\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0\0ne \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0\0ne", 0, 10),
+    macro_f_string_static_t_initialize("SKIP\0ne\0\0\t", 0, 10),
+
+    // 7.
+    macro_f_string_static_t_initialize("SKIP o\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\to\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\0o\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  o\0ne  ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP  o\0ne\t ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0o\0ne \0\t", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0 \0o\0ne", 0, 11),
+    macro_f_string_static_t_initialize("SKIPo\0ne\0\0\t", 0, 11),
+
+    // 8.
+    macro_f_string_static_t_initialize("SKIP one\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\tone\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\0one\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  one\0  ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP  one\0\t ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0one\0 \0\t", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0 \0one\0", 0, 11),
+    macro_f_string_static_t_initialize("SKIPone\0\0\0\t", 0, 11),
+  };
+
+  const f_string_static_t string_2s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 2.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 3.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 4.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 5.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 6.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 7.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 8.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+  };
+
+  const f_status_t expects[] = {
+
+    // 1.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 2.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 3.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 4.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 5.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 6.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 7.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 8.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+  };
+
+  f_array_length_t except_1[] = {
+    0, 1, 2, 3,
+  };
+  const f_array_lengths_t excepts_1 = macro_f_array_lengths_t_initialize(except_1, 0, 4);
+  const f_array_lengths_t excepts_2 = f_array_lengths_t_initialize;
+  uint8_t i = 0;
+
+  for (; i < 64; ++i) {
+
+    const f_status_t status = f_compare_dynamic_except_trim_string(string_1s[i].string, string_2s[i], string_1s[i].used, excepts_1, excepts_2);
+
+    assert_int_equal(status, expects[i]);
+  } // for
+
+  for (i = 0; i < 64; ++i) {
+
+    const f_status_t status = f_compare_dynamic_except_trim_string(string_2s[i].string, string_1s[i], string_2s[i].used, excepts_2, excepts_1);
+
+    assert_int_equal(status, expects[i]);
+  } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_except_trim_string.h b/level_0/f_compare/tests/unit/c/test-compare-dynamic_except_trim_string.h
new file mode 100644 (file)
index 0000000..a1a756f
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Compare
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the compare project.
+ */
+#ifndef _TEST__F_compare_dynamic_except_trim_string_h
+#define _TEST__F_compare_dynamic_except_trim_string_h
+
+// f_compare_dynamic_except_trim_string() only returns memory failures.
+
+/**
+ * Test that function works.
+ *
+ * @see f_compare_dynamic_except_trim_string()
+ */
+extern void test__f_compare_dynamic_except_trim_string__works(void **state);
+
+#endif // _TEST__F_compare_dynamic_except_trim_string_h
index 3adbb6a25b10a5d61c83f64bc75e99480a00ef03..9fcd5bfd1c9b42d5baef60c033a5d6f040bf83c4 100644 (file)
@@ -173,7 +173,6 @@ void test__f_compare_dynamic_partial__works(void **state) {
     macro_f_string_static_t_initialize("aaone\0", 0, 6),
   };
 
-  const f_string_range_t range_0 = macro_f_string_range_t_initialize(1, 0);
   f_string_range_t range_1 = macro_f_string_range_t_initialize(3, 9);
   f_string_range_t range_2 = macro_f_string_range_t_initialize(2, 0);
 
@@ -267,12 +266,12 @@ void test__f_compare_dynamic_partial__works(void **state) {
   for (; i < 8; ++i) {
 
     if (i % 8 == 0) {
-      status = f_compare_dynamic_partial(string_1s[i], string_2s[i], range_0, range_0);
+      status = f_compare_dynamic_partial(string_1s[i], string_2s[i], f_string_range_empty_c, f_string_range_empty_c);
     }
     else {
       range_2.stop = string_2s[i].used - 1;
 
-      status = f_compare_dynamic_partial(string_1s[i], string_2s[i], range_0, range_2);
+      status = f_compare_dynamic_partial(string_1s[i], string_2s[i], f_string_range_empty_c, range_2);
     }
 
     assert_int_equal(status, expects[i]);
@@ -283,7 +282,7 @@ void test__f_compare_dynamic_partial__works(void **state) {
     range_1.stop = string_1s[i].used - 4;
 
     if (i % 8 == 0) {
-      status = f_compare_dynamic_partial(string_1s[i], string_2s[i], range_1, range_0);
+      status = f_compare_dynamic_partial(string_1s[i], string_2s[i], range_1, f_string_range_empty_c);
     }
     else {
       range_2.stop = string_2s[i].used - 1;
index 440808509291a0ebc456bc86a5a2602cee81fd0b..3d41bc34a61699e34234d7f05baaa4f97cfe5c7d 100644 (file)
@@ -173,7 +173,6 @@ void test__f_compare_dynamic_partial_dynamic__works(void **state) {
     macro_f_string_static_t_initialize("aaone\0", 0, 6),
   };
 
-  const f_string_range_t range_0 = macro_f_string_range_t_initialize(1, 0);
   f_string_range_t range_2 = macro_f_string_range_t_initialize(2, 0);
 
   const f_status_t expects[] = {
@@ -266,7 +265,7 @@ void test__f_compare_dynamic_partial_dynamic__works(void **state) {
   for (; i < 8; ++i) {
 
     if (i % 8 == 0) {
-      status = f_compare_dynamic_partial_dynamic(string_1s[i], string_2s[i], range_0);
+      status = f_compare_dynamic_partial_dynamic(string_1s[i], string_2s[i], f_string_range_empty_c);
     }
     else {
       range_2.stop = string_2s[i].used - 1;
@@ -280,7 +279,7 @@ void test__f_compare_dynamic_partial_dynamic__works(void **state) {
   for (; i < 64; ++i) {
 
     if (i % 8 == 0) {
-      status = f_compare_dynamic_partial_dynamic(string_1s[i], string_2s[i], range_0);
+      status = f_compare_dynamic_partial_dynamic(string_1s[i], string_2s[i], f_string_range_empty_c);
     }
     else {
       range_2.stop = string_2s[i].used - 1;
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except.c b/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except.c
new file mode 100644 (file)
index 0000000..8f54769
--- /dev/null
@@ -0,0 +1,304 @@
+#include "test-compare.h"
+#include "test-compare-dynamic_partial_except.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_compare_dynamic_partial_except__works(void **state) {
+
+  const f_string_static_t string_1s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+
+    // 2.
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+
+    // 3.
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+
+    // 4.
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+
+    // 5.
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+
+    // 6.
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+
+    // 7.
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+
+    // 8.
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+  };
+
+  f_string_range_t range_1 = macro_f_string_range_t_initialize(3, 9);
+  f_string_range_t range_2 = macro_f_string_range_t_initialize(2, 0);
+
+  const f_string_static_t string_2s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 2.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 3.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 4.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 5.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 6.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 7.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 8.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+  };
+
+  const f_status_t expects[] = {
+
+    // 1.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 2.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 3.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 4.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 5.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 6.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 7.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 8.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+  };
+
+  f_array_length_t except_1[] = {
+    0, 1, 2, 3,
+  };
+  const f_array_lengths_t excepts_1 = macro_f_array_lengths_t_initialize(except_1, 0, 4);
+  const f_array_lengths_t excepts_2 = f_array_lengths_t_initialize;
+  uint8_t i = 0;
+  f_status_t status = F_none;
+
+  // First eight are against empty strings for first argument.
+  for (; i < 8; ++i) {
+
+    if (i % 8 == 0) {
+      status = f_compare_dynamic_partial_except(string_1s[i], string_2s[i], range_1, f_string_range_empty_c, excepts_1, excepts_2);
+    }
+    else {
+      range_2.stop = string_2s[i].used - 1;
+
+      status = f_compare_dynamic_partial_except(string_1s[i], string_2s[i], range_1, range_2, excepts_1, excepts_2);
+    }
+
+    assert_int_equal(status, expects[i]);
+  } // for
+
+  for (; i < 64; ++i) {
+
+    range_1.stop = string_1s[i].used - 1;
+
+    if (i % 8 == 0) {
+      status = f_compare_dynamic_partial_except(string_1s[i], string_2s[i], range_1, f_string_range_empty_c, excepts_1, excepts_2);
+    }
+    else {
+      range_2.stop = string_2s[i].used - 1;
+
+      status = f_compare_dynamic_partial_except(string_1s[i], string_2s[i], range_1, range_2, excepts_1, excepts_2);
+    }
+
+    assert_int_equal(status, expects[i]);
+  } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except.h b/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except.h
new file mode 100644 (file)
index 0000000..c55b01a
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Compare
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the compare project.
+ */
+#ifndef _TEST__F_compare_dynamic_partial_except_h
+#define _TEST__F_compare_dynamic_partial_except_h
+
+// f_compare_dynamic_partial_except() only returns memory failures.
+
+/**
+ * Test that function works.
+ *
+ * @see f_compare_dynamic_partial_except()
+ */
+extern void test__f_compare_dynamic_partial_except__works(void **state);
+
+#endif // _TEST__F_compare_dynamic_partial_except_h
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_dynamic.c b/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_dynamic.c
new file mode 100644 (file)
index 0000000..14a89b3
--- /dev/null
@@ -0,0 +1,301 @@
+#include "test-compare.h"
+#include "test-compare-dynamic_partial_except_dynamic.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_compare_dynamic_partial_except_dynamic__works(void **state) {
+
+  const f_string_static_t string_1s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+
+    // 2.
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+
+    // 3.
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+
+    // 4.
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+
+    // 5.
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+
+    // 6.
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+
+    // 7.
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+
+    // 8.
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+  };
+
+  f_string_range_t range_2 = macro_f_string_range_t_initialize(2, 0);
+
+  const f_string_static_t string_2s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 2.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 3.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 4.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 5.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 6.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 7.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 8.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+  };
+
+  const f_status_t expects[] = {
+
+    // 1.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 2.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 3.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 4.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 5.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 6.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 7.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 8.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+  };
+
+  f_array_length_t except_1[] = {
+    0, 1, 2, 3,
+  };
+  const f_array_lengths_t excepts_1 = macro_f_array_lengths_t_initialize(except_1, 0, 4);
+  const f_array_lengths_t excepts_2 = f_array_lengths_t_initialize;
+  uint8_t i = 0;
+  f_status_t status = F_none;
+
+  // First eight are against empty strings for first argument.
+  for (; i < 8; ++i) {
+
+    if (i % 8 == 0) {
+      status = f_compare_dynamic_partial_except_dynamic(string_1s[i], string_2s[i], f_string_range_empty_c, excepts_1, excepts_2);
+    }
+    else {
+      range_2.stop = string_2s[i].used - 1;
+
+      status = f_compare_dynamic_partial_except_dynamic(string_1s[i], string_2s[i], range_2, excepts_1, excepts_2);
+    }
+
+    assert_int_equal(status, expects[i]);
+  } // for
+
+  for (; i < 64; ++i) {
+
+    if (i % 8 == 0) {
+      status = f_compare_dynamic_partial_except_dynamic(string_1s[i], string_2s[i], f_string_range_empty_c, excepts_1, excepts_2);
+    }
+    else {
+      range_2.stop = string_2s[i].used - 1;
+
+      status = f_compare_dynamic_partial_except_dynamic(string_1s[i], string_2s[i], range_2, excepts_1, excepts_2);
+    }
+
+    assert_int_equal(status, expects[i]);
+  } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_dynamic.h b/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_dynamic.h
new file mode 100644 (file)
index 0000000..736f8ee
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Compare
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the compare project.
+ */
+#ifndef _TEST__F_compare_dynamic_partial_except_dynamic_h
+#define _TEST__F_compare_dynamic_partial_except_dynamic_h
+
+// f_compare_dynamic_partial_except_dynamic() only returns memory failures.
+
+/**
+ * Test that function works.
+ *
+ * @see f_compare_dynamic_partial_except_dynamic()
+ */
+extern void test__f_compare_dynamic_partial_except_dynamic__works(void **state);
+
+#endif // _TEST__F_compare_dynamic_partial_except_dynamic_h
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_string.c b/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_string.c
new file mode 100644 (file)
index 0000000..f619272
--- /dev/null
@@ -0,0 +1,304 @@
+#include "test-compare.h"
+#include "test-compare-dynamic_partial_except_string.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_compare_dynamic_partial_except_string__works(void **state) {
+
+  const f_string_static_t string_1s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+
+    // 2.
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+    macro_f_string_static_t_initialize("SKIP", 0, 4),
+
+    // 3.
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+    macro_f_string_static_t_initialize("SKIP1", 0, 5),
+
+    // 4.
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+    macro_f_string_static_t_initialize("SKIPone", 0, 7),
+
+    // 5.
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+    macro_f_string_static_t_initialize("SKIPOne", 0, 7),
+
+    // 6.
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0ne", 0, 7),
+
+    // 7.
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIPo\0ne", 0, 8),
+
+    // 8.
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+    macro_f_string_static_t_initialize("SKIPone\0", 0, 8),
+  };
+
+  const f_string_static_t string_2s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 2.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 3.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 4.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 5.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 6.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 7.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 8.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+  };
+
+  f_string_range_t range_1 = macro_f_string_range_t_initialize(3, 9);
+  f_string_range_t range_2 = macro_f_string_range_t_initialize(2, 0);
+
+  const f_status_t expects[] = {
+
+    // 1.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 2.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 3.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 4.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 5.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 6.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 7.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 8.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+  };
+
+  f_array_length_t except_1[] = {
+    0, 1, 2, 3,
+  };
+  const f_array_lengths_t excepts_1 = macro_f_array_lengths_t_initialize(except_1, 0, 4);
+  const f_array_lengths_t excepts_2 = f_array_lengths_t_initialize;
+  uint8_t i = 0;
+  f_status_t status = F_none;
+
+  // First eight are against empty strings for first argument.
+  for (; i < 8; ++i) {
+
+    if (i % 8 == 0) {
+      status = f_compare_dynamic_partial_except_string(string_1s[i].string, string_2s[i], 0, f_string_range_empty_c, excepts_1, excepts_2);
+    }
+    else {
+      range_2.stop = string_2s[i].used - 1;
+
+      status = f_compare_dynamic_partial_except_string(string_1s[i].string, string_2s[i], 0, range_2, excepts_1, excepts_2);
+    }
+
+    assert_int_equal(status, expects[i]);
+  } // for
+
+  for (; i < 64; ++i) {
+
+    range_1.stop = string_1s[i].used - 1;
+
+    if (i % 8 == 0) {
+      status = f_compare_dynamic_partial_except_string(string_1s[i].string, string_2s[i], range_1.stop + 1, f_string_range_empty_c, excepts_1, excepts_2);
+    }
+    else {
+      range_2.stop = string_2s[i].used - 1;
+
+      status = f_compare_dynamic_partial_except_string(string_1s[i].string, string_2s[i], range_1.stop + 1, range_2, excepts_1, excepts_2);
+    }
+
+    assert_int_equal(status, expects[i]);
+  } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_string.h b/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_string.h
new file mode 100644 (file)
index 0000000..4da0e4d
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Compare
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the compare project.
+ */
+#ifndef _TEST__F_compare_dynamic_partial_except_string_h
+#define _TEST__F_compare_dynamic_partial_except_string_h
+
+// f_compare_dynamic_partial_except_string() only returns memory failures.
+
+/**
+ * Test that function works.
+ *
+ * @see f_compare_dynamic_partial_except_string()
+ */
+extern void test__f_compare_dynamic_partial_except_string__works(void **state);
+
+#endif // _TEST__F_compare_dynamic_partial_except_string_h
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim.c b/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim.c
new file mode 100644 (file)
index 0000000..64c6399
--- /dev/null
@@ -0,0 +1,317 @@
+#include "test-compare.h"
+#include "test-compare-dynamic_partial_except_trim.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_compare_dynamic_partial_except_trim__works(void **state) {
+
+  // A necessary work-around to to have "\01" with the "\0" being separate from the "1".
+  f_char_t null_before_one_1[] = {
+    'S', 'K', 'I', 'P', '\0', '1'
+  };
+
+  f_char_t null_before_one_2[] = {
+    'S', 'K', 'I', 'P', '\0', '1', ' ', '\0', '\t'
+  };
+
+  f_char_t null_before_one_3[] = {
+    'S', 'K', 'I', 'P', '\0', ' ', '\0', '1'
+  };
+
+  const f_string_static_t string_1s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+
+    // 2.
+    macro_f_string_static_t_initialize("SKIP ", 0, 5),
+    macro_f_string_static_t_initialize("SKIP\t", 0, 5),
+    macro_f_string_static_t_initialize("SKIP\0", 0, 5),
+    macro_f_string_static_t_initialize("SKIP    ", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  \t ", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0 \0\t", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0 \0", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0\0\t", 0, 7),
+
+    // 3.
+    macro_f_string_static_t_initialize("SKIP 1", 0, 6),
+    macro_f_string_static_t_initialize("SKIP\t1", 0, 6),
+    macro_f_string_static_t_initialize(null_before_one_1, 0, 6),
+    macro_f_string_static_t_initialize("SKIP  1  ", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  1\t ", 0, 9),
+    macro_f_string_static_t_initialize(null_before_one_2, 0, 9),
+    macro_f_string_static_t_initialize(null_before_one_3, 0, 8),
+    macro_f_string_static_t_initialize("SKIP1\0\0\t", 0, 8),
+
+    // 4.
+    macro_f_string_static_t_initialize("SKIP one", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\tone", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0one", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  one  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  one\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0one \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0one", 0, 10),
+    macro_f_string_static_t_initialize("SKIPone\0\0\t", 0, 10),
+
+    // 5.
+    macro_f_string_static_t_initialize("SKIP One", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\tOne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0One", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  One  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  One\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0One \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0One", 0, 10),
+    macro_f_string_static_t_initialize("SKIPOne\0\0\t", 0, 10),
+
+    // 6.
+    macro_f_string_static_t_initialize("SKIP \0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\t\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  \0ne  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  \0ne\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0\0ne \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0\0ne", 0, 10),
+    macro_f_string_static_t_initialize("SKIP\0ne\0\0\t", 0, 10),
+
+    // 7.
+    macro_f_string_static_t_initialize("SKIP o\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\to\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\0o\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  o\0ne  ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP  o\0ne\t ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0o\0ne \0\t", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0 \0o\0ne", 0, 11),
+    macro_f_string_static_t_initialize("SKIPo\0ne\0\0\t", 0, 11),
+
+    // 8.
+    macro_f_string_static_t_initialize("SKIP one\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\tone\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\0one\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  one\0  ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP  one\0\t ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0one\0 \0\t", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0 \0one\0", 0, 11),
+    macro_f_string_static_t_initialize("SKIPone\0\0\0\t", 0, 11),
+  };
+
+  f_string_range_t range_1 = macro_f_string_range_t_initialize(3, 9);
+  f_string_range_t range_2 = macro_f_string_range_t_initialize(2, 0);
+
+  const f_string_static_t string_2s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 2.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 3.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 4.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 5.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 6.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 7.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 8.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+  };
+
+  const f_status_t expects[] = {
+
+    // 1.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 2.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 3.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 4.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 5.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 6.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 7.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 8.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+  };
+
+  f_array_length_t except_1[] = {
+    0, 1, 2, 3,
+  };
+  const f_array_lengths_t excepts_1 = macro_f_array_lengths_t_initialize(except_1, 0, 4);
+  const f_array_lengths_t excepts_2 = f_array_lengths_t_initialize;
+  uint8_t i = 0;
+  f_status_t status = F_none;
+
+  // First eight are against empty strings for first argument.
+  for (; i < 8; ++i) {
+
+    if (i % 8 == 0) {
+      status = f_compare_dynamic_partial_except_trim(string_1s[i], string_2s[i], range_1, f_string_range_empty_c, excepts_1, excepts_2);
+    }
+    else {
+      range_2.stop = string_2s[i].used - 1;
+
+      status = f_compare_dynamic_partial_except_trim(string_1s[i], string_2s[i], range_1, range_2, excepts_1, excepts_2);
+    }
+
+    assert_int_equal(status, expects[i]);
+  } // for
+
+  for (; i < 64; ++i) {
+
+    range_1.stop = string_1s[i].used - 1;
+
+    if (i % 8 == 0) {
+      status = f_compare_dynamic_partial_except_trim(string_1s[i], string_2s[i], range_1, f_string_range_empty_c, excepts_1, excepts_2);
+    }
+    else {
+      range_2.stop = string_2s[i].used - 1;
+
+      status = f_compare_dynamic_partial_except_trim(string_1s[i], string_2s[i], range_1, range_2, excepts_1, excepts_2);
+    }
+
+    assert_int_equal(status, expects[i]);
+  } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim.h b/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim.h
new file mode 100644 (file)
index 0000000..4d980ff
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Compare
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the compare project.
+ */
+#ifndef _TEST__F_compare_dynamic_partial_except_trim_h
+#define _TEST__F_compare_dynamic_partial_except_trim_h
+
+// f_compare_dynamic_partial_except_trim() only returns memory failures.
+
+/**
+ * Test that function works.
+ *
+ * @see f_compare_dynamic_partial_except_trim()
+ */
+extern void test__f_compare_dynamic_partial_except_trim__works(void **state);
+
+#endif // _TEST__F_compare_dynamic_partial_except_trim_h
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim_dynamic.c b/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim_dynamic.c
new file mode 100644 (file)
index 0000000..7e1e32d
--- /dev/null
@@ -0,0 +1,314 @@
+#include "test-compare.h"
+#include "test-compare-dynamic_partial_except_trim_dynamic.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_compare_dynamic_partial_except_trim_dynamic__works(void **state) {
+
+  // A necessary work-around to to have "\01" with the "\0" being separate from the "1".
+  f_char_t null_before_one_1[] = {
+    'S', 'K', 'I', 'P', '\0', '1'
+  };
+
+  f_char_t null_before_one_2[] = {
+    'S', 'K', 'I', 'P', '\0', '1', ' ', '\0', '\t'
+  };
+
+  f_char_t null_before_one_3[] = {
+    'S', 'K', 'I', 'P', '\0', ' ', '\0', '1'
+  };
+
+  const f_string_static_t string_1s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+
+    // 2.
+    macro_f_string_static_t_initialize("SKIP ", 0, 5),
+    macro_f_string_static_t_initialize("SKIP\t", 0, 5),
+    macro_f_string_static_t_initialize("SKIP\0", 0, 5),
+    macro_f_string_static_t_initialize("SKIP    ", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  \t ", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0 \0\t", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0 \0", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0\0\t", 0, 7),
+
+    // 3.
+    macro_f_string_static_t_initialize("SKIP 1", 0, 6),
+    macro_f_string_static_t_initialize("SKIP\t1", 0, 6),
+    macro_f_string_static_t_initialize(null_before_one_1, 0, 6),
+    macro_f_string_static_t_initialize("SKIP  1  ", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  1\t ", 0, 9),
+    macro_f_string_static_t_initialize(null_before_one_2, 0, 9),
+    macro_f_string_static_t_initialize(null_before_one_3, 0, 8),
+    macro_f_string_static_t_initialize("SKIP1\0\0\t", 0, 8),
+
+    // 4.
+    macro_f_string_static_t_initialize("SKIP one", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\tone", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0one", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  one  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  one\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0one \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0one", 0, 10),
+    macro_f_string_static_t_initialize("SKIPone\0\0\t", 0, 10),
+
+    // 5.
+    macro_f_string_static_t_initialize("SKIP One", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\tOne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0One", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  One  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  One\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0One \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0One", 0, 10),
+    macro_f_string_static_t_initialize("SKIPOne\0\0\t", 0, 10),
+
+    // 6.
+    macro_f_string_static_t_initialize("SKIP \0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\t\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  \0ne  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  \0ne\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0\0ne \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0\0ne", 0, 10),
+    macro_f_string_static_t_initialize("SKIP\0ne\0\0\t", 0, 10),
+
+    // 7.
+    macro_f_string_static_t_initialize("SKIP o\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\to\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\0o\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  o\0ne  ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP  o\0ne\t ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0o\0ne \0\t", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0 \0o\0ne", 0, 11),
+    macro_f_string_static_t_initialize("SKIPo\0ne\0\0\t", 0, 11),
+
+    // 8.
+    macro_f_string_static_t_initialize("SKIP one\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\tone\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\0one\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  one\0  ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP  one\0\t ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0one\0 \0\t", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0 \0one\0", 0, 11),
+    macro_f_string_static_t_initialize("SKIPone\0\0\0\t", 0, 11),
+  };
+
+  f_string_range_t range_2 = macro_f_string_range_t_initialize(2, 0);
+
+  const f_string_static_t string_2s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 2.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 3.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 4.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 5.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 6.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 7.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 8.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+  };
+
+  const f_status_t expects[] = {
+
+    // 1.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 2.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 3.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 4.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 5.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 6.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 7.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 8.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+  };
+
+  f_array_length_t except_1[] = {
+    0, 1, 2, 3,
+  };
+  const f_array_lengths_t excepts_1 = macro_f_array_lengths_t_initialize(except_1, 0, 4);
+  const f_array_lengths_t excepts_2 = f_array_lengths_t_initialize;
+  uint8_t i = 0;
+  f_status_t status = F_none;
+
+  // First eight are against empty strings for first argument.
+  for (; i < 8; ++i) {
+
+    if (i % 8 == 0) {
+      status = f_compare_dynamic_partial_except_trim_dynamic(string_1s[i], string_2s[i], f_string_range_empty_c, excepts_1, excepts_2);
+    }
+    else {
+      range_2.stop = string_2s[i].used - 1;
+
+      status = f_compare_dynamic_partial_except_trim_dynamic(string_1s[i], string_2s[i], range_2, excepts_1, excepts_2);
+    }
+
+    assert_int_equal(status, expects[i]);
+  } // for
+
+  for (; i < 64; ++i) {
+
+    if (i % 8 == 0) {
+      status = f_compare_dynamic_partial_except_trim_dynamic(string_1s[i], string_2s[i], f_string_range_empty_c, excepts_1, excepts_2);
+    }
+    else {
+      range_2.stop = string_2s[i].used - 1;
+
+      status = f_compare_dynamic_partial_except_trim_dynamic(string_1s[i], string_2s[i], range_2, excepts_1, excepts_2);
+    }
+
+    assert_int_equal(status, expects[i]);
+  } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim_dynamic.h b/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim_dynamic.h
new file mode 100644 (file)
index 0000000..9ff9315
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Compare
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the compare project.
+ */
+#ifndef _TEST__F_compare_dynamic_partial_except_trim_dynamic_h
+#define _TEST__F_compare_dynamic_partial_except_trim_dynamic_h
+
+// f_compare_dynamic_partial_except_trim_dynamic() only returns memory failures.
+
+/**
+ * Test that function works.
+ *
+ * @see f_compare_dynamic_partial_except_trim_dynamic()
+ */
+extern void test__f_compare_dynamic_partial_except_trim_dynamic__works(void **state);
+
+#endif // _TEST__F_compare_dynamic_partial_except_trim_dynamic_h
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim_string.c b/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim_string.c
new file mode 100644 (file)
index 0000000..df53c2b
--- /dev/null
@@ -0,0 +1,317 @@
+#include "test-compare.h"
+#include "test-compare-dynamic_partial_except_trim_string.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_compare_dynamic_partial_except_trim_string__works(void **state) {
+
+  // A necessary work-around to to have "\01" with the "\0" being separate from the "1".
+  f_char_t null_before_one_1[] = {
+    'S', 'K', 'I', 'P', '\0', '1'
+  };
+
+  f_char_t null_before_one_2[] = {
+    'S', 'K', 'I', 'P', '\0', '1', ' ', '\0', '\t'
+  };
+
+  f_char_t null_before_one_3[] = {
+    'S', 'K', 'I', 'P', '\0', ' ', '\0', '1'
+  };
+
+  const f_string_static_t string_1s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+
+    // 2.
+    macro_f_string_static_t_initialize("SKIP ", 0, 5),
+    macro_f_string_static_t_initialize("SKIP\t", 0, 5),
+    macro_f_string_static_t_initialize("SKIP\0", 0, 5),
+    macro_f_string_static_t_initialize("SKIP    ", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  \t ", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0 \0\t", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0 \0", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0\0\t", 0, 7),
+
+    // 3.
+    macro_f_string_static_t_initialize("SKIP 1", 0, 6),
+    macro_f_string_static_t_initialize("SKIP\t1", 0, 6),
+    macro_f_string_static_t_initialize(null_before_one_1, 0, 6),
+    macro_f_string_static_t_initialize("SKIP  1  ", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  1\t ", 0, 9),
+    macro_f_string_static_t_initialize(null_before_one_2, 0, 9),
+    macro_f_string_static_t_initialize(null_before_one_3, 0, 8),
+    macro_f_string_static_t_initialize("SKIP1\0\0\t", 0, 8),
+
+    // 4.
+    macro_f_string_static_t_initialize("SKIP one", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\tone", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0one", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  one  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  one\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0one \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0one", 0, 10),
+    macro_f_string_static_t_initialize("SKIPone\0\0\t", 0, 10),
+
+    // 5.
+    macro_f_string_static_t_initialize("SKIP One", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\tOne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0One", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  One  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  One\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0One \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0One", 0, 10),
+    macro_f_string_static_t_initialize("SKIPOne\0\0\t", 0, 10),
+
+    // 6.
+    macro_f_string_static_t_initialize("SKIP \0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\t\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  \0ne  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  \0ne\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0\0ne \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0\0ne", 0, 10),
+    macro_f_string_static_t_initialize("SKIP\0ne\0\0\t", 0, 10),
+
+    // 7.
+    macro_f_string_static_t_initialize("SKIP o\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\to\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\0o\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  o\0ne  ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP  o\0ne\t ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0o\0ne \0\t", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0 \0o\0ne", 0, 11),
+    macro_f_string_static_t_initialize("SKIPo\0ne\0\0\t", 0, 11),
+
+    // 8.
+    macro_f_string_static_t_initialize("SKIP one\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\tone\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\0one\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  one\0  ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP  one\0\t ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0one\0 \0\t", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0 \0one\0", 0, 11),
+    macro_f_string_static_t_initialize("SKIPone\0\0\0\t", 0, 11),
+  };
+
+  const f_string_static_t string_2s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 2.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 3.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 4.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 5.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 6.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 7.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+
+    // 8.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("aa", 0, 2),
+    macro_f_string_static_t_initialize("aa1", 0, 3),
+    macro_f_string_static_t_initialize("aaone", 0, 5),
+    macro_f_string_static_t_initialize("aaOne", 0, 5),
+    macro_f_string_static_t_initialize("aa\0ne", 0, 5),
+    macro_f_string_static_t_initialize("aao\0ne", 0, 6),
+    macro_f_string_static_t_initialize("aaone\0", 0, 6),
+  };
+
+  f_string_range_t range_1 = macro_f_string_range_t_initialize(3, 9);
+  f_string_range_t range_2 = macro_f_string_range_t_initialize(2, 0);
+
+  const f_status_t expects[] = {
+
+    // 1.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 2.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 3.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 4.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 5.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 6.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 7.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 8.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+  };
+
+  f_array_length_t except_1[] = {
+    0, 1, 2, 3,
+  };
+  const f_array_lengths_t excepts_1 = macro_f_array_lengths_t_initialize(except_1, 0, 4);
+  const f_array_lengths_t excepts_2 = f_array_lengths_t_initialize;
+  uint8_t i = 0;
+  f_status_t status = F_none;
+
+  // First eight are against empty strings for first argument.
+  for (; i < 8; ++i) {
+
+    if (i % 8 == 0) {
+      status = f_compare_dynamic_partial_except_trim_string(string_1s[i].string, string_2s[i], 0, f_string_range_empty_c, excepts_1, excepts_2);
+    }
+    else {
+      range_2.stop = string_2s[i].used - 1;
+
+      status = f_compare_dynamic_partial_except_trim_string(string_1s[i].string, string_2s[i], 0, range_2, excepts_1, excepts_2);
+    }
+
+    assert_int_equal(status, expects[i]);
+  } // for
+
+  for (; i < 64; ++i) {
+
+    range_1.stop = string_1s[i].used - 1;
+
+    if (i % 8 == 0) {
+      status = f_compare_dynamic_partial_except_trim_string(string_1s[i].string, string_2s[i], range_1.stop + 1, f_string_range_empty_c, excepts_1, excepts_2);
+    }
+    else {
+      range_2.stop = string_2s[i].used - 1;
+
+      status = f_compare_dynamic_partial_except_trim_string(string_1s[i].string, string_2s[i], range_1.stop + 1, range_2, excepts_1, excepts_2);
+    }
+
+    assert_int_equal(status, expects[i]);
+  } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim_string.h b/level_0/f_compare/tests/unit/c/test-compare-dynamic_partial_except_trim_string.h
new file mode 100644 (file)
index 0000000..da61e10
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Compare
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the compare project.
+ */
+#ifndef _TEST__F_compare_dynamic_partial_except_trim_string_h
+#define _TEST__F_compare_dynamic_partial_except_trim_string_h
+
+// f_compare_dynamic_partial_except_trim_string() only returns memory failures.
+
+/**
+ * Test that function works.
+ *
+ * @see f_compare_dynamic_partial_except_trim_string()
+ */
+extern void test__f_compare_dynamic_partial_except_trim_string__works(void **state);
+
+#endif // _TEST__F_compare_dynamic_partial_except_trim_string_h
index 13e6fbf3b406d02ae8e64d1f2e28948a8f11148e..9463f36ab953259a4a7d7ea422261612c4de5d1e 100644 (file)
@@ -173,7 +173,6 @@ void test__f_compare_dynamic_partial_string__works(void **state) {
     macro_f_string_static_t_initialize("aaone\0", 0, 6),
   };
 
-  const f_string_range_t range_0 = macro_f_string_range_t_initialize(1, 0);
   f_string_range_t range_1 = macro_f_string_range_t_initialize(3, 9);
   f_string_range_t range_2 = macro_f_string_range_t_initialize(2, 0);
 
@@ -267,7 +266,7 @@ void test__f_compare_dynamic_partial_string__works(void **state) {
   for (; i < 8; ++i) {
 
     if (i % 8 == 0) {
-      status = f_compare_dynamic_partial_string(string_1s[i].string, string_2s[i], 0, range_0);
+      status = f_compare_dynamic_partial_string(string_1s[i].string, string_2s[i], 0, f_string_range_empty_c);
     }
     else {
       range_2.stop = string_2s[i].used - 1;
@@ -283,7 +282,7 @@ void test__f_compare_dynamic_partial_string__works(void **state) {
     range_1.stop = string_1s[i].used - 1;
 
     if (i % 8 == 0) {
-      status = f_compare_dynamic_partial_string(string_1s[i].string + range_1.start, string_2s[i], (range_1.stop - range_1.start) + 1, range_0);
+      status = f_compare_dynamic_partial_string(string_1s[i].string + range_1.start, string_2s[i], (range_1.stop - range_1.start) + 1, f_string_range_empty_c);
     }
     else {
       range_2.stop = string_2s[i].used - 1;
index 3fbb063099220198bc4cf435edbed6fc0dc769ef..fdf524c4d67e4c085d2163a79c8a53a689f5b787 100644 (file)
@@ -8,10 +8,18 @@ extern "C" {
 void test__f_compare_dynamic_partial_trim__works(void **state) {
 
   // A necessary work-around to to have "\01" with the "\0" being separate from the "1".
-  f_char_t null_before_one[] = {
+  f_char_t null_before_one_1[] = {
     'x', 'x', 'x', '\0', '1', 'y', 'y', 'y'
   };
 
+  f_char_t null_before_one_2[] = {
+    'x', 'x', 'x', '\0', '1', ' ', '\0', '\t', 'y', 'y', 'y'
+  };
+
+  f_char_t null_before_one_3[] = {
+    'x', 'x', 'x', '\0', ' ', '\0', '1', 'y', 'y', 'y'
+  };
+
   const f_string_static_t string_1s[] = {
 
     // 1.
@@ -37,11 +45,11 @@ void test__f_compare_dynamic_partial_trim__works(void **state) {
     // 3.
     macro_f_string_static_t_initialize("xxx 1yyy", 0, 8),
     macro_f_string_static_t_initialize("xxx\t1yyy", 0, 8),
-    macro_f_string_static_t_initialize(null_before_one, 0, 8),
+    macro_f_string_static_t_initialize(null_before_one_1, 0, 8),
     macro_f_string_static_t_initialize("xxx  1  yyy", 0, 11),
     macro_f_string_static_t_initialize("xxx  1\t yyy", 0, 11),
-    macro_f_string_static_t_initialize("xxx\01 \0\tyyy", 0, 11),
-    macro_f_string_static_t_initialize("xxx\0 \01yyy", 0, 10),
+    macro_f_string_static_t_initialize(null_before_one_2, 0, 11),
+    macro_f_string_static_t_initialize(null_before_one_3, 0, 10),
     macro_f_string_static_t_initialize("xxx1\0\0\tyyy", 0, 10),
 
     // 4.
@@ -178,7 +186,6 @@ void test__f_compare_dynamic_partial_trim__works(void **state) {
     macro_f_string_static_t_initialize("aaone\0", 0, 6),
   };
 
-  const f_string_range_t range_0 = macro_f_string_range_t_initialize(1, 0);
   f_string_range_t range_1 = macro_f_string_range_t_initialize(3, 9);
   f_string_range_t range_2 = macro_f_string_range_t_initialize(2, 0);
 
@@ -272,12 +279,12 @@ void test__f_compare_dynamic_partial_trim__works(void **state) {
   for (; i < 8; ++i) {
 
     if (i % 8 == 0) {
-      status = f_compare_dynamic_partial_trim(string_1s[i], string_2s[i], range_0, range_0);
+      status = f_compare_dynamic_partial_trim(string_1s[i], string_2s[i], f_string_range_empty_c, f_string_range_empty_c);
     }
     else {
       range_2.stop = string_2s[i].used - 1;
 
-      status = f_compare_dynamic_partial_trim(string_1s[i], string_2s[i], range_0, range_2);
+      status = f_compare_dynamic_partial_trim(string_1s[i], string_2s[i], f_string_range_empty_c, range_2);
     }
 
     assert_int_equal(status, expects[i]);
@@ -288,7 +295,7 @@ void test__f_compare_dynamic_partial_trim__works(void **state) {
     range_1.stop = string_1s[i].used - 4;
 
     if (i % 8 == 0) {
-      status = f_compare_dynamic_partial_trim(string_1s[i], string_2s[i], range_1, range_0);
+      status = f_compare_dynamic_partial_trim(string_1s[i], string_2s[i], range_1, f_string_range_empty_c);
     }
     else {
       range_2.stop = string_2s[i].used - 1;
index 44c753e287b32c0f94ff5a3343b1102aa9f32655..cd22f2eb759ca77d4fa399173bbfff400ed8a7ff 100644 (file)
@@ -8,10 +8,18 @@ extern "C" {
 void test__f_compare_dynamic_partial_trim_dynamic__works(void **state) {
 
   // A necessary work-around to to have "\01" with the "\0" being separate from the "1".
-  f_char_t null_before_one[] = {
+  f_char_t null_before_one_1[] = {
     '\0', '1'
   };
 
+  f_char_t null_before_one_2[] = {
+    '\0', '1', ' ', '\0', '\t'
+  };
+
+  f_char_t null_before_one_3[] = {
+    '\0', ' ', '\0', '1'
+  };
+
   const f_string_static_t string_1s[] = {
 
     // 1.
@@ -37,11 +45,11 @@ void test__f_compare_dynamic_partial_trim_dynamic__works(void **state) {
     // 3.
     macro_f_string_static_t_initialize(" 1", 0, 2),
     macro_f_string_static_t_initialize("\t1", 0, 2),
-    macro_f_string_static_t_initialize(null_before_one, 0, 2),
+    macro_f_string_static_t_initialize(null_before_one_1, 0, 2),
     macro_f_string_static_t_initialize("  1  ", 0, 5),
     macro_f_string_static_t_initialize("  1\t ", 0, 5),
-    macro_f_string_static_t_initialize("\01 \0\t", 0, 5),
-    macro_f_string_static_t_initialize("\0 \01", 0, 4),
+    macro_f_string_static_t_initialize(null_before_one_2, 0, 5),
+    macro_f_string_static_t_initialize(null_before_one_3, 0, 4),
     macro_f_string_static_t_initialize("1\0\0\t", 0, 4),
 
     // 4.
@@ -178,7 +186,6 @@ void test__f_compare_dynamic_partial_trim_dynamic__works(void **state) {
     macro_f_string_static_t_initialize("aaone\0", 0, 6),
   };
 
-  const f_string_range_t range_0 = macro_f_string_range_t_initialize(1, 0);
   f_string_range_t range_2 = macro_f_string_range_t_initialize(2, 0);
 
   const f_status_t expects[] = {
@@ -271,7 +278,7 @@ void test__f_compare_dynamic_partial_trim_dynamic__works(void **state) {
   for (; i < 8; ++i) {
 
     if (i % 8 == 0) {
-      status = f_compare_dynamic_partial_trim_dynamic(string_1s[i], string_2s[i], range_0);
+      status = f_compare_dynamic_partial_trim_dynamic(string_1s[i], string_2s[i], f_string_range_empty_c);
     }
     else {
       range_2.stop = string_2s[i].used - 1;
@@ -285,7 +292,7 @@ void test__f_compare_dynamic_partial_trim_dynamic__works(void **state) {
   for (; i < 64; ++i) {
 
     if (i % 8 == 0) {
-      status = f_compare_dynamic_partial_trim_dynamic(string_1s[i], string_2s[i], range_0);
+      status = f_compare_dynamic_partial_trim_dynamic(string_1s[i], string_2s[i], f_string_range_empty_c);
     }
     else {
       range_2.stop = string_2s[i].used - 1;
index a162c8203376415d130fce4e90bd1b93bf63fb07..92dd315227427237cc8ab285951c88d59ad20e7d 100644 (file)
@@ -8,10 +8,18 @@ extern "C" {
 void test__f_compare_dynamic_partial_trim_string__works(void **state) {
 
   // A necessary work-around to to have "\01" with the "\0" being separate from the "1".
-  f_char_t null_before_one[] = {
+  f_char_t null_before_one_1[] = {
     'x', 'x', 'x', '\0', '1'
   };
 
+  f_char_t null_before_one_2[] = {
+    'x', 'x', 'x', '\0', '1', ' ', '\0', '\t'
+  };
+
+  f_char_t null_before_one_3[] = {
+    'x', 'x', 'x', '\0', ' ', '\0', '1'
+  };
+
   const f_string_static_t string_1s[] = {
 
     // 1.
@@ -37,11 +45,11 @@ void test__f_compare_dynamic_partial_trim_string__works(void **state) {
     // 3.
     macro_f_string_static_t_initialize("xxx 1", 0, 5),
     macro_f_string_static_t_initialize("xxx\t1", 0, 5),
-    macro_f_string_static_t_initialize(null_before_one, 0, 5),
+    macro_f_string_static_t_initialize(null_before_one_1, 0, 5),
     macro_f_string_static_t_initialize("xxx  1  ", 0, 8),
     macro_f_string_static_t_initialize("xxx  1\t ", 0, 8),
-    macro_f_string_static_t_initialize("xxx\01 \0\t", 0, 8),
-    macro_f_string_static_t_initialize("xxx\0 \01", 0, 7),
+    macro_f_string_static_t_initialize(null_before_one_2, 0, 8),
+    macro_f_string_static_t_initialize(null_before_one_3, 0, 7),
     macro_f_string_static_t_initialize("xxx1\0\0\t", 0, 7),
 
     // 4.
@@ -178,7 +186,6 @@ void test__f_compare_dynamic_partial_trim_string__works(void **state) {
     macro_f_string_static_t_initialize("aaone\0", 0, 6),
   };
 
-  const f_string_range_t range_0 = macro_f_string_range_t_initialize(1, 0);
   f_string_range_t range_1 = macro_f_string_range_t_initialize(3, 9);
   f_string_range_t range_2 = macro_f_string_range_t_initialize(2, 0);
 
@@ -272,7 +279,7 @@ void test__f_compare_dynamic_partial_trim_string__works(void **state) {
   for (; i < 8; ++i) {
 
     if (i % 8 == 0) {
-      status = f_compare_dynamic_partial_trim_string(string_1s[i].string, string_2s[i], 0, range_0);
+      status = f_compare_dynamic_partial_trim_string(string_1s[i].string, string_2s[i], 0, f_string_range_empty_c);
     }
     else {
       range_2.stop = string_2s[i].used - 1;
@@ -288,7 +295,7 @@ void test__f_compare_dynamic_partial_trim_string__works(void **state) {
     range_1.stop = string_1s[i].used - 1;
 
     if (i % 8 == 0) {
-      status = f_compare_dynamic_partial_trim_string(string_1s[i].string + range_1.start, string_2s[i], (range_1.stop - range_1.start) + 1, range_0);
+      status = f_compare_dynamic_partial_trim_string(string_1s[i].string + range_1.start, string_2s[i], (range_1.stop - range_1.start) + 1, f_string_range_empty_c);
     }
     else {
       range_2.stop = string_2s[i].used - 1;
index e7f2bb32b36d1dd6d51b1dffb51c77dcec90e13b..f89245e72ba14b514fa9b000c802aceac27b2eb9 100644 (file)
@@ -261,15 +261,16 @@ void test__f_compare_except__works(void **state) {
   };
   const f_array_lengths_t excepts_1 = macro_f_array_lengths_t_initialize(except_1, 0, 4);
   const f_array_lengths_t excepts_2 = f_array_lengths_t_initialize;
+  uint8_t i = 0;
 
-  for (uint8_t i = 0; i < 64; ++i) {
+  for (; i < 64; ++i) {
 
     const f_status_t status = f_compare_except(string_1s[i].string, string_2s[i].string, string_1s[i].used, string_2s[i].used, excepts_1, excepts_2);
 
     assert_int_equal(status, expects[i]);
   } // for
 
-  for (uint8_t i = 0; i < 64; ++i) {
+  for (i = 0; i < 64; ++i) {
 
     const f_status_t status = f_compare_except(string_2s[i].string, string_1s[i].string, string_2s[i].used, string_1s[i].used, excepts_2, excepts_1);
 
index d8c0ad5841ca1ac20a7e6746325bcf298f58b2e4..01209e0e38dc3643c3230d5dfc9c385c3e201b1c 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef _TEST__F_compare_except_h
 #define _TEST__F_compare_except_h
 
-// f_compare_() only returns memory failures.
+// f_compare_except() only returns memory failures.
 
 /**
  * Test that function works.
diff --git a/level_0/f_compare/tests/unit/c/test-compare-except_trim.c b/level_0/f_compare/tests/unit/c/test-compare-except_trim.c
new file mode 100644 (file)
index 0000000..3cef735
--- /dev/null
@@ -0,0 +1,296 @@
+#include "test-compare.h"
+#include "test-compare-except_trim.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_compare_except_trim__works(void **state) {
+
+  // A necessary work-around to to have "\01" with the "\0" being separate from the "1".
+  f_char_t null_before_one_1[] = {
+    'S', 'K', 'I', 'P', '\0', '1'
+  };
+
+  f_char_t null_before_one_2[] = {
+    'S', 'K', 'I', 'P', '\0', '1', ' ', '\0', '\t'
+  };
+
+  f_char_t null_before_one_3[] = {
+    'S', 'K', 'I', 'P', '\0', ' ', '\0', '1'
+  };
+
+  const f_string_static_t string_1s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize(0, 0, 0),
+
+    // 2.
+    macro_f_string_static_t_initialize("SKIP ", 0, 5),
+    macro_f_string_static_t_initialize("SKIP\t", 0, 5),
+    macro_f_string_static_t_initialize("SKIP\0", 0, 5),
+    macro_f_string_static_t_initialize("SKIP    ", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  \t ", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0 \0\t", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0 \0", 0, 7),
+    macro_f_string_static_t_initialize("SKIP\0\0\t", 0, 7),
+
+    // 3.
+    macro_f_string_static_t_initialize("SKIP 1", 0, 6),
+    macro_f_string_static_t_initialize("SKIP\t1", 0, 6),
+    macro_f_string_static_t_initialize(null_before_one_1, 0, 6),
+    macro_f_string_static_t_initialize("SKIP  1  ", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  1\t ", 0, 9),
+    macro_f_string_static_t_initialize(null_before_one_2, 0, 9),
+    macro_f_string_static_t_initialize(null_before_one_3, 0, 8),
+    macro_f_string_static_t_initialize("SKIP1\0\0\t", 0, 8),
+
+    // 4.
+    macro_f_string_static_t_initialize("SKIP one", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\tone", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0one", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  one  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  one\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0one \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0one", 0, 10),
+    macro_f_string_static_t_initialize("SKIPone\0\0\t", 0, 10),
+
+    // 5.
+    macro_f_string_static_t_initialize("SKIP One", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\tOne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0One", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  One  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  One\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0One \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0One", 0, 10),
+    macro_f_string_static_t_initialize("SKIPOne\0\0\t", 0, 10),
+
+    // 6.
+    macro_f_string_static_t_initialize("SKIP \0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\t\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP\0\0ne", 0, 8),
+    macro_f_string_static_t_initialize("SKIP  \0ne  ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP  \0ne\t ", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0\0ne \0\t", 0, 11),
+    macro_f_string_static_t_initialize("SKIP\0 \0\0ne", 0, 10),
+    macro_f_string_static_t_initialize("SKIP\0ne\0\0\t", 0, 10),
+
+    // 7.
+    macro_f_string_static_t_initialize("SKIP o\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\to\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\0o\0ne", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  o\0ne  ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP  o\0ne\t ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0o\0ne \0\t", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0 \0o\0ne", 0, 11),
+    macro_f_string_static_t_initialize("SKIPo\0ne\0\0\t", 0, 11),
+
+    // 8.
+    macro_f_string_static_t_initialize("SKIP one\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\tone\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP\0one\0", 0, 9),
+    macro_f_string_static_t_initialize("SKIP  one\0  ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP  one\0\t ", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0one\0 \0\t", 0, 12),
+    macro_f_string_static_t_initialize("SKIP\0 \0one\0", 0, 11),
+    macro_f_string_static_t_initialize("SKIPone\0\0\0\t", 0, 11),
+  };
+
+  const f_string_static_t string_2s[] = {
+
+    // 1.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 2.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 3.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 4.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 5.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 6.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 7.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+
+    // 8.
+    macro_f_string_static_t_initialize(0, 0, 0),
+    macro_f_string_static_t_initialize("", 0, 0),
+    macro_f_string_static_t_initialize("1", 0, 1),
+    macro_f_string_static_t_initialize("one", 0, 3),
+    macro_f_string_static_t_initialize("One", 0, 3),
+    macro_f_string_static_t_initialize("\0ne", 0, 3),
+    macro_f_string_static_t_initialize("o\0ne", 0, 4),
+    macro_f_string_static_t_initialize("one\0", 0, 4),
+  };
+
+  const f_status_t expects[] = {
+
+    // 1.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 2.
+    F_equal_to,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 3.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 4.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 5.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 6.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+
+    // 7.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+
+    // 8.
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to_not,
+    F_equal_to_not,
+    F_equal_to,
+    F_equal_to,
+  };
+
+  f_array_length_t except_1[] = {
+    0, 1, 2, 3,
+  };
+  const f_array_lengths_t excepts_1 = macro_f_array_lengths_t_initialize(except_1, 0, 4);
+  const f_array_lengths_t excepts_2 = f_array_lengths_t_initialize;
+  uint8_t i = 0;
+
+  for (; i < 64; ++i) {
+
+    const f_status_t status = f_compare_except_trim(string_1s[i].string, string_2s[i].string, string_1s[i].used, string_2s[i].used, excepts_1, excepts_2);
+
+    assert_int_equal(status, expects[i]);
+  } // for
+
+  for (i = 0; i < 64; ++i) {
+
+    const f_status_t status = f_compare_except_trim(string_2s[i].string, string_1s[i].string, string_2s[i].used, string_1s[i].used, excepts_2, excepts_1);
+
+    assert_int_equal(status, expects[i]);
+  } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_compare/tests/unit/c/test-compare-except_trim.h b/level_0/f_compare/tests/unit/c/test-compare-except_trim.h
new file mode 100644 (file)
index 0000000..906b4a2
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Compare
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the compare project.
+ */
+#ifndef _TEST__F_compare_except_trim_h
+#define _TEST__F_compare_except_trim_h
+
+// f_compare_except_trim() only returns memory failures.
+
+/**
+ * Test that function works.
+ *
+ * @see f_compare_except_trim()
+ */
+extern void test__f_compare_except_trim__works(void **state);
+
+#endif // _TEST__F_compare_except_trim_h
index 2e93f540fcdbb84bcb0920d160f79178b2505b07..6bf8561748cd9ff454feb67fbf6407cd55be95e7 100644 (file)
@@ -24,12 +24,12 @@ int main(void) {
     cmocka_unit_test(test__f_compare_dynamic__works),
     cmocka_unit_test(test__f_compare_dynamic_partial__works),
     cmocka_unit_test(test__f_compare_dynamic_partial_dynamic__works),
-    //cmocka_unit_test(test__f_compare_dynamic_partial_except__works),
-    //cmocka_unit_test(test__f_compare_dynamic_partial_except_dynamic__works),
-    //cmocka_unit_test(test__f_compare_dynamic_partial_except_string__works),
-    //cmocka_unit_test(test__f_compare_dynamic_partial_except_trim__works),
-    //cmocka_unit_test(test__f_compare_dynamic_partial_except_trim_dynamic__works),
-    //cmocka_unit_test(test__f_compare_dynamic_partial_except_trim_string__works),
+    cmocka_unit_test(test__f_compare_dynamic_partial_except__works),
+    cmocka_unit_test(test__f_compare_dynamic_partial_except_dynamic__works),
+    cmocka_unit_test(test__f_compare_dynamic_partial_except_string__works),
+    cmocka_unit_test(test__f_compare_dynamic_partial_except_trim__works),
+    cmocka_unit_test(test__f_compare_dynamic_partial_except_trim_dynamic__works),
+    cmocka_unit_test(test__f_compare_dynamic_partial_except_trim_string__works),
     cmocka_unit_test(test__f_compare_dynamic_partial_string__works),
     cmocka_unit_test(test__f_compare_dynamic_partial_trim__works),
     cmocka_unit_test(test__f_compare_dynamic_partial_trim_dynamic__works),
@@ -41,12 +41,12 @@ int main(void) {
     cmocka_unit_test(test__f_compare_dynamic_trim_string__trims),
     cmocka_unit_test(test__f_compare_dynamic_trim_string__something_misses_nothing),
     cmocka_unit_test(test__f_compare_dynamic_trim_string__works),
-    //cmocka_unit_test(test__f_compare_dynamic_except__works),
-    //cmocka_unit_test(test__f_compare_dynamic_except_string__works),
-    //cmocka_unit_test(test__f_compare_dynamic_except_trim__works),
+    cmocka_unit_test(test__f_compare_dynamic_except__works),
+    cmocka_unit_test(test__f_compare_dynamic_except_string__works),
+    cmocka_unit_test(test__f_compare_dynamic_except_trim__works),
+    cmocka_unit_test(test__f_compare_dynamic_except_trim_string__works),
     cmocka_unit_test(test__f_compare_except__works),
-    //cmocka_unit_test(test__f_compare_except_trim__works),
-    //cmocka_unit_test(test__f_compare_except_trim_string__works),
+    cmocka_unit_test(test__f_compare_except_trim__works),
     cmocka_unit_test(test__f_compare_trim__trims),
     cmocka_unit_test(test__f_compare_trim__something_misses_nothing),
     cmocka_unit_test(test__f_compare_trim__works),
@@ -70,9 +70,9 @@ int main(void) {
       // f_compare_dynamic_except() doesn't use parameter checking.
       // f_compare_dynamic_except_string() doesn't use parameter checking.
       // f_compare_dynamic_except_trim() doesn't use parameter checking.
+      // f_compare_dynamic_except_trim_string() doesn't use parameter checking.
       // f_compare_except() doesn't use parameter checking.
       // f_compare_except_trim() doesn't use parameter checking.
-      // f_compare_except_trim_string() doesn't use parameter checking.
       // f_compare_trim() doesn't use parameter checking.
     #endif // _di_level_0_parameter_checking_
   };
index 4f148221437605f0e43b2740efce14f9d7fa764c..0c2e692c03e590e70e6e1cf93a4cf2d6574bd88f 100644 (file)
 #include "test-compare-dynamic.h"
 #include "test-compare-dynamic_partial.h"
 #include "test-compare-dynamic_partial_dynamic.h"
-//#include "test-compare-dynamic_partial_except.h"
-//#include "test-compare-dynamic_partial_except_dynamic.h"
-//#include "test-compare-dynamic_partial_except_string.h"
-//#include "test-compare-dynamic_partial_except_trim.h"
-//#include "test-compare-dynamic_partial_except_trim_dynamic.h"
-//#include "test-compare-dynamic_partial_except_trim_string.h"
+#include "test-compare-dynamic_partial_except.h"
+#include "test-compare-dynamic_partial_except_dynamic.h"
+#include "test-compare-dynamic_partial_except_string.h"
+#include "test-compare-dynamic_partial_except_trim.h"
+#include "test-compare-dynamic_partial_except_trim_dynamic.h"
+#include "test-compare-dynamic_partial_except_trim_string.h"
 #include "test-compare-dynamic_partial_string.h"
 #include "test-compare-dynamic_partial_trim.h"
 #include "test-compare-dynamic_partial_trim_dynamic.h"
 #include "test-compare-dynamic_string.h"
 #include "test-compare-dynamic_trim.h"
 #include "test-compare-dynamic_trim_string.h"
-//#include "test-compare-dynamic_except.h"
-//#include "test-compare-dynamic_except_string.h"
-//#include "test-compare-dynamic_except_trim.h"
+#include "test-compare-dynamic_except.h"
+#include "test-compare-dynamic_except_string.h"
+#include "test-compare-dynamic_except_trim.h"
+#include "test-compare-dynamic_except_trim_string.h"
 #include "test-compare-except.h"
-//#include "test-compare-except_trim.h"
-//#include "test-compare-except_trim_string.h"
+#include "test-compare-except_trim.h"
 #include "test-compare-trim.h"
 
 #ifdef __cplusplus