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.

120 lines
3.3 KiB

  1. #ifdef TEST
  2. #include "unity.h"
  3. #include "../src/calculatorMultiply.c"
  4. // Note:
  5. /* This Function may or may not be implemented in actual program, even if it is merged to the main branch.
  6. If it is temporarily not included in the main Program, then this has a role in future Development of the Project */
  7. void setUp(void)
  8. {
  9. }
  10. void tearDown(void)
  11. {
  12. }
  13. void test1_calculatorMultiply(void)
  14. {
  15. float num1, num2, actual ,expected; //Arrange
  16. num1 = 26.24;
  17. num2 = 23.22;
  18. expected = num1 * num2;
  19. actual = calculatorMultiply(num1, num2); //Act
  20. TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
  21. }
  22. void test2_calculatorMultiply(void)
  23. {
  24. float num1, num2, actual ,expected; //Arrange
  25. num1 = 56.24;
  26. num2 = 233.22;
  27. expected = num1 * num2;
  28. actual = calculatorMultiply(num1, num2); //Act
  29. TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
  30. }
  31. void test3_calculatorMultiply(void)
  32. {
  33. float num1, num2, actual ,expected; //Arrange
  34. num1 = 1226.24;
  35. num2 = 323.22;
  36. expected = num1 * num2;
  37. actual = calculatorMultiply(num1, num2); //Act
  38. TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
  39. }
  40. void test4_calculatorMultiply(void)
  41. {
  42. float num1, num2, actual ,expected; //Arrange
  43. num1 = 2623.24;
  44. num2 = 2323.22;
  45. expected = num1 * num2;
  46. actual = calculatorMultiply(num1, num2); //Act
  47. TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
  48. }
  49. void test5_calculatorMultiply(void)
  50. {
  51. float num1, num2, actual ,expected; //Arrange
  52. num1 = 2435.24;
  53. num2 = 23423.22;
  54. expected = num1 * num2;
  55. actual = calculatorMultiply(num1, num2); //Act
  56. TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
  57. }
  58. void test6_calculatorMultiply(void)
  59. {
  60. float num1, num2, actual ,expected; //Arrange
  61. num1 = 4534.24;
  62. num2 = 2221.22;
  63. expected = num1 * num2;
  64. actual = calculatorMultiply(num1, num2); //Act
  65. TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
  66. }
  67. void test7_calculatorMultiply(void)
  68. {
  69. float num1, num2, actual ,expected; //Arrange
  70. num1 = 26322.24;
  71. num2 = 2332.222;
  72. expected = num1 * num2;
  73. actual = calculatorMultiply(num1, num2); //Act
  74. TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
  75. }
  76. void test8_calculatorMultiply(void)
  77. {
  78. float num1, num2, actual ,expected; //Arrange
  79. num1 = 26132.24;
  80. num2 = 2331122.222;
  81. expected = num1 * num2;
  82. actual = calculatorMultiply(num1, num2); //Act
  83. TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
  84. }
  85. void test9_calculatorMultiply(void)
  86. {
  87. float num1, num2, actual ,expected; //Arrange
  88. num1 = 6322.24;
  89. num2 = 21232.2322;
  90. expected = num1 * num2;
  91. actual = calculatorMultiply(num1, num2); //Act
  92. TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
  93. }
  94. void test10_calculatorMultiply(void)
  95. {
  96. float num1, num2, actual ,expected; //Arrange
  97. num1 = 1234.456;
  98. num2 = 654.4321;
  99. expected = num1 * num2;
  100. actual = calculatorMultiply(num1, num2); //Act
  101. TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
  102. }
  103. #endif // TEST