You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.7 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. #include "../src/convert_time.h"
  2. #include "unity.h"
  3. #include "limits.h"
  4. void setUp(void) {
  5. // set stuff up here
  6. }
  7. void tearDown(void) {
  8. // clean stuff up here
  9. }
  10. void test_convert_time_sectomin(void){
  11. double expectedResult = 1.0;
  12. double result;
  13. result = converter_sec_to_min(60.0);
  14. TEST_ASSERT_EQUAL_DOUBLE(expectedResult, result);
  15. }
  16. void test_convert_time_mintosec(void){
  17. double expectedResult = 60.0;
  18. double result;
  19. result = converter_min_to_sec(1.0);
  20. TEST_ASSERT_EQUAL_DOUBLE(expectedResult, result);
  21. }
  22. void test_convert_time_hourtomin(void){
  23. double expectedResult = 60.0;
  24. double result;
  25. result = converter_hour_to_min(1.0);
  26. TEST_ASSERT_EQUAL_DOUBLE(expectedResult, result);
  27. }
  28. void test_convert_time_mintohour(void){
  29. double expectedResult = 1.0;
  30. double result;
  31. result = converter_min_to_hour(60.0);
  32. TEST_ASSERT_EQUAL_DOUBLE(expectedResult, result);
  33. }
  34. void test_convert_time_hourinsec(void){
  35. double expectedResult = 3600.0;
  36. double result;
  37. result = converter_hour_in_sec(1.0);
  38. TEST_ASSERT_EQUAL_DOUBLE(expectedResult, result);
  39. }
  40. void test_convert_time_sectohour(void){
  41. double expectedResult = 1.0;
  42. double result;
  43. result = converter_sec_in_hour(3600.0);
  44. TEST_ASSERT_EQUAL_DOUBLE(expectedResult, result);
  45. }
  46. void test_convert_time_daysinyears(void){
  47. double expectedResult = 1.0;
  48. double result;
  49. result = converter_days_to_years(365.0);
  50. TEST_ASSERT_EQUAL_DOUBLE(expectedResult, result);
  51. }
  52. void test_convert_time_yearsindays(void){
  53. double expectedResult = 365.0;
  54. double result;
  55. result = converter_years_to_days(1.0);
  56. TEST_ASSERT_EQUAL_DOUBLE(expectedResult, result);
  57. }