Browse Source

Fix syntax error in main_calculator.c and test_calculator.c

remotes/origin/kabrel
fdai7782 11 months ago
parent
commit
d1a8cc1a30
  1. 8
      src/main/c/main_calculator.c
  2. 10
      src/test/c/test_calculator.c

8
src/main/c/main_calculator.c

@ -804,7 +804,7 @@ double ConData(double data, int startingUnit, int endingUnit) {
break;
case 4: //1
return;
return data;
break;
case 5: //0.001
@ -964,7 +964,7 @@ double ConClock(double time, int startingUnit, int endingUnit) {
}
else {
return time
return time;
}
break;
@ -1105,7 +1105,7 @@ double ConTime(double time, int startingUnit, int endingUnit) {
break;
case 7: //y
return time / 60 * 24 * 7 * 4 * 12);
return time / (60 * 24 * 7 * 4 * 12);
break;
default:
@ -1296,7 +1296,7 @@ double ConTime(double time, int startingUnit, int endingUnit) {
break;
case 6: //mon
return time * 12);
return time * 12;
break;
case 7: //y

10
src/test/c/test_calculator.c

@ -14,28 +14,28 @@ void tearDown(void)
void test_addition(void)
{
doulbe result = add(1, 2);
double result = add(1, 2);
TEST_ASSERT_EQUAL(3, result);
}
void test_minus(void)
{
doulbe result = minus(3, 1);
double result = minus(3, 1);
TEST_ASSERT_EQUAL(2, result);
}
void test_multiply(void)
{
doulbe result = multiply(1, 2);
double result = multiply(1, 2);
TEST_ASSERT_EQUAL(2, result);
}
void test_divide(void)
{
doulbe result = divide(4, 2);
double result = divide(4, 2);
TEST_ASSERT_EQUAL(2, result);
doulbe result1 = divide(4, 0);
double result1 = divide(4, 0);
TEST_ASSERT_EQUAL(0, result1);
}

Loading…
Cancel
Save