From 3ca77efa51fe4dc63a5594eefae7c7debf704128 Mon Sep 17 00:00:00 2001 From: Ronja Awe Date: Thu, 2 Feb 2023 12:35:34 +0100 Subject: [PATCH] =?UTF-8?q?Testfall=20beim=20letzten=20versuch=20gewonnen?= =?UTF-8?q?=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/c/test_labyrinth.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/c/test_labyrinth.c b/test/c/test_labyrinth.c index fe10bbc..2a110b2 100644 --- a/test/c/test_labyrinth.c +++ b/test/c/test_labyrinth.c @@ -247,4 +247,33 @@ void test_LabyrinthSchritteVerloren(void){ } +void test_LabyrinthSchritteBeiDreiGewonnen(void){ + + bool result; + int input = 1; + int hoehe = 5; + int breite = 6; + int schritte = 14; + int versuche = 0; + lab laby = { + {'0', '1', '0', '0', '0', '0'}, + {'0', '1', '0', '1', '1', '0'}, + {'0', '0', '0', '0', '1', '0'}, + {'0', '1', '1', '0', '1', '0'}, + {'0', '1', '0', '0', '1', '0'}, + }; + + printlabyrinth(laby, hoehe, breite); //hier in die funktion die print frage machen + wegsuchen(laby, &result, 0, 0, 4, 5); + + userInput_ExpectAndReturn(5); + userInput_ExpectAndReturn(8); + userInput_ExpectAndReturn(10); + userInput_ExpectAndReturn(14); + + labyrinthschritte(laby, hoehe, breite, schritte, versuche); //die geliche funktion nur mit dem if vergleich und userinput + TEST_ASSERT_EQUAL_INT(1, result); + +} + #endif // TEST \ No newline at end of file