Browse Source
Merge branch 'develop' into 'main'
Merge branch 'develop' into 'main'
develop in main See merge request fdai7812/theadmirals!3main
fdai7812
11 months ago
9 changed files with 103 additions and 32 deletions
-
4src/arithmeticAddition.c
-
6src/arithmeticSubtraction.c
-
12src/convert_kg_to_ton.h
-
20src/convert_time.c
-
8src/trigonometricFunctions.c
-
21test/test_arithmeticAddition.c
-
21test/test_arithmeticDivision.c
-
39test/test_inputHandler.c
@ -1,19 +1,7 @@ |
|||
|
|||
#ifndef THEADMIRALS_CONVERT_KG_TO_TON_H |
|||
#define THEADMIRALS_CONVERT_KG_TO_TON_H |
|||
|
|||
|
|||
|
|||
|
|||
// Convert kilograms to tons |
|||
// Parameters: |
|||
// kilograms: weight in kilograms |
|||
// Returns: |
|||
// The equivalent weight in tons |
|||
|
|||
double kg_to_tons(double kilograms); |
|||
|
|||
|
|||
|
|||
|
|||
#endif //THEADMIRALS_CONVERT_KG_TO_TON_H |
@ -0,0 +1,39 @@ |
|||
#include "../src/inputHandler.h" |
|||
#include "unity.h" |
|||
|
|||
void setUp(void) { |
|||
// set stuff up here |
|||
} |
|||
|
|||
void tearDown(void) { |
|||
// clean stuff up here |
|||
} |
|||
|
|||
|
|||
void test_inputHandler_returntwoforinputminus(void) { |
|||
int expectedResult = 2; |
|||
int result; |
|||
result = getOperationIdBySymbol('-'); |
|||
TEST_ASSERT_EQUAL_INT(expectedResult, result); |
|||
} |
|||
|
|||
void test_inputHandler_returnoneforinputplus(void) { |
|||
int expectedResult = 1; |
|||
int result; |
|||
result = getOperationIdBySymbol('+'); |
|||
TEST_ASSERT_EQUAL_INT(expectedResult, result); |
|||
} |
|||
|
|||
void test_inputHandler_returnzeroforinvalidinput(void) { |
|||
int expectedResult = 0; |
|||
int result; |
|||
result = isOperationIdValid(0); |
|||
TEST_ASSERT_EQUAL_INT(expectedResult, result); |
|||
} |
|||
|
|||
void test_inputHandler_returnoneifinputtoobig(void) { |
|||
int expectedResult = 1; |
|||
int result; |
|||
result = isNumberTooBig(300); |
|||
TEST_ASSERT_EQUAL_INT(expectedResult, result); |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue