Browse Source

Verschieben der define Variablen in die .h-Datei, sodass sie ebenfalls für die Testdatei verfügbar ist

remotes/origin/tim
fdai7727 11 months ago
parent
commit
1e643eb08a
  1. 6
      src/main/c/Tim/hangman.c
  2. 5
      src/main/c/Tim/hangman.h
  3. 2
      src/test/c/Tim/test_hangman.c

6
src/main/c/Tim/hangman.c

@ -6,11 +6,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <ctype.h> #include <ctype.h>
#define LISTSIZE 30
#define MAX_WORD_LENGTH 30
#define STAGENUM 7
#define ASCII_ART_SIZE 1000
#define POSSIBLE_TRYS 6
char wordlist[LISTSIZE][MAX_WORD_LENGTH] = { char wordlist[LISTSIZE][MAX_WORD_LENGTH] = {

5
src/main/c/Tim/hangman.h

@ -2,6 +2,11 @@
#ifndef HANGMAN_H #ifndef HANGMAN_H
#define HANGMAN_H #define HANGMAN_H
#define LISTSIZE 30
#define MAX_WORD_LENGTH 30
#define STAGENUM 7
#define ASCII_ART_SIZE 1000
#define POSSIBLE_TRYS 6
void hangman(); void hangman();
char* getWordFromList(int); char* getWordFromList(int);

2
src/test/c/Tim/test_hangman.c

@ -43,7 +43,7 @@ void test_getWordFromList_Kleiderschrank_5()
void test_getWordFromList_IndexOutOfList() void test_getWordFromList_IndexOutOfList()
{ {
//arrange //arrange
int pos = 60;
int pos = LISTSIZE+1;
char expectedResult[] = "Index nicht vorhanden"; char expectedResult[] = "Index nicht vorhanden";
//act //act
char actualResult[30]; char actualResult[30];

Loading…
Cancel
Save