diff --git a/build/test/cache/test_duellist_spielesammlung_projekt.c b/build/test/cache/test_duellist_spielesammlung_projekt.c index 0870ec5..e0df2e2 100644 --- a/build/test/cache/test_duellist_spielesammlung_projekt.c +++ b/build/test/cache/test_duellist_spielesammlung_projekt.c @@ -867,3 +867,99 @@ void test_calculate_mines_HeightWidthAgan(void) ), (UNITY_UINT)(381), UNITY_DISPLAY_STYLE_INT); } + + + +void test_calculate_mines_HeightWidthRoundUp(void) + +{ + + + + int height = 3; + + int width = 5; + + int expected = 3; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(395), UNITY_DISPLAY_STYLE_INT); + +} + + + +void test_calculate_mines_HeightWidthNoRound(void) + +{ + + + + int height = 9; + + int width = 9; + + int expected = 20; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(409), UNITY_DISPLAY_STYLE_INT); + +} + + + +void test_calculate_mines_HeightWidthFinal(void) + +{ + + + + int height = 7; + + int width = 7; + + int expected = 12; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(423), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/out/c/duellist-spielesammlung-projekt.o b/build/test/out/c/duellist-spielesammlung-projekt.o index c49dce1..92e7243 100644 Binary files a/build/test/out/c/duellist-spielesammlung-projekt.o and b/build/test/out/c/duellist-spielesammlung-projekt.o differ diff --git a/build/test/out/c/test_duellist_spielesammlung_projekt.o b/build/test/out/c/test_duellist_spielesammlung_projekt.o index 9e88f1f..b07ba5a 100644 Binary files a/build/test/out/c/test_duellist_spielesammlung_projekt.o and b/build/test/out/c/test_duellist_spielesammlung_projekt.o differ diff --git a/build/test/out/c/test_duellist_spielesammlung_projekt_runner.o b/build/test/out/c/test_duellist_spielesammlung_projekt_runner.o index 953d272..9fe71df 100644 Binary files a/build/test/out/c/test_duellist_spielesammlung_projekt_runner.o and b/build/test/out/c/test_duellist_spielesammlung_projekt_runner.o differ diff --git a/build/test/out/test_duellist_spielesammlung_projekt.out b/build/test/out/test_duellist_spielesammlung_projekt.out index 5b310fa..6067fa9 100644 Binary files a/build/test/out/test_duellist_spielesammlung_projekt.out and b/build/test/out/test_duellist_spielesammlung_projekt.out differ diff --git a/build/test/preprocess/files/test_duellist_spielesammlung_projekt.c b/build/test/preprocess/files/test_duellist_spielesammlung_projekt.c index 0870ec5..e0df2e2 100644 --- a/build/test/preprocess/files/test_duellist_spielesammlung_projekt.c +++ b/build/test/preprocess/files/test_duellist_spielesammlung_projekt.c @@ -867,3 +867,99 @@ void test_calculate_mines_HeightWidthAgan(void) ), (UNITY_UINT)(381), UNITY_DISPLAY_STYLE_INT); } + + + +void test_calculate_mines_HeightWidthRoundUp(void) + +{ + + + + int height = 3; + + int width = 5; + + int expected = 3; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(395), UNITY_DISPLAY_STYLE_INT); + +} + + + +void test_calculate_mines_HeightWidthNoRound(void) + +{ + + + + int height = 9; + + int width = 9; + + int expected = 20; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(409), UNITY_DISPLAY_STYLE_INT); + +} + + + +void test_calculate_mines_HeightWidthFinal(void) + +{ + + + + int height = 7; + + int width = 7; + + int expected = 12; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(423), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/results/test_duellist_spielesammlung_projekt.pass b/build/test/results/test_duellist_spielesammlung_projekt.pass index 32b3be9..acce313 100644 --- a/build/test/results/test_duellist_spielesammlung_projekt.pass +++ b/build/test/results/test_duellist_spielesammlung_projekt.pass @@ -107,12 +107,24 @@ :line: 370 :message: '' :unity_test_time: 0 +- :test: test_calculate_mines_HeightWidthRoundUp + :line: 384 + :message: '' + :unity_test_time: 0 +- :test: test_calculate_mines_HeightWidthNoRound + :line: 398 + :message: '' + :unity_test_time: 0 +- :test: test_calculate_mines_HeightWidthFinal + :line: 412 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 26 - :passed: 26 + :total: 29 + :passed: 29 :failed: 0 :ignored: 0 :stdout: [] -:time: 0.05030940000051487 +:time: 0.05077199999959703 diff --git a/build/test/runners/test_duellist_spielesammlung_projekt_runner.c b/build/test/runners/test_duellist_spielesammlung_projekt_runner.c index bbd4739..3817293 100644 --- a/build/test/runners/test_duellist_spielesammlung_projekt_runner.c +++ b/build/test/runners/test_duellist_spielesammlung_projekt_runner.c @@ -36,6 +36,9 @@ extern void test_create_minefield_NegativeDimensions(void); extern void test_calculate_mines_HeightZero(void); extern void test_calculate_mines_HeightWidthNumber(void); extern void test_calculate_mines_HeightWidthAgan(void); +extern void test_calculate_mines_HeightWidthRoundUp(void); +extern void test_calculate_mines_HeightWidthNoRound(void); +extern void test_calculate_mines_HeightWidthFinal(void); /*=======Mock Management=====*/ @@ -126,6 +129,9 @@ int main(void) run_test(test_calculate_mines_HeightZero, "test_calculate_mines_HeightZero", 342); run_test(test_calculate_mines_HeightWidthNumber, "test_calculate_mines_HeightWidthNumber", 356); run_test(test_calculate_mines_HeightWidthAgan, "test_calculate_mines_HeightWidthAgan", 370); + run_test(test_calculate_mines_HeightWidthRoundUp, "test_calculate_mines_HeightWidthRoundUp", 384); + run_test(test_calculate_mines_HeightWidthNoRound, "test_calculate_mines_HeightWidthNoRound", 398); + run_test(test_calculate_mines_HeightWidthFinal, "test_calculate_mines_HeightWidthFinal", 412); return UnityEnd(); } diff --git a/src/test/test_duellist_spielesammlung_projekt.c b/src/test/test_duellist_spielesammlung_projekt.c index 11b497f..a0d4547 100644 --- a/src/test/test_duellist_spielesammlung_projekt.c +++ b/src/test/test_duellist_spielesammlung_projekt.c @@ -381,4 +381,45 @@ void test_calculate_mines_HeightWidthAgan(void) TEST_ASSERT_EQUAL_INT(expected, result); } +void test_calculate_mines_HeightWidthRoundUp(void) +{ + /* arrange */ + int height = 3; + int width = 5; + int expected = 3; + + /* act */ + int result = calculate_mines(height, width); + + /* assert */ + TEST_ASSERT_EQUAL_INT(expected, result); +} + +void test_calculate_mines_HeightWidthNoRound(void) +{ + /* arrange */ + int height = 9; + int width = 9; + int expected = 20; + + /* act */ + int result = calculate_mines(height, width); + + /* assert */ + TEST_ASSERT_EQUAL_INT(expected, result); +} + +void test_calculate_mines_HeightWidthFinal(void) +{ + /* arrange */ + int height = 7; + int width = 7; + int expected = 12; + + /* act */ + int result = calculate_mines(height, width); + + /* assert */ + TEST_ASSERT_EQUAL_INT(expected, result); +} #endif // TEST