summaryrefslogtreecommitdiff
path: root/tests/enchant_providers/unittest_enchant_providers.h
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2021-11-12 14:22:10 +0000
committerReuben Thomas <rrt@sc3d.org>2021-11-16 12:24:42 +0000
commitf0ebe6f96bfc1a5e798acbe54ef68efc2ce6be21 (patch)
tree4f68e4604ca9f5e51f8aa83d17b0b96e5f289678 /tests/enchant_providers/unittest_enchant_providers.h
parent53416be5789613c8a14f26eaffe87e6aa70a35c0 (diff)
downloadenchant-f0ebe6f96bfc1a5e798acbe54ef68efc2ce6be21.tar.gz
Aspell provider: set provider error when request_dict fails
Also remove some checks for mandatory provider methods in test code.
Diffstat (limited to 'tests/enchant_providers/unittest_enchant_providers.h')
-rw-r--r--tests/enchant_providers/unittest_enchant_providers.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/tests/enchant_providers/unittest_enchant_providers.h b/tests/enchant_providers/unittest_enchant_providers.h
index 5fd2416..62f50ad 100644
--- a/tests/enchant_providers/unittest_enchant_providers.h
+++ b/tests/enchant_providers/unittest_enchant_providers.h
@@ -69,14 +69,11 @@ struct Provider_TestFixture
// Try getting dictionary for user's default language
char *lang = enchant_get_user_language();
- if (_provider->request_dict)
- {
- dict = (*_provider->request_dict) (_provider, lang);
- }
+ dict = (*_provider->request_dict) (_provider, lang);
g_free (lang);
// If not available, get the first dictionary listed as being available
- if (!dict && _provider->list_dicts && _provider->request_dict)
+ if (!dict && _provider->list_dicts)
{
size_t n_dicts;
@@ -90,18 +87,12 @@ struct Provider_TestFixture
EnchantDict* GetDictionary(const char* language)
{
- if(_provider->request_dict)
- {
return (*_provider->request_dict) (_provider, language);
- }
- return NULL;
}
virtual void ReleaseDictionary(EnchantDict* dict)
{
- if (dict && _provider->dispose_dict)
- {
+ if (dict)
_provider->dispose_dict(_provider, dict);
- }
}
};