From afe0362d79e7f071b89635b9dce83790ef5b5b7e Mon Sep 17 00:00:00 2001 From: Fadi Imani <fadi.imani.etu@univ-lille.fr> Date: Wed, 3 Apr 2024 16:20:35 +0200 Subject: [PATCH] big project --- tests/ExampleTests.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/ExampleTests.cpp b/tests/ExampleTests.cpp index a661d2f..d5bc6d0 100644 --- a/tests/ExampleTests.cpp +++ b/tests/ExampleTests.cpp @@ -88,22 +88,22 @@ TEST(ExampleTests, test_count_words_in_file) { EXPECT_EQ(6, count_words_in_file("test.txt")); } -//TEST(ExampleTests, test_read_and_count_ngrams) { -// FrequencyCounter counter; -// init_frequency_counter(&counter); -// read_and_count_ngrams(&counter, "test.txt", 2); -// EXPECT_EQ(2, counter.count); -// EXPECT_STREQ("hello world", counter.words[0].word); -// EXPECT_EQ(1, counter.words[0].frequency); -// EXPECT_STREQ("world foo", counter.words[1].word); -// EXPECT_EQ(1, counter.words[1].frequency); -// cleanup_frequency_counter(&counter); -//} - -//TEST(ExampleTests, test_mode_interactive) { -// // this is just to make sure the function does not crash -// mode_interactive(); -//} +TEST(ExampleTests, test_read_and_count_ngrams) { + FrequencyCounter counter; + init_frequency_counter(&counter); + read_and_count_ngrams(&counter, "test.txt", 2); + EXPECT_EQ(2, counter.count); + EXPECT_STREQ("hello world", counter.words[0].word); + EXPECT_EQ(1, counter.words[0].frequency); + EXPECT_STREQ("world foo", counter.words[1].word); + EXPECT_EQ(1, counter.words[1].frequency); + cleanup_frequency_counter(&counter); +} + +TEST(ExampleTests, test_mode_interactive) { + // this is just to make sure the function does not crash + mode_interactive(); +} -- GitLab