diff --git a/cmake-build-debug/.ninja_deps b/cmake-build-debug/.ninja_deps index c82727a..ad32c4e 100644 Binary files a/cmake-build-debug/.ninja_deps and b/cmake-build-debug/.ninja_deps differ diff --git a/cmake-build-debug/.ninja_log b/cmake-build-debug/.ninja_log index e2bb7e3..1ced4ca 100644 --- a/cmake-build-debug/.ninja_log +++ b/cmake-build-debug/.ninja_log @@ -20,3 +20,5 @@ 41 68 1707259974621052571 pmuw_projekt_notebinder a5668107eb06d295 0 41 1707260143202490285 CMakeFiles/pmuw_projekt_notebinder.dir/src/main/c/Hangman/playHangman.c.o f2e2af7048638ee6 41 66 1707260143227530868 pmuw_projekt_notebinder a5668107eb06d295 +2 209 1707265395136143124 CMakeFiles/pmuw_projekt_notebinder.dir/src/main/c/Hangman/playHangman.c.o f2e2af7048638ee6 +209 296 1707265395223868349 pmuw_projekt_notebinder a5668107eb06d295 diff --git a/cmake-build-debug/Testing/Temporary/LastTest.log b/cmake-build-debug/Testing/Temporary/LastTest.log index 47dd361..e5ab0e9 100644 --- a/cmake-build-debug/Testing/Temporary/LastTest.log +++ b/cmake-build-debug/Testing/Temporary/LastTest.log @@ -1,3 +1,3 @@ -Start testing: Feb 06 23:55 CET +Start testing: Feb 07 01:39 CET ---------------------------------------------------------- -End testing: Feb 06 23:55 CET +End testing: Feb 07 01:39 CET diff --git a/test/Hangman/test_playHangman.c b/test/Hangman/test_playHangman.c index 2b4c51b..7e01f23 100644 --- a/test/Hangman/test_playHangman.c +++ b/test/Hangman/test_playHangman.c @@ -1,18 +1,21 @@ -#include "playHangman.c" -#include #include +#include "playHangman.h" -// 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) { - printf("[PASS] %s\n", test_name); - } else { - printf("[FAIL] %s - Expected: \"%s\", Actual: \"%s\"\n", test_name, expected, actual); - } -} -// Test function for playHangman() -void test_playHangman() { - char wordToGuess[] = "test"; - //playHangman(wordToGuess); +void test_displayRules() { + // Simulate user input: 1, 2, and an invalid input + printf("Test Case 1: User enters '1' (YES)\n"); + printf("Expected Output: \"Let's get started!\"\n"); + printf("Actual Output: "); + displayRules(); // Call displayRules() with input 1 + + printf("\nTest Case 2: User enters '2' (NO)\n"); + printf("Expected Output: Output of printRules()\n"); + printf("Actual Output: "); + displayRules(); // Call displayRules() with input 2 + + printf("\nTest Case 3: User enters an invalid input\n"); + printf("Expected Output: \"Please enter either 1 or 2 to continue:\"\n"); + printf("Actual Output: "); + displayRules(); // Call displayRules() with invalid input } \ No newline at end of file