From 24f0677b76ba5be7114031f2d6d6746dcb64ce55 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Fri, 28 Feb 2025 15:03:42 -0500 Subject: refactor tests --- test_unit.c | 106 ------------------------------------------------------------ 1 file changed, 106 deletions(-) delete mode 100644 test_unit.c (limited to 'test_unit.c') diff --git a/test_unit.c b/test_unit.c deleted file mode 100644 index d19d694..0000000 --- a/test_unit.c +++ /dev/null @@ -1,106 +0,0 @@ -#include -#include - -#include "unit.h" - - -#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) { - test(rad_per_sec(123.456), 123.456); -} - -void -test_deg_per_sec(void) { - test(deg_per_sec(123.456), 2.15471367888); -} - -void -test_rpm(void) { - test(rpm(123.456), 12.92828207328); -} - -void -test_as_rad_per_sec(void) { - test(as_rad_per_sec(rad_per_sec(123.456)), 123.456); -} - -void -test_as_deg_per_sec(void) { - test(as_deg_per_sec(deg_per_sec(123.456)), 123.456); -} - -void -test_as_rpm(void) { - test(as_rpm(rpm(123.456)), 123.456); -} - - -void -test_cubic_centimetre(void) { - assert(0); -} - -void -test_litre(void) { - assert(0); -} - -void -test_cubic_metre(void) { - assert(0); -} - -void -test_cubic_inch(void) { - assert(0); -} - -void -test_as_cubic_centimetre(void) { - assert(0); -} - -void -test_as_litre(void) { - assert(0); -} - -void -test_as_cubic_metre(void) { - assert(0); -} - -void -test_as_cubic_inch(void) { - assert(0); -} - - -int -main(void) { - test_rad_per_sec(); - test_deg_per_sec(); - test_rpm(); - test_as_rad_per_sec(); - test_as_deg_per_sec(); - test_as_rpm(); - - test_cubic_centimetre(); - test_litre(); - test_cubic_metre(); - test_cubic_inch(); - test_as_cubic_centimetre(); - test_as_litre(); - test_as_cubic_metre(); - test_as_cubic_inch(); -} -- cgit v1.2.3