From 2bbaff4c4e62fc54b4df98ea4eaabde068faf8d8 Mon Sep 17 00:00:00 2001 From: Ronja Awe Date: Thu, 2 Feb 2023 12:27:52 +0100 Subject: [PATCH] =?UTF-8?q?userinput=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/c/labyrinth.c | 2 +- test/c/test_labyrinth.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/c/labyrinth.c b/src/c/labyrinth.c index b9d4c66..7d4fb9b 100644 --- a/src/c/labyrinth.c +++ b/src/c/labyrinth.c @@ -56,7 +56,7 @@ void labyrinthschritte(lab laby, int hoehe, int breite, int schritte, int versuc int antwort = 0; - antwort = 5; + antwort = userInput(); if(antwort == schritte){ printf("Correct you need %d steps.\n", schritte); diff --git a/test/c/test_labyrinth.c b/test/c/test_labyrinth.c index 4f20e3a..690272e 100644 --- a/test/c/test_labyrinth.c +++ b/test/c/test_labyrinth.c @@ -210,6 +210,9 @@ void test_LabyrinthSchritte(void){ printlabyrinth(laby, hoehe, breite); //hier in die funktion die print frage machen wegsuchen(laby, &result, 0, 0, 4, 5); + + 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);