summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2020-12-22 18:33:43 +0000
committerGitHub <noreply@github.com>2020-12-22 18:33:43 +0000
commit186cba14f3fda8abf95e701929a5e731bee48fda (patch)
tree7a6e46cf09b468731fbb1dc2856589f600498a25
parentdc708004ad23313f9cfa989239c2a163808a4197 (diff)
parent985879159879d30edf4a979b00ac8dc479076939 (diff)
downloadenchant-186cba14f3fda8abf95e701929a5e731bee48fda.tar.gz
Merge pull request #268 from rrthomas/masterv2.2.15
configure.ac: require nuspell >= 4.1.0 (fixes #267)
-rw-r--r--.appveyor.yml3
-rw-r--r--NEWS8
-rwxr-xr-xbuild-aux/appveyor-build.sh4
-rw-r--r--configure.ac6
-rw-r--r--tests/EnchantDictionaryTestFixture.h10
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/dictionary/enchant_dict_suggest_tests.cpp7
7 files changed, 30 insertions, 10 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index e09fe5c..571fbf2 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -7,8 +7,8 @@ environment:
VERBOSE: 1 # Get test logs in output
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
ASAN: 'yes'
+ - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- APPVEYOR_BUILD_WORKER_IMAGE: macos
# MSYS does not have hunspell packages
# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
@@ -27,6 +27,7 @@ for:
- sudo add-apt-repository -y ppa:nuspell/ppa
- sudo apt-get -y install libglib2.0-dev libaspell-dev hspell libhunspell-dev libvoikko-dev voikko-fi aspell-en libunittest++-dev hunspell-fr libnuspell-dev
build_script:
+ - export ASAN
- ./build-aux/appveyor-build.sh
-
matrix:
diff --git a/NEWS b/NEWS
index 084021b..dc0808d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+2.2.15 (December 22, 2020)
+--------------------------
+
+Specify that nuspell >= 4.1.0 is required.
+
+Fix some space leaks in the tests.
+
+
2.2.14 (December 10, 2020)
--------------------------
diff --git a/build-aux/appveyor-build.sh b/build-aux/appveyor-build.sh
index 6472d91..db42400 100755
--- a/build-aux/appveyor-build.sh
+++ b/build-aux/appveyor-build.sh
@@ -8,9 +8,9 @@ set -e
./bootstrap
CONFIGURE_ARGS=(--enable-relocatable --with-zemberek=check)
if [[ "$ASAN" == "yes" ]]; then
- CONFIGURE_ARGS+=(CFLAGS="-g3 -fsanitize=address -fsanitize=undefined" LDFLAGS="-fsanitize=address -fsanitize=undefined")
+ CONFIGURE_ARGS+=(CFLAGS="-g3 -fsanitize=address -fsanitize=undefined" CXXFLAGS="-g3 -fsanitize=address -fsanitize=undefined" LDFLAGS="-fsanitize=address -fsanitize=undefined")
fi
-./configure --enable-silent-rules "${CONFIGURE_ARGS[@]}"
+./configure "${CONFIGURE_ARGS[@]}"
make
make distcheck
diff --git a/configure.ac b/configure.ac
index 3b1962e..4877edc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([enchant],[2.2.14])
+AC_INIT([enchant],[2.2.15])
AC_CONFIG_SRCDIR(src/enchant.h)
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([subdir-objects])
@@ -171,7 +171,7 @@ AC_DEFUN([ENCHANT_CHECK_PROVIDER_SETUP],
AC_DEFUN([ENCHANT_CHECK_PKG_CONFIG_PROVIDER],
[ENCHANT_CHECK_PROVIDER_SETUP([$1], [$4])
AS_IF([test "x$with_[]$1" != xno],
- [PKG_CHECK_MODULES([$2], [m4_default([$3], [$1])],
+ [PKG_CHECK_MODULES([$2], [m4_default([$3], [$1])],
[$2[]_CFLAGS="$[]$2[]_CFLAGS -DENCHANT_[]$2[]_DICT_DIR='\"$[]$1_dir\"'"
with_$1=yes
build_providers="$build_providers $1"],
@@ -209,7 +209,7 @@ build_providers=
dnl Standard providers
ENCHANT_CHECK_PKG_CONFIG_PROVIDER([hunspell], [HUNSPELL])
-ENCHANT_CHECK_PKG_CONFIG_PROVIDER([nuspell], [NUSPELL])
+ENCHANT_CHECK_PKG_CONFIG_PROVIDER([nuspell], [NUSPELL], [nuspell >= 4.1.0])
ENCHANT_CHECK_LIB_PROVIDER([aspell], [ASPELL], [get_aspell_dict_info_list])
ENCHANT_CHECK_LIB_PROVIDER([hspell], [HSPELL], [hspell_get_dictionary_path],, [-lz])
ENCHANT_CHECK_PKG_CONFIG_PROVIDER([voikko], [VOIKKO], [libvoikko])
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);
}