change test_readWords_simple

This commit is contained in:
hoangto105860 committed 2026-10-20 16:46:35 +02:00
1 parent 23c1ae2059
commit 1cc06c0e2e
4 files changed
+18 -6

No files matched your search

BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+18 -6
View File
@@ -32,14 +32,26 @@ void print_test_result(int result) {
void test_readWords_simple(void) {
FILE *f = fopen("testwords_simple.txt", "r");
char words[10][MAX_WORD_LEN];
int count = readWords(f, words, 10);
char words[14][MAX_WORD_LEN];
int count = readWords(f, words, 14);
fclose(f);
TEST_ASSERT_EQUAL_INT(3, count);
TEST_ASSERT_EQUAL_STRING("APFEL", words[0]);
TEST_ASSERT_EQUAL_STRING("BANANE", words[1]);
TEST_ASSERT_EQUAL_STRING("KIWI", words[2]);
TEST_ASSERT_EQUAL_INT(15, count);
TEST_ASSERT_EQUAL_STRING("Yeti", words[0]);
TEST_ASSERT_EQUAL_STRING("Nessie", words[1]);
TEST_ASSERT_EQUAL_STRING("Werwolf", words[2]);
TEST_ASSERT_EQUAL_STRING("Vampir", words[3]);
TEST_ASSERT_EQUAL_STRING("Monster", words[4]);
TEST_ASSERT_EQUAL_STRING("Hydra", words[5]);
TEST_ASSERT_EQUAL_STRING("Frankenstein", words[6]);
TEST_ASSERT_EQUAL_STRING("Dracula", words[7]);
TEST_ASSERT_EQUAL_STRING("KingKong", words[8]);
TEST_ASSERT_EQUAL_STRING("Gremlin", words[9]);
TEST_ASSERT_EQUAL_STRING("Kobold", words[10]);
TEST_ASSERT_EQUAL_STRING("Hexe", words[11]);
TEST_ASSERT_EQUAL_STRING("Poltergeist", words[12]);
TEST_ASSERT_EQUAL_STRING("Gespenst", words[13]);
TEST_ASSERT_EQUAL_STRING("Oger", words[14]);
}
void test_readWords_with_delimiters(void) {