diff --git a/build/test/cache/test_duellist_spielesammlung_projekt.c b/build/test/cache/test_duellist_spielesammlung_projekt.c index 6c11100..6ae7a3f 100644 --- a/build/test/cache/test_duellist_spielesammlung_projekt.c +++ b/build/test/cache/test_duellist_spielesammlung_projekt.c @@ -574,6 +574,80 @@ void test_calculate_mines_WidthOne(void) +void test_calculate_mines_NormalCase(void) + +{ + + + + int height = 5; + + int width = 5; + + int expected = 6; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(267), UNITY_DISPLAY_STYLE_INT); + +} + + + +void test_end_check_AllUncovered_NoMines(void) + +{ + + + + char* minefield[] = { "000", + + "000", + + "000" }; + + char* mines[] = { "000", + + "000", + + "000" }; + + int height = 3; + + int width = 3; + + + + + + int result = end_check(minefield, mines, height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(286), UNITY_DISPLAY_STYLE_INT); + +} + + + void test_calculate_mines_HeightOne(void) { @@ -600,6 +674,6 @@ void test_calculate_mines_HeightOne(void) ((void *)0) - ), (UNITY_UINT)(267), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(300), 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 8147b67..2e2058c 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 e0b300a..20ddc52 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 3edd2e5..a826115 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 6c11100..6ae7a3f 100644 --- a/build/test/preprocess/files/test_duellist_spielesammlung_projekt.c +++ b/build/test/preprocess/files/test_duellist_spielesammlung_projekt.c @@ -574,6 +574,80 @@ void test_calculate_mines_WidthOne(void) +void test_calculate_mines_NormalCase(void) + +{ + + + + int height = 5; + + int width = 5; + + int expected = 6; + + + + + + int result = calculate_mines(height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(267), UNITY_DISPLAY_STYLE_INT); + +} + + + +void test_end_check_AllUncovered_NoMines(void) + +{ + + + + char* minefield[] = { "000", + + "000", + + "000" }; + + char* mines[] = { "000", + + "000", + + "000" }; + + int height = 3; + + int width = 3; + + + + + + int result = end_check(minefield, mines, height, width); + + + + + + UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(286), UNITY_DISPLAY_STYLE_INT); + +} + + + void test_calculate_mines_HeightOne(void) { @@ -600,6 +674,6 @@ void test_calculate_mines_HeightOne(void) ((void *)0) - ), (UNITY_UINT)(267), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(300), 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 9c312db..135d3c1 100644 --- a/build/test/results/test_duellist_spielesammlung_projekt.pass +++ b/build/test/results/test_duellist_spielesammlung_projekt.pass @@ -75,16 +75,24 @@ :line: 242 :message: '' :unity_test_time: 0 -- :test: test_calculate_mines_HeightOne +- :test: test_calculate_mines_NormalCase :line: 256 :message: '' :unity_test_time: 0 +- :test: test_end_check_AllUncovered_NoMines + :line: 270 + :message: '' + :unity_test_time: 0 +- :test: test_calculate_mines_HeightOne + :line: 289 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 19 - :passed: 19 + :total: 21 + :passed: 21 :failed: 0 :ignored: 0 :stdout: [] -:time: 0.04574930000035238 +:time: 0.04708719999962341 diff --git a/build/test/runners/test_duellist_spielesammlung_projekt_runner.c b/build/test/runners/test_duellist_spielesammlung_projekt_runner.c index 11e0147..5f049ee 100644 --- a/build/test/runners/test_duellist_spielesammlung_projekt_runner.c +++ b/build/test/runners/test_duellist_spielesammlung_projekt_runner.c @@ -28,6 +28,8 @@ extern void test_FieldEmpty_returns_true_for_empty_field(void); extern void test_FieldEmpty_returns_false_for_nonempty_field(void); extern void test_calculate_mines_HeightWidthOne(void); extern void test_calculate_mines_WidthOne(void); +extern void test_calculate_mines_NormalCase(void); +extern void test_end_check_AllUncovered_NoMines(void); extern void test_calculate_mines_HeightOne(void); @@ -111,7 +113,9 @@ int main(void) run_test(test_FieldEmpty_returns_false_for_nonempty_field, "test_FieldEmpty_returns_false_for_nonempty_field", 215); run_test(test_calculate_mines_HeightWidthOne, "test_calculate_mines_HeightWidthOne", 228); run_test(test_calculate_mines_WidthOne, "test_calculate_mines_WidthOne", 242); - run_test(test_calculate_mines_HeightOne, "test_calculate_mines_HeightOne", 256); + run_test(test_calculate_mines_NormalCase, "test_calculate_mines_NormalCase", 256); + run_test(test_end_check_AllUncovered_NoMines, "test_end_check_AllUncovered_NoMines", 270); + run_test(test_calculate_mines_HeightOne, "test_calculate_mines_HeightOne", 289); return UnityEnd(); } diff --git a/src/test/test_duellist_spielesammlung_projekt.c b/src/test/test_duellist_spielesammlung_projekt.c index f8f06b0..bae99d3 100644 --- a/src/test/test_duellist_spielesammlung_projekt.c +++ b/src/test/test_duellist_spielesammlung_projekt.c @@ -267,6 +267,25 @@ void test_calculate_mines_NormalCase(void) TEST_ASSERT_EQUAL_INT(expected, result); } +void test_end_check_AllUncovered_NoMines(void) +{ + /* arrange */ + char* minefield[] = { "000", + "000", + "000" }; + char* mines[] = { "000", + "000", + "000" }; + int height = 3; + int width = 3; + + /* act */ + int result = end_check(minefield, mines, height, width); + + /* assert */ + TEST_ASSERT_EQUAL_INT(1, result); +} + void test_calculate_mines_HeightOne(void) { /* arrange */