aboutsummaryrefslogtreecommitdiffstats
path: root/test.h
diff options
context:
space:
mode:
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);