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 <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] = {

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

@ -2,6 +2,11 @@
#ifndef 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();
char* getWordFromList(int);

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

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

Loading…
Cancel
Save