aboutsummaryrefslogtreecommitdiffstats
path: root/test.h
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-02-28 15:03:42 -0500
committerSam Anthony <sam@samanthony.xyz>2025-02-28 15:03:42 -0500
commit24f0677b76ba5be7114031f2d6d6746dcb64ce55 (patch)
tree8db568429667f9b6637916267a8ee484e87020a1 /test.h
parent4835ce7a09dc9012539c33b602e581057d945151 (diff)
downloadvolute-24f0677b76ba5be7114031f2d6d6746dcb64ce55.zip
refactor tests
Diffstat (limited to 'test.h')
-rw-r--r--test.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/test.h b/test.h
new file mode 100644
index 0000000..033a955
--- /dev/null
+++ b/test.h
@@ -0,0 +1,25 @@
+#define EPSILON (1e-7)
+
+#define test(got, want) { \
+ if (got < want-EPSILON || got > want+EPSILON) { \
+ fprintf(stderr, "got %lf; want %lf\n", got, want); \
+ assert(got == want); \
+ } \
+}
+
+
+void test_rad_per_sec(void);
+void test_deg_per_sec(void);
+void test_rpm(void);
+void test_as_rad_per_sec(void);
+void test_as_deg_per_sec(void);
+void test_as_rpm(void);
+
+void test_cubic_centimetre(void);
+void test_litre(void);
+void test_cubic_metre(void);
+void test_cubic_inch(void);
+void test_as_cubic_centimetre(void);
+void test_as_litre(void);
+void test_as_cubic_metre(void);
+void test_as_cubic_inch(void);