diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-03-01 15:11:35 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-03-01 15:11:35 -0500 |
| commit | 0d05cb75ee3c3d85481fe87ea287c97a439fe47a (patch) | |
| tree | 8603e4ac9d3a58715690643862d27ed769347b8d /test_temperature.c | |
| parent | 47874c2ec00339314e43d282ab2bc906e9c9ac9b (diff) | |
| download | volute-0d05cb75ee3c3d85481fe87ea287c97a439fe47a.zip | |
temperature conversion functions
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); +} |