diff options
Diffstat (limited to 'test_temperature.c')
| -rw-r--r-- | test_temperature.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test_temperature.c b/test_temperature.c new file mode 100644 index 0000000..e7a6e17 --- /dev/null +++ b/test_temperature.c @@ -0,0 +1,45 @@ +#include <assert.h> +#include <stdio.h> + +#include "test.h" +#include "unit.h" + +void +test_kelvin(void) { + test(kelvin(123.456), 123.456); +} + +void +test_celsius(void) { + test(celsius(123.456), 396.606); +} + +void +test_fahrenheit(void) { + test(fahrenheit(123.456), 323.9588889); +} + +void +test_rankine(void) { + test(rankine(123.456), 68.5866667); +} + +void +test_as_kelvin(void) { + test(as_kelvin(kelvin(123.456)), 123.456); +} + +void +test_as_celsius(void) { + test(as_celsius(celsius(123.456)), 123.456); +} + +void +test_as_fahrenheit(void) { + test(as_fahrenheit(fahrenheit(123.456)), 123.456); +} + +void +test_as_rankine(void) { + test(as_rankine(rankine(123.456)), 123.456); +} |