1 /* Copyright (c) 2008 Eric Scott Albright
\r
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
4 * of this software and associated documentation files (the "Software"), to deal
\r
5 * in the Software without restriction, including without limitation the rights
\r
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
7 * copies of the Software, and to permit persons to whom the Software is
\r
8 * furnished to do so, subject to the following conditions:
\r
10 * The above copyright notice and this permission notice shall be included in
\r
11 * all copies or substantial portions of the Software.
\r
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
22 #include <UnitTest++.h>
\r
23 #include <enchant-provider.h>
\r
25 #include "../unittest_enchant_providers.h"
\r
27 struct ProviderDictionaryExists_TestFixture : Provider_TestFixture
\r
30 ProviderDictionaryExists_TestFixture()
\r
34 ~ProviderDictionaryExists_TestFixture()
\r
39 // dictionary_exists is optional
\r
41 /////////////////////////////////////////////////////////////////////////////
\r
42 // Test Normal Operation
\r
44 TEST_FIXTURE(ProviderDictionaryExists_TestFixture,
\r
45 ProviderDictionaryExists_ProviderDoesNotHave_ReturnsFalse)
\r
47 if (_provider->dictionary_exists)
\r
49 CHECK_EQUAL(0, (*_provider->dictionary_exists) (_provider, "zxx")); /*zxx is no linguistic content*/
\r
53 TEST_FIXTURE(ProviderDictionaryExists_TestFixture,
\r
54 ProviderDictionaryExists_ProviderDoesNotHave_ProviderDoesNotSetError)
\r
56 if (_provider->dictionary_exists)
\r
58 int exists = (*_provider->dictionary_exists) (_provider, "zxx"); /*zxx is no linguistic content*/
\r
59 CHECK_EQUAL((void*)NULL, GetErrorMessage(_provider));
\r