diff --git a/build/test/cache/test_exp2.c b/build/test/cache/test_exp2.c new file mode 100644 index 0000000..d2d8c6e --- /dev/null +++ b/build/test/cache/test_exp2.c @@ -0,0 +1,51 @@ +#include "src/main/c/Calculator/calculator.h" +#include "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" + + + + + + + void setUp(void){ + + + + } + + void tearDown(void){ + + } + + + + + + void test_fmin(void){ + + + + double num1 =1; + + double num2 = 8; + + double result; + + double min = fmin(1,8); + + + + + + result = min; + + + + + + UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(24), UNITY_DISPLAY_STYLE_INT); + + } diff --git a/build/test/cache/test_fmin.c b/build/test/cache/test_fmin.c new file mode 100644 index 0000000..0e24187 --- /dev/null +++ b/build/test/cache/test_fmin.c @@ -0,0 +1,49 @@ +#include "src/main/c/Calculator/calculator.h" +#include "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" + + + + + + + void setUp(void){ + + + + } + + void tearDown(void){ + + } + + + + + + void test_fmin(void){ + + + + double num1; + + double num2; + + double result = fmin(1,16); + + + + + + return result; + + + + + + UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(23), UNITY_DISPLAY_STYLE_INT); + + } diff --git a/build/test/dependencies/test_exp2.d b/build/test/dependencies/test_exp2.d new file mode 100644 index 0000000..c1106c6 --- /dev/null +++ b/build/test/dependencies/test_exp2.d @@ -0,0 +1,4 @@ +build/test/out/c/test_exp2.o: test/Calculator/test_exp2.c \ + /var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ + /var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \ + src/main/c/Calculator/calculator.h diff --git a/build/test/dependencies/test_exp2_runner.d b/build/test/dependencies/test_exp2_runner.d new file mode 100644 index 0000000..898af76 --- /dev/null +++ b/build/test/dependencies/test_exp2_runner.d @@ -0,0 +1,4 @@ +build/test/out/c/test_exp2_runner.o: \ + build/test/runners/test_exp2_runner.c \ + /var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ + /var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h diff --git a/build/test/dependencies/test_fmin.d b/build/test/dependencies/test_fmin.d new file mode 100644 index 0000000..b8dafae --- /dev/null +++ b/build/test/dependencies/test_fmin.d @@ -0,0 +1,4 @@ +build/test/out/c/test_fmin.o: test/Calculator/test_fmin.c \ + /var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ + /var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \ + src/main/c/Calculator/calculator.h diff --git a/build/test/dependencies/test_fmin_runner.d b/build/test/dependencies/test_fmin_runner.d new file mode 100644 index 0000000..e674172 --- /dev/null +++ b/build/test/dependencies/test_fmin_runner.d @@ -0,0 +1,4 @@ +build/test/out/c/test_fmin_runner.o: \ + build/test/runners/test_fmin_runner.c \ + /var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ + /var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h diff --git a/build/test/out/c/calculator.o b/build/test/out/c/calculator.o index 81bccbb..ca1b284 100644 Binary files a/build/test/out/c/calculator.o and b/build/test/out/c/calculator.o differ diff --git a/build/test/out/c/test_exp2.o b/build/test/out/c/test_exp2.o new file mode 100644 index 0000000..d29efbc Binary files /dev/null and b/build/test/out/c/test_exp2.o differ diff --git a/build/test/out/c/test_exp2_runner.o b/build/test/out/c/test_exp2_runner.o new file mode 100644 index 0000000..e2f3c24 Binary files /dev/null and b/build/test/out/c/test_exp2_runner.o differ diff --git a/build/test/out/c/test_fmin.o b/build/test/out/c/test_fmin.o new file mode 100644 index 0000000..a3b725f Binary files /dev/null and b/build/test/out/c/test_fmin.o differ diff --git a/build/test/out/c/test_fmin_runner.o b/build/test/out/c/test_fmin_runner.o new file mode 100644 index 0000000..d2f9312 Binary files /dev/null and b/build/test/out/c/test_fmin_runner.o differ diff --git a/build/test/out/test_cbrt.out b/build/test/out/test_cbrt.out index c69a12b..58d2490 100755 Binary files a/build/test/out/test_cbrt.out and b/build/test/out/test_cbrt.out differ diff --git a/build/test/out/test_ceil.out b/build/test/out/test_ceil.out index 80995b2..12a55be 100755 Binary files a/build/test/out/test_ceil.out and b/build/test/out/test_ceil.out differ diff --git a/build/test/out/test_divide.out b/build/test/out/test_divide.out index 895a8c9..bb50b6e 100755 Binary files a/build/test/out/test_divide.out and b/build/test/out/test_divide.out differ diff --git a/build/test/out/test_exp.out b/build/test/out/test_exp.out index ea71135..7263b71 100755 Binary files a/build/test/out/test_exp.out and b/build/test/out/test_exp.out differ diff --git a/build/test/out/test_exp2.out b/build/test/out/test_exp2.out new file mode 100755 index 0000000..cdc55af Binary files /dev/null and b/build/test/out/test_exp2.out differ diff --git a/build/test/out/test_factorial.out b/build/test/out/test_factorial.out index 9e9e8b3..dd3debf 100755 Binary files a/build/test/out/test_factorial.out and b/build/test/out/test_factorial.out differ diff --git a/build/test/out/test_floor.out b/build/test/out/test_floor.out index 7db79b6..a74209f 100755 Binary files a/build/test/out/test_floor.out and b/build/test/out/test_floor.out differ diff --git a/build/test/out/test_fmax.out b/build/test/out/test_fmax.out index 942e627..5ce749e 100755 Binary files a/build/test/out/test_fmax.out and b/build/test/out/test_fmax.out differ diff --git a/build/test/out/test_fmin.out b/build/test/out/test_fmin.out new file mode 100755 index 0000000..b3b888d Binary files /dev/null and b/build/test/out/test_fmin.out differ diff --git a/build/test/out/test_log.out b/build/test/out/test_log.out index 28be84a..90fef5a 100755 Binary files a/build/test/out/test_log.out and b/build/test/out/test_log.out differ diff --git a/build/test/out/test_log10.out b/build/test/out/test_log10.out index b959e2a..114d848 100755 Binary files a/build/test/out/test_log10.out and b/build/test/out/test_log10.out differ diff --git a/build/test/out/test_mod.out b/build/test/out/test_mod.out index 1a310eb..f77940a 100755 Binary files a/build/test/out/test_mod.out and b/build/test/out/test_mod.out differ diff --git a/build/test/out/test_pow.out b/build/test/out/test_pow.out index eb1e5b2..aba391d 100755 Binary files a/build/test/out/test_pow.out and b/build/test/out/test_pow.out differ diff --git a/build/test/out/test_round.out b/build/test/out/test_round.out index b86de40..8c1a33f 100755 Binary files a/build/test/out/test_round.out and b/build/test/out/test_round.out differ diff --git a/build/test/out/test_sin.out b/build/test/out/test_sin.out index c9d94d2..fb70f0d 100755 Binary files a/build/test/out/test_sin.out and b/build/test/out/test_sin.out differ diff --git a/build/test/out/test_sqrt.out b/build/test/out/test_sqrt.out index 92d998e..35fd11f 100755 Binary files a/build/test/out/test_sqrt.out and b/build/test/out/test_sqrt.out differ diff --git a/build/test/out/test_subtract.out b/build/test/out/test_subtract.out index 332fb55..e4e3173 100755 Binary files a/build/test/out/test_subtract.out and b/build/test/out/test_subtract.out differ diff --git a/build/test/preprocess/files/test_exp2.c b/build/test/preprocess/files/test_exp2.c new file mode 100644 index 0000000..d2d8c6e --- /dev/null +++ b/build/test/preprocess/files/test_exp2.c @@ -0,0 +1,51 @@ +#include "src/main/c/Calculator/calculator.h" +#include "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" + + + + + + + void setUp(void){ + + + + } + + void tearDown(void){ + + } + + + + + + void test_fmin(void){ + + + + double num1 =1; + + double num2 = 8; + + double result; + + double min = fmin(1,8); + + + + + + result = min; + + + + + + UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(24), UNITY_DISPLAY_STYLE_INT); + + } diff --git a/build/test/preprocess/files/test_fmin.c b/build/test/preprocess/files/test_fmin.c new file mode 100644 index 0000000..0e24187 --- /dev/null +++ b/build/test/preprocess/files/test_fmin.c @@ -0,0 +1,49 @@ +#include "src/main/c/Calculator/calculator.h" +#include "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" + + + + + + + void setUp(void){ + + + + } + + void tearDown(void){ + + } + + + + + + void test_fmin(void){ + + + + double num1; + + double num2; + + double result = fmin(1,16); + + + + + + return result; + + + + + + UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(23), UNITY_DISPLAY_STYLE_INT); + + } diff --git a/build/test/preprocess/includes/test_exp2.c b/build/test/preprocess/includes/test_exp2.c new file mode 100644 index 0000000..f2efae7 --- /dev/null +++ b/build/test/preprocess/includes/test_exp2.c @@ -0,0 +1,3 @@ +--- +- "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" +- src/main/c/Calculator/calculator.h diff --git a/build/test/preprocess/includes/test_fmin.c b/build/test/preprocess/includes/test_fmin.c new file mode 100644 index 0000000..f2efae7 --- /dev/null +++ b/build/test/preprocess/includes/test_fmin.c @@ -0,0 +1,3 @@ +--- +- "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" +- src/main/c/Calculator/calculator.h diff --git a/build/test/results/test_add.pass b/build/test/results/test_add.pass index f064217..78e4487 100644 --- a/build/test/results/test_add.pass +++ b/build/test/results/test_add.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.0031575530010741204 +:time: 0.00310718099353835 diff --git a/build/test/results/test_cbrt.pass b/build/test/results/test_cbrt.pass index 1d1333b..2ca262e 100644 --- a/build/test/results/test_cbrt.pass +++ b/build/test/results/test_cbrt.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006589814991457388 +:time: 0.0032013720192480832 diff --git a/build/test/results/test_ceil.pass b/build/test/results/test_ceil.pass index 424dca2..169404a 100644 --- a/build/test/results/test_ceil.pass +++ b/build/test/results/test_ceil.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.00605196098331362 +:time: 0.0032484499970450997 diff --git a/build/test/results/test_divide.pass b/build/test/results/test_divide.pass index e42d52d..b2acd89 100644 --- a/build/test/results/test_divide.pass +++ b/build/test/results/test_divide.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006208898994373158 +:time: 0.0031690610048826784 diff --git a/build/test/results/test_exp.pass b/build/test/results/test_exp.pass index 9da12f9..1ed6ad8 100644 --- a/build/test/results/test_exp.pass +++ b/build/test/results/test_exp.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006314277008641511 +:time: 0.003156043996568769 diff --git a/build/test/results/test_exp2.pass b/build/test/results/test_exp2.pass new file mode 100644 index 0000000..5e7a8a7 --- /dev/null +++ b/build/test/results/test_exp2.pass @@ -0,0 +1,18 @@ +--- +:source: + :path: test/Calculator + :file: test_exp2.c +:successes: +- :test: test_fmin + :line: 13 + :message: '' + :unity_test_time: 0 +:failures: [] +:ignores: [] +:counts: + :total: 1 + :passed: 1 + :failed: 0 + :ignored: 0 +:stdout: [] +:time: 0.006819645990617573 diff --git a/build/test/results/test_factorial.pass b/build/test/results/test_factorial.pass index 0b746a8..0498fc9 100644 --- a/build/test/results/test_factorial.pass +++ b/build/test/results/test_factorial.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006333274010103196 +:time: 0.006395308009814471 diff --git a/build/test/results/test_floor.pass b/build/test/results/test_floor.pass index 73ac713..72fcb85 100644 --- a/build/test/results/test_floor.pass +++ b/build/test/results/test_floor.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006300724984612316 +:time: 0.0063242810138035566 diff --git a/build/test/results/test_fmax.pass b/build/test/results/test_fmax.pass index 1633b0c..189c8c6 100644 --- a/build/test/results/test_fmax.pass +++ b/build/test/results/test_fmax.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006286512012593448 +:time: 0.006218630995135754 diff --git a/build/test/results/test_fmin.pass b/build/test/results/test_fmin.pass new file mode 100644 index 0000000..78d377f --- /dev/null +++ b/build/test/results/test_fmin.pass @@ -0,0 +1,18 @@ +--- +:source: + :path: test/Calculator + :file: test_fmin.c +:successes: +- :test: test_fmin + :line: 13 + :message: '' + :unity_test_time: 0 +:failures: [] +:ignores: [] +:counts: + :total: 1 + :passed: 1 + :failed: 0 + :ignored: 0 +:stdout: [] +:time: 0.006324283021967858 diff --git a/build/test/results/test_log.pass b/build/test/results/test_log.pass index 7a917de..7b04c5c 100644 --- a/build/test/results/test_log.pass +++ b/build/test/results/test_log.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.003080766007769853 +:time: 0.006288689997745678 diff --git a/build/test/results/test_log10.pass b/build/test/results/test_log10.pass index 6a18a68..1fe0a8c 100644 --- a/build/test/results/test_log10.pass +++ b/build/test/results/test_log10.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006343023007502779 +:time: 0.006322506000287831 diff --git a/build/test/results/test_mod.pass b/build/test/results/test_mod.pass index 133966a..7ad2223 100644 --- a/build/test/results/test_mod.pass +++ b/build/test/results/test_mod.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006334662000881508 +:time: 0.006345372006762773 diff --git a/build/test/results/test_multiply.pass b/build/test/results/test_multiply.pass index abb7ff1..0826441 100644 --- a/build/test/results/test_multiply.pass +++ b/build/test/results/test_multiply.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.004287940013455227 +:time: 0.004285867005819455 diff --git a/build/test/results/test_pow.pass b/build/test/results/test_pow.pass index d7a62cd..428e5e1 100644 --- a/build/test/results/test_pow.pass +++ b/build/test/results/test_pow.pass @@ -19,4 +19,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006217798014404252 +:time: 0.006154242000775412 diff --git a/build/test/results/test_round.pass b/build/test/results/test_round.pass index 8c39de6..dfc1609 100644 --- a/build/test/results/test_round.pass +++ b/build/test/results/test_round.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006286452000495046 +:time: 0.006424476014217362 diff --git a/build/test/results/test_sin.pass b/build/test/results/test_sin.pass index 61f7899..3e750e8 100644 --- a/build/test/results/test_sin.pass +++ b/build/test/results/test_sin.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006029690994182602 +:time: 0.0063063729903660715 diff --git a/build/test/results/test_sqrt.pass b/build/test/results/test_sqrt.pass index b1163b9..4045871 100644 --- a/build/test/results/test_sqrt.pass +++ b/build/test/results/test_sqrt.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006369120994349942 +:time: 0.006311776989605278 diff --git a/build/test/results/test_subtract.pass b/build/test/results/test_subtract.pass index cf2265a..5e1d3b4 100644 --- a/build/test/results/test_subtract.pass +++ b/build/test/results/test_subtract.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.006361763982567936 +:time: 0.006199363007908687 diff --git a/build/test/runners/test_exp2_runner.c b/build/test/runners/test_exp2_runner.c new file mode 100644 index 0000000..50d9bd7 --- /dev/null +++ b/build/test/runners/test_exp2_runner.c @@ -0,0 +1,81 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +/*=======Automagically Detected Files To Include=====*/ +#include "unity.h" + +int GlobalExpectCount; +int GlobalVerifyOrder; +char* GlobalOrderError; + +/*=======External Functions This Runner Calls=====*/ +extern void setUp(void); +extern void tearDown(void); +extern void test_fmin(void); + + +/*=======Mock Management=====*/ +static void CMock_Init(void) +{ + GlobalExpectCount = 0; + GlobalVerifyOrder = 0; + GlobalOrderError = NULL; +} +static void CMock_Verify(void) +{ +} +static void CMock_Destroy(void) +{ +} + +/*=======Test Reset Options=====*/ +void resetTest(void); +void resetTest(void) +{ + tearDown(); + CMock_Verify(); + CMock_Destroy(); + CMock_Init(); + setUp(); +} +void verifyTest(void); +void verifyTest(void) +{ + CMock_Verify(); +} + +/*=======Test Runner Used To Run Each Test=====*/ +static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num) +{ + Unity.CurrentTestName = name; + Unity.CurrentTestLineNumber = line_num; +#ifdef UNITY_USE_COMMAND_LINE_ARGS + if (!UnityTestMatches()) + return; +#endif + Unity.NumberOfTests++; + UNITY_CLR_DETAILS(); + UNITY_EXEC_TIME_START(); + CMock_Init(); + if (TEST_PROTECT()) + { + setUp(); + func(); + } + if (TEST_PROTECT()) + { + tearDown(); + CMock_Verify(); + } + CMock_Destroy(); + UNITY_EXEC_TIME_STOP(); + UnityConcludeTest(); +} + +/*=======MAIN=====*/ +int main(void) +{ + UnityBegin("test_exp2.c"); + run_test(test_fmin, "test_fmin", 13); + + return UnityEnd(); +} diff --git a/build/test/runners/test_fmin_runner.c b/build/test/runners/test_fmin_runner.c new file mode 100644 index 0000000..bed6d44 --- /dev/null +++ b/build/test/runners/test_fmin_runner.c @@ -0,0 +1,81 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +/*=======Automagically Detected Files To Include=====*/ +#include "unity.h" + +int GlobalExpectCount; +int GlobalVerifyOrder; +char* GlobalOrderError; + +/*=======External Functions This Runner Calls=====*/ +extern void setUp(void); +extern void tearDown(void); +extern void test_fmin(void); + + +/*=======Mock Management=====*/ +static void CMock_Init(void) +{ + GlobalExpectCount = 0; + GlobalVerifyOrder = 0; + GlobalOrderError = NULL; +} +static void CMock_Verify(void) +{ +} +static void CMock_Destroy(void) +{ +} + +/*=======Test Reset Options=====*/ +void resetTest(void); +void resetTest(void) +{ + tearDown(); + CMock_Verify(); + CMock_Destroy(); + CMock_Init(); + setUp(); +} +void verifyTest(void); +void verifyTest(void) +{ + CMock_Verify(); +} + +/*=======Test Runner Used To Run Each Test=====*/ +static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num) +{ + Unity.CurrentTestName = name; + Unity.CurrentTestLineNumber = line_num; +#ifdef UNITY_USE_COMMAND_LINE_ARGS + if (!UnityTestMatches()) + return; +#endif + Unity.NumberOfTests++; + UNITY_CLR_DETAILS(); + UNITY_EXEC_TIME_START(); + CMock_Init(); + if (TEST_PROTECT()) + { + setUp(); + func(); + } + if (TEST_PROTECT()) + { + tearDown(); + CMock_Verify(); + } + CMock_Destroy(); + UNITY_EXEC_TIME_STOP(); + UnityConcludeTest(); +} + +/*=======MAIN=====*/ +int main(void) +{ + UnityBegin("test_fmin.c"); + run_test(test_fmin, "test_fmin", 13); + + return UnityEnd(); +} diff --git a/src/main/c/Calculator/calculator.c b/src/main/c/Calculator/calculator.c index a92d693..43a22a2 100644 --- a/src/main/c/Calculator/calculator.c +++ b/src/main/c/Calculator/calculator.c @@ -26,8 +26,8 @@ double floor(double num1); double round(double num1); double fmax(double num1,double num2); double log10(double num1); -//double exp2(double num1); - +double exp2(double num1); +double fmin(double num1, double num2); int calculator() { int choice; double num1, num2, result; @@ -92,8 +92,8 @@ double log10(double num1); printf("23. Round\n"); printf("24. fmaximum"); printf("25. base 10 logarithm"); -// printf("26. 2 raise to the power"); -// printf("27 trunc"); + printf("26. 2 raise to the power"); + printf("27. fminimum"); printf("28. Exit\n"); } double performOperation(int choice, double num1, double num2) { @@ -149,10 +149,10 @@ double log10(double num1); return 0; fmax(num1,num2); case 25: return 0; log10(num1); -// case 26: -// return 0; exp2(num1); -// case 27: -// return 0; trunc(num1); + case 26: + return 0; exp2(num1); + case 27: + return 0; fmin(num1,num2); default: return 0.0; } @@ -253,13 +253,13 @@ double fmax(double num1 , double num2){ double log10(double num1){ double result = num1; return result; -}/* -double log10(double num1){ +} +double exp2(double num1){ double result = num1; return result; } -double trunc(double num1){ - double result = num1; - return result; +double fmin(double num1,double num2){ + double minimum = fmin(num1,num2); + return minimum; } -*/ + diff --git a/src/main/c/Calculator/calculator.h b/src/main/c/Calculator/calculator.h index 35c9473..6592dda 100644 --- a/src/main/c/Calculator/calculator.h +++ b/src/main/c/Calculator/calculator.h @@ -18,4 +18,6 @@ double floor(double num1); double round(double num1); double fmax(double num1, double num2); double log10(double num1); +double exp2(double num1); +double fmin(double num1, double num2); #endif diff --git a/test/Calculator/test_exp2.c b/test/Calculator/test_exp2.c new file mode 100644 index 0000000..358a014 --- /dev/null +++ b/test/Calculator/test_exp2.c @@ -0,0 +1,27 @@ + #ifdef TEST + #include "unity.h" + #include "calculator.h" + + + void setUp(void){ + //Wenn Funktion Vorraussetzungen braucht + } + void tearDown(void){ + } + + + void test_fmin(void){ + /* arrange */ + double num1 =1; + double num2 = 8; + double result; + double min = fmin(1,8); + + /* act */ + result = min; + + /* assert */ + TEST_ASSERT_EQUAL_INT(1,result);//fmin(1,8)=1 + } + + #endif // TEST diff --git a/test/Calculator/test_fmin.c b/test/Calculator/test_fmin.c new file mode 100644 index 0000000..9f56524 --- /dev/null +++ b/test/Calculator/test_fmin.c @@ -0,0 +1,26 @@ + #ifdef TEST + #include "unity.h" + #include "calculator.h" + + + void setUp(void){ + //Wenn Funktion Vorraussetzungen braucht + } + void tearDown(void){ + } + + + void test_fmin(void){ + /* arrange */ + double num1; + double num2; + double result = fmin(1,16); + + /* act */ + return result; + + /* assert */ + TEST_ASSERT_EQUAL_INT(1, result);// fmin(1,16); + } + + #endif // TEST