Browse Source

Implement sub detected Test for getNumber Function

remotes/origin/Input_Handling
Sophia Weber 11 months ago
parent
commit
4744e965bb
  1. 13
      test/test_inputHandling.c

13
test/test_inputHandling.c

@ -106,4 +106,17 @@ void test_inputHandling_getNumbersAddFormular(void)
TEST_ASSERT_EQUAL_DOUBLE(5.0, formula.inputNumbers[1]); TEST_ASSERT_EQUAL_DOUBLE(5.0, formula.inputNumbers[1]);
TEST_ASSERT_EQUAL_INT(2, formula.arrayLength); TEST_ASSERT_EQUAL_INT(2, formula.arrayLength);
} }
void test_inputHandling_getNumbersSubFormular(void)
{
char* pnt = NULL;
char add[] = "4-5";
formula.functionsType = detectFunctionOperator(add,3);
pnt = getNumbers(add, 3, &formula);
showStruct(&formula);
TEST_ASSERT_NULL(pnt);
TEST_ASSERT_EQUAL_DOUBLE(4.0, formula.inputNumbers[0]);
TEST_ASSERT_EQUAL_DOUBLE(5.0, formula.inputNumbers[1]);
TEST_ASSERT_EQUAL_INT(2, formula.arrayLength);
}
#endif // TEST #endif // TEST
Loading…
Cancel
Save