edit test_readWords_with_delimiters

This commit is contained in:
hoangto105860 committed 2026-10-20 16:58:25 +02:00
1 parent 1cc06c0e2e
commit 74360620be
1 file changed
+18 -6
+18 -6
View File
@@ -57,14 +57,26 @@ void test_readWords_simple(void) {
void test_readWords_with_delimiters(void) { void test_readWords_with_delimiters(void) {
FILE *f = fopen("testwords_delims.txt", "r"); FILE *f = fopen("testwords_delims.txt", "r");
char words[10][MAX_WORD_LEN]; char words[14][MAX_WORD_LEN];
int count = readWords(f, words, 10); int count = readWords(f, words, 14);
fclose(f); fclose(f);
TEST_ASSERT_EQUAL_INT(3, count); TEST_ASSERT_EQUAL_INT(15, count);
TEST_ASSERT_EQUAL_STRING("HUND", words[0]); TEST_ASSERT_EQUAL_STRING("Yeti", words[0]);
TEST_ASSERT_EQUAL_STRING("KATZE", words[1]); TEST_ASSERT_EQUAL_STRING("Nessie", words[1]);
TEST_ASSERT_EQUAL_STRING("MAUS", words[2]); 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_empty_file(void) { void test_readWords_empty_file(void) {