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
-
2src/convert_M_in_KM.c
-
12src/convert_kg_to_ton.h
-
20src/convert_time.c
-
8src/trigonometricFunctions.c
-
23test/test_arithmeticAddition.c
-
21test/test_arithmeticDivision.c
-
39test/test_inputHandler.c
@ -1,6 +1,6 @@ |
|||
#include "convert_M_in_KM.h" |
|||
|
|||
// convert length for double metre into kilometre |
|||
//convert length for double metre into kilometre |
|||
double meter_to_kilometer(double meter) { |
|||
return meter / 1000.0; |
|||
} |
@ -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