aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristian C <cc@localhost>2025-03-07 23:05:12 -0800
committerChristian C <cc@localhost>2025-03-07 23:05:12 -0800
commitafad16ce636dd54fa1fdedd100eb93f1d7b508d6 (patch)
tree075739eb47cf62fd59ea92e988d0d7d033eef771 /include
parentfb290d22289f9c29eef504a538f7a293844a624d (diff)
Test suite start
Diffstat (limited to 'include')
-rw-r--r--include/test/__meta__.h14
-rw-r--r--include/test/lib/color.h17
2 files changed, 31 insertions, 0 deletions
diff --git a/include/test/__meta__.h b/include/test/__meta__.h
new file mode 100644
index 0000000..05a202f
--- /dev/null
+++ b/include/test/__meta__.h
@@ -0,0 +1,14 @@
+#ifndef INC_TEST___META___H
+#define INC_TEST___META___H
+
+#include <lib/bool.h>
+#include <stdio.h>
+
+#define _TEST_PASS(s,n) fprintf(stderr, "%s/%02X: \x1b[92mPASS\x1b[0m\n", s, ++n)
+#define _TEST_FAIL(s,n) fprintf(stderr, "%s/%02X: \x1b[91mFAIL\x1b[0m\n", s, ++n)
+
+#ifndef _TEST_RESULT
+#define _TEST_RESULT(docstring,result,n,n_success) if (!result) {_TEST_FAIL(docstring, n);} else {_TEST_PASS(docstring,n);n_success++;}
+#endif
+
+#endif
diff --git a/include/test/lib/color.h b/include/test/lib/color.h
new file mode 100644
index 0000000..835cb0a
--- /dev/null
+++ b/include/test/lib/color.h
@@ -0,0 +1,17 @@
+#ifndef INC_TEST_LIB_COLOR_H
+#define INC_TEST_LIB_COLOR_H
+
+#include <test/__meta__.h>
+#ifndef TEST_RESULT
+#define TEST_RESULT(result,n,n_success) _TEST_RESULT("LIB/COLOR",result,n,n_success)
+#endif
+
+#include <lib/color.h>
+
+bool_t test_color_zero(uint8_t* color1, size_t channels, bool_t result);
+bool_t test_color_equal(uint8_t* color1, uint8_t* color2, size_t channels, bool_t result);
+
+// Meta test function
+bool_t TEST_lib_color();
+
+#endif