From 08bf6e1b5c3ba52c5756a7757a50b685f7181fa8 Mon Sep 17 00:00:00 2001 From: Saba Fazlali Date: Tue, 6 Feb 2024 21:14:02 +0100 Subject: [PATCH] test drawHangman --- src/main/c/Hangman/Test/test_drawHangman.c | 21 ------------------- test/Hangman/test_drawHangman.c | 12 +++++++++++ .../Test => test/Hangman}/test_drawHangman.h | 0 .../Test => test/Hangman}/test_playHangman.c | 1 - 4 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 src/main/c/Hangman/Test/test_drawHangman.c create mode 100644 test/Hangman/test_drawHangman.c rename {src/main/c/Hangman/Test => test/Hangman}/test_drawHangman.h (100%) rename {src/main/c/Hangman/Test => test/Hangman}/test_playHangman.c (99%) diff --git a/src/main/c/Hangman/Test/test_drawHangman.c b/src/main/c/Hangman/Test/test_drawHangman.c deleted file mode 100644 index c22e956..0000000 --- a/src/main/c/Hangman/Test/test_drawHangman.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "test_drawHangman.h" -void test_drawHangman(int mistakes){ - switch (mistakes) { - case 0: - drawHangman(0); - case 1: - drawHangman(1); - case 2: - drawHangman(2); - case 3: - drawHangman(3); - case 4: - drawHangman(4); - case 5: - drawHangman(5); - case 6: - drawHangman(6); - case 10: // More than 6 mistakes - drawHangman(10); - } -} \ No newline at end of file diff --git a/test/Hangman/test_drawHangman.c b/test/Hangman/test_drawHangman.c new file mode 100644 index 0000000..6eb9faf --- /dev/null +++ b/test/Hangman/test_drawHangman.c @@ -0,0 +1,12 @@ +#include +#include +#include "drawHangman.h" +#include "playHangman.h" + +void test_drawHangman() { + // Test each case of incorrectGuesses + printf("Testing drawHangman(0):\n"); + drawHangman(0); + printf("\n"); + +} \ No newline at end of file diff --git a/src/main/c/Hangman/Test/test_drawHangman.h b/test/Hangman/test_drawHangman.h similarity index 100% rename from src/main/c/Hangman/Test/test_drawHangman.h rename to test/Hangman/test_drawHangman.h diff --git a/src/main/c/Hangman/Test/test_playHangman.c b/test/Hangman/test_playHangman.c similarity index 99% rename from src/main/c/Hangman/Test/test_playHangman.c rename to test/Hangman/test_playHangman.c index 482eb2c..2b4c51b 100644 --- a/src/main/c/Hangman/Test/test_playHangman.c +++ b/test/Hangman/test_playHangman.c @@ -2,7 +2,6 @@ #include #include - // Custom assert function to compare expected and actual values void assert_equal(const char *test_name, const char *expected, const char *actual) { if (strcmp(expected, actual) == 0) {