|
@ -1,4 +1,3 @@ |
|
|
|
|
|
|
|
|
#include "unity.h" |
|
|
#include "unity.h" |
|
|
#include "BasicMode.h" |
|
|
#include "BasicMode.h" |
|
|
#include "main_calculator.h" |
|
|
#include "main_calculator.h" |
|
@ -17,17 +16,6 @@ void tearDown(void) |
|
|
|
|
|
|
|
|
void test_addition(void) |
|
|
void test_addition(void) |
|
|
{ |
|
|
{ |
|
|
/* arrange */ |
|
|
|
|
|
char* result; |
|
|
|
|
|
char expected[] = "2\n"; |
|
|
|
|
|
|
|
|
|
|
|
/* act */ |
|
|
|
|
|
result = convert(2); |
|
|
|
|
|
|
|
|
|
|
|
/* assert */ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif // TEST |
|
|
|
|
|
|
|
|
|
|
|
double result = add(1, 2); |
|
|
double result = add(1, 2); |
|
|
TEST_ASSERT_EQUAL(3, result); |
|
|
TEST_ASSERT_EQUAL(3, result); |
|
@ -221,7 +209,7 @@ void test_DecToBin(void) { |
|
|
result = DecToBin(8); |
|
|
result = DecToBin(8); |
|
|
|
|
|
|
|
|
// Assert |
|
|
// Assert |
|
|
TEST_ASSERT_EQUAL_INT64(100, result); |
|
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_INT64(1000 , result); |
|
|
} |
|
|
} |
|
|
void test_BinToDec(void) { |
|
|
void test_BinToDec(void) { |
|
|
// Arrange |
|
|
// Arrange |
|
@ -231,7 +219,7 @@ void test_BinToDec(void) { |
|
|
result = BinToDec(100); |
|
|
result = BinToDec(100); |
|
|
|
|
|
|
|
|
// Assert |
|
|
// Assert |
|
|
TEST_ASSERT_EQUAL_INT64(8, result); |
|
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_INT64(4, result); |
|
|
} |
|
|
} |
|
|
void test_additionbin(void) { |
|
|
void test_additionbin(void) { |
|
|
// Arrange |
|
|
// Arrange |
|
|