diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/EnchantDictionaryTestFixture.h | 10 | ||||
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/dictionary/enchant_dict_suggest_tests.cpp | 7 |
3 files changed, 15 insertions, 4 deletions
diff --git a/tests/EnchantDictionaryTestFixture.h b/tests/EnchantDictionaryTestFixture.h index cf820cf..368ad5a 100644 --- a/tests/EnchantDictionaryTestFixture.h +++ b/tests/EnchantDictionaryTestFixture.h @@ -214,6 +214,14 @@ struct EnchantDictionaryTestFixture : EnchantBrokerTestFixture }
}
+ void FreePwlStringList(char** list)
+ {
+ if(list)
+ {
+ enchant_dict_free_string_list(_pwl, list);
+ }
+ }
+
bool IsWordInSession(const std::string& word){
return enchant_dict_is_added(_dict, word.c_str(), word.size())!=0;
}
@@ -309,7 +317,7 @@ struct EnchantDictionaryTestFixture : EnchantBrokerTestFixture std::vector<std::string> result;
if(expectedSuggestions != NULL && begin < cSuggestions){
result.insert(result.begin(), expectedSuggestions+begin, expectedSuggestions+cSuggestions);
- FreeStringList(expectedSuggestions);
+ g_strfreev(expectedSuggestions);
}
return result;
diff --git a/tests/Makefile.am b/tests/Makefile.am index 62adfc5..606159f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -19,7 +19,7 @@ AM_TESTS_ENVIRONMENT = \ cp $(srcdir)/test.pwl.orig $(builddir)/test.pwl; \ cp $(builddir)/@objdir@/*@shlibext@ .; \ chmod +w $(builddir)/test.pwl; \ - export LSAN_OPTIONS=suppressions=$(srcdir)/asan-suppressions.txt; + export LSAN_OPTIONS=suppressions=$(srcdir)/asan-suppressions.txt:fast_unwind_on_malloc=0; DISTCLEANFILES = test.pwl *@shlibext@ diff --git a/tests/dictionary/enchant_dict_suggest_tests.cpp b/tests/dictionary/enchant_dict_suggest_tests.cpp index cebd88e..99f2100 100644 --- a/tests/dictionary/enchant_dict_suggest_tests.cpp +++ b/tests/dictionary/enchant_dict_suggest_tests.cpp @@ -45,6 +45,7 @@ struct EnchantDictionarySuggestTestFixtureBase : EnchantDictionaryTestFixture {
dictSuggestCalled = false;
_suggestions = NULL;
+ _pwl_suggestions = NULL;
suggestWord = std::string();
suggestBehavior = returnFour;
}
@@ -52,9 +53,11 @@ struct EnchantDictionarySuggestTestFixtureBase : EnchantDictionaryTestFixture ~EnchantDictionarySuggestTestFixtureBase()
{
FreeStringList(_suggestions);
+ FreePwlStringList(_pwl_suggestions);
}
char** _suggestions;
+ char** _pwl_suggestions;
};
static char **
@@ -210,8 +213,8 @@ TEST_FIXTURE(EnchantDictionarySuggest_TestFixture, EnchantDictionarySuggest_InBrokerPwlSession)
{
enchant_dict_add(_pwl, "hello", -1);
- _suggestions = enchant_dict_suggest(_pwl, "helo", -1, NULL);
- CHECK(_suggestions);
+ _pwl_suggestions = enchant_dict_suggest(_pwl, "helo", -1, NULL);
+ CHECK(_pwl_suggestions);
CHECK(!dictSuggestCalled);
}
|