Browse Source

implement unittest for calculatorCube.c

remotes/origin/feature/calculator-cube
fdai7514 2 years ago
parent
commit
95b4763e5b
  1. 1
      build-project.sh
  2. 21
      tests/test_calculatorCube.c

1
build-project.sh

@ -1,4 +1,5 @@
clear
ceedling test:all
cd src/
gcc main.c -o main
./main

21
tests/test_calculatorCube.c

@ -2,7 +2,7 @@
#include "unity.h"
#include "calculatorCube.h"
#include "calculatorCube.c"
void setUp(void)
{
@ -12,9 +12,24 @@ void tearDown(void)
{
}
void test_calculatorCube_NeedToImplement(void)
void test1_calculatorCube(void)
{
TEST_IGNORE_MESSAGE("Need to Implement calculatorCube");
float p, a, e;
p = 5;
a = calculatorCube(p);
e = p * p * p;
TEST_ASSERT_EQUAL_FLOAT(e, a);
}
void test2_calculatorCube(void)
{
float p, a, e;
p = 6;
a = calculatorCube(p);
e = p * p * p;
TEST_ASSERT_EQUAL_FLOAT(e, a);
}
#endif // TEST
Loading…
Cancel
Save