|
@ -4,6 +4,11 @@ |
|
|
|
|
|
|
|
|
#include "calculatorMultiply.h" |
|
|
#include "calculatorMultiply.h" |
|
|
|
|
|
|
|
|
|
|
|
// Note: |
|
|
|
|
|
/* This Function may or may not be implemented in actual program, even if it is merged to the main branch. |
|
|
|
|
|
If it is temporarily not included in the main Program, then this has a role in future Development of the Project */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setUp(void) |
|
|
void setUp(void) |
|
|
{ |
|
|
{ |
|
|
} |
|
|
} |
|
@ -14,102 +19,102 @@ void tearDown(void) |
|
|
|
|
|
|
|
|
void test1_calculatorMultiply(void) |
|
|
void test1_calculatorMultiply(void) |
|
|
{ |
|
|
{ |
|
|
float p, q, a, e; |
|
|
|
|
|
p = 26.24; |
|
|
|
|
|
q = 23.22; |
|
|
|
|
|
a = calculatorMultiply(p, q); |
|
|
|
|
|
e = p * q; |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(e, a); |
|
|
|
|
|
|
|
|
float num1, num2, actual ,expected; //Arrange |
|
|
|
|
|
num1 = 26.24; |
|
|
|
|
|
num2 = 23.22; |
|
|
|
|
|
expected = num1 * num2; |
|
|
|
|
|
actual = calculatorMultiply(num1, num2); //Act |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test2_calculatorMultiply(void) |
|
|
void test2_calculatorMultiply(void) |
|
|
{ |
|
|
{ |
|
|
float p, q, a, e; |
|
|
|
|
|
p = 56.24; |
|
|
|
|
|
q = 233.22; |
|
|
|
|
|
a = calculatorMultiply(p, q); |
|
|
|
|
|
e = p * q; |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(e, a); |
|
|
|
|
|
|
|
|
float num1, num2, actual ,expected; //Arrange |
|
|
|
|
|
num1 = 56.24; |
|
|
|
|
|
num2 = 233.22; |
|
|
|
|
|
expected = num1 * num2; |
|
|
|
|
|
actual = calculatorMultiply(num1, num2); //Act |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test3_calculatorMultiply(void) |
|
|
void test3_calculatorMultiply(void) |
|
|
{ |
|
|
{ |
|
|
float p, q, a, e; |
|
|
|
|
|
p = 1226.24; |
|
|
|
|
|
q = 323.22; |
|
|
|
|
|
a = calculatorMultiply(p, q); |
|
|
|
|
|
e = p * q; |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(e, a); |
|
|
|
|
|
|
|
|
float num1, num2, actual ,expected; //Arrange |
|
|
|
|
|
num1 = 1226.24; |
|
|
|
|
|
num2 = 323.22; |
|
|
|
|
|
expected = num1 * num2; |
|
|
|
|
|
actual = calculatorMultiply(num1, num2); //Act |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test4_calculatorMultiply(void) |
|
|
void test4_calculatorMultiply(void) |
|
|
{ |
|
|
{ |
|
|
float p, q, a, e; |
|
|
|
|
|
p = 2623.24; |
|
|
|
|
|
q = 2323.22; |
|
|
|
|
|
a = calculatorMultiply(p, q); |
|
|
|
|
|
e = p * q; |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(e, a); |
|
|
|
|
|
|
|
|
float num1, num2, actual ,expected; //Arrange |
|
|
|
|
|
num1 = 2623.24; |
|
|
|
|
|
num2 = 2323.22; |
|
|
|
|
|
expected = num1 * num2; |
|
|
|
|
|
actual = calculatorMultiply(num1, num2); //Act |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test5_calculatorMultiply(void) |
|
|
void test5_calculatorMultiply(void) |
|
|
{ |
|
|
{ |
|
|
float p, q, a, e; |
|
|
|
|
|
p = 2435.24; |
|
|
|
|
|
q = 23423.22; |
|
|
|
|
|
a = calculatorMultiply(p, q); |
|
|
|
|
|
e = p * q; |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(e, a); |
|
|
|
|
|
|
|
|
float num1, num2, actual ,expected; //Arrange |
|
|
|
|
|
num1 = 2435.24; |
|
|
|
|
|
num2 = 23423.22; |
|
|
|
|
|
expected = num1 * num2; |
|
|
|
|
|
actual = calculatorMultiply(num1, num2); //Act |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test6_calculatorMultiply(void) |
|
|
void test6_calculatorMultiply(void) |
|
|
{ |
|
|
{ |
|
|
float p, q, a, e; |
|
|
|
|
|
p = 4534.24; |
|
|
|
|
|
q = 2221.22; |
|
|
|
|
|
a = calculatorMultiply(p, q); |
|
|
|
|
|
e = p * q; |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(e, a); |
|
|
|
|
|
|
|
|
float num1, num2, actual ,expected; //Arrange |
|
|
|
|
|
num1 = 4534.24; |
|
|
|
|
|
num2 = 2221.22; |
|
|
|
|
|
expected = num1 * num2; |
|
|
|
|
|
actual = calculatorMultiply(num1, num2); //Act |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test7_calculatorMultiply(void) |
|
|
void test7_calculatorMultiply(void) |
|
|
{ |
|
|
{ |
|
|
float p, q, a, e; |
|
|
|
|
|
p = 26322.24; |
|
|
|
|
|
q = 2332.222; |
|
|
|
|
|
a = calculatorMultiply(p, q); |
|
|
|
|
|
e = p * q; |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(e, a); |
|
|
|
|
|
|
|
|
float num1, num2, actual ,expected; //Arrange |
|
|
|
|
|
num1 = 26322.24; |
|
|
|
|
|
num2 = 2332.222; |
|
|
|
|
|
expected = num1 * num2; |
|
|
|
|
|
actual = calculatorMultiply(num1, num2); //Act |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test8_calculatorMultiply(void) |
|
|
void test8_calculatorMultiply(void) |
|
|
{ |
|
|
{ |
|
|
float p, q, a, e; |
|
|
|
|
|
p = 26132.24; |
|
|
|
|
|
q = 2331122.222; |
|
|
|
|
|
a = calculatorMultiply(p, q); |
|
|
|
|
|
e = p * q; |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(e, a); |
|
|
|
|
|
|
|
|
float num1, num2, actual ,expected; //Arrange |
|
|
|
|
|
num1 = 26132.24; |
|
|
|
|
|
num2 = 2331122.222; |
|
|
|
|
|
expected = num1 * num2; |
|
|
|
|
|
actual = calculatorMultiply(num1, num2); //Act |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test9_calculatorMultiply(void) |
|
|
void test9_calculatorMultiply(void) |
|
|
{ |
|
|
{ |
|
|
float p, q, a, e; |
|
|
|
|
|
p = 6322.24; |
|
|
|
|
|
q = 21232.2322; |
|
|
|
|
|
a = calculatorMultiply(p, q); |
|
|
|
|
|
e = p * q; |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(e, a); |
|
|
|
|
|
|
|
|
float num1, num2, actual ,expected; //Arrange |
|
|
|
|
|
num1 = 6322.24; |
|
|
|
|
|
num2 = 21232.2322; |
|
|
|
|
|
expected = num1 * num2; |
|
|
|
|
|
actual = calculatorMultiply(num1, num2); //Act |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test10_calculatorMultiply(void) |
|
|
void test10_calculatorMultiply(void) |
|
|
{ |
|
|
{ |
|
|
float p, q, a, e; |
|
|
|
|
|
p = 1234.456; |
|
|
|
|
|
q = 654.4321; |
|
|
|
|
|
a = calculatorMultiply(p, q); |
|
|
|
|
|
e = p * q; |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(e, a); |
|
|
|
|
|
|
|
|
float num1, num2, actual ,expected; //Arrange |
|
|
|
|
|
num1 = 1234.456; |
|
|
|
|
|
num2 = 654.4321; |
|
|
|
|
|
expected = num1 * num2; |
|
|
|
|
|
actual = calculatorMultiply(num1, num2); //Act |
|
|
|
|
|
TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#endif // TEST |
|
|
#endif // TEST |