diff --git a/build/test/cache/test_duellist_spielesammlung_projekt.c b/build/test/cache/test_duellist_spielesammlung_projekt.c index 5502d62..0870ec5 100644 --- a/build/test/cache/test_duellist_spielesammlung_projekt.c +++ b/build/test/cache/test_duellist_spielesammlung_projekt.c @@ -739,3 +739,131 @@ void test_calculate_mines_HeightOne(void) ), (UNITY_UINT)(325), UNITY_DISPLAY_STYLE_INT); } + + + +void test_create_minefield_NegativeDimensions(void) + +{ + + + + int height = -3; + + int width = 4; + + char within = '0'; + + + + + + char** result = create_minefield(height, width, within); + + + + + + do {if ((((result)) == + + ((void *)0) + + )) {} else {UnityFail( (((" Expected NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(339))));}} while(0); + +} + + + +void test_calculate_mines_HeightZero(void) + +{ + + + + int height = 0; + + int width = 0; + + int expected = 0; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(353), UNITY_DISPLAY_STYLE_INT); + +} + + + +void test_calculate_mines_HeightWidthNumber(void) + +{ + + + + int height = 4; + + int width = 6; + + int expected = 6; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(367), UNITY_DISPLAY_STYLE_INT); + +} + + + +void test_calculate_mines_HeightWidthAgan(void) + +{ + + + + int height = 6; + + int width = 6; + + int expected = 9; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(381), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/out/c/test_duellist_spielesammlung_projekt.o b/build/test/out/c/test_duellist_spielesammlung_projekt.o index ea923d5..9e88f1f 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 08ed359..953d272 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 5436455..931e953 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 5502d62..0870ec5 100644 --- a/build/test/preprocess/files/test_duellist_spielesammlung_projekt.c +++ b/build/test/preprocess/files/test_duellist_spielesammlung_projekt.c @@ -739,3 +739,131 @@ void test_calculate_mines_HeightOne(void) ), (UNITY_UINT)(325), UNITY_DISPLAY_STYLE_INT); } + + + +void test_create_minefield_NegativeDimensions(void) + +{ + + + + int height = -3; + + int width = 4; + + char within = '0'; + + + + + + char** result = create_minefield(height, width, within); + + + + + + do {if ((((result)) == + + ((void *)0) + + )) {} else {UnityFail( (((" Expected NULL"))), (UNITY_UINT)((UNITY_UINT)((UNITY_UINT)(339))));}} while(0); + +} + + + +void test_calculate_mines_HeightZero(void) + +{ + + + + int height = 0; + + int width = 0; + + int expected = 0; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(353), UNITY_DISPLAY_STYLE_INT); + +} + + + +void test_calculate_mines_HeightWidthNumber(void) + +{ + + + + int height = 4; + + int width = 6; + + int expected = 6; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(367), UNITY_DISPLAY_STYLE_INT); + +} + + + +void test_calculate_mines_HeightWidthAgan(void) + +{ + + + + int height = 6; + + int width = 6; + + int expected = 9; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(381), 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 2c37905..03dadd2 100644 --- a/build/test/results/test_duellist_spielesammlung_projekt.pass +++ b/build/test/results/test_duellist_spielesammlung_projekt.pass @@ -91,12 +91,28 @@ :line: 314 :message: '' :unity_test_time: 0 +- :test: test_create_minefield_NegativeDimensions + :line: 328 + :message: '' + :unity_test_time: 0 +- :test: test_calculate_mines_HeightZero + :line: 342 + :message: '' + :unity_test_time: 0 +- :test: test_calculate_mines_HeightWidthNumber + :line: 356 + :message: '' + :unity_test_time: 0 +- :test: test_calculate_mines_HeightWidthAgan + :line: 370 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 22 - :passed: 22 + :total: 26 + :passed: 26 :failed: 0 :ignored: 0 :stdout: [] -:time: 0.047360099999878 +:time: 0.0499390999998468 diff --git a/build/test/runners/test_duellist_spielesammlung_projekt_runner.c b/build/test/runners/test_duellist_spielesammlung_projekt_runner.c index de1610d..bbd4739 100644 --- a/build/test/runners/test_duellist_spielesammlung_projekt_runner.c +++ b/build/test/runners/test_duellist_spielesammlung_projekt_runner.c @@ -32,6 +32,10 @@ extern void test_calculate_mines_NormalCase(void); extern void test_end_check_AllUncovered_NoMines(void); extern void test_create_minefield_ValidDimensions(void); extern void test_calculate_mines_HeightOne(void); +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); /*=======Mock Management=====*/ @@ -118,6 +122,10 @@ int main(void) run_test(test_end_check_AllUncovered_NoMines, "test_end_check_AllUncovered_NoMines", 270); run_test(test_create_minefield_ValidDimensions, "test_create_minefield_ValidDimensions", 289); run_test(test_calculate_mines_HeightOne, "test_calculate_mines_HeightOne", 314); + run_test(test_create_minefield_NegativeDimensions, "test_create_minefield_NegativeDimensions", 328); + 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); return UnityEnd(); } diff --git a/src/test/test_duellist_spielesammlung_projekt.c b/src/test/test_duellist_spielesammlung_projekt.c index dec7e3e..11b497f 100644 --- a/src/test/test_duellist_spielesammlung_projekt.c +++ b/src/test/test_duellist_spielesammlung_projekt.c @@ -367,30 +367,18 @@ void test_calculate_mines_HeightWidthNumber(void) TEST_ASSERT_EQUAL_INT(expected, result); } -#endif // TEST - - - - - - - - - - - - - - - - - - - - - - - +void test_calculate_mines_HeightWidthAgan(void) +{ + /* arrange */ + int height = 6; + int width = 6; + int expected = 9; + /* act */ + int result = calculate_mines(height, width); + /* assert */ + TEST_ASSERT_EQUAL_INT(expected, result); +} +#endif // TEST