Tizen 2.1 base
[external/enchant.git] / unittests / enchant_providers / Provider / provider_describe_dict.cpp
1 /* Copyright (c) 2008 Eric Scott Albright\r
2  * \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
9  * \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
12  * \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
19  * THE SOFTWARE.\r
20  */\r
21 \r
22 #include <UnitTest++.h>\r
23 #include <enchant-provider.h>\r
24 #include <glib.h>\r
25 \r
26 #include "../unittest_enchant_providers.h"\r
27 \r
28 struct ProviderDescribe_TestFixture : Provider_TestFixture\r
29 {\r
30     //Setup\r
31     ProviderDescribe_TestFixture()\r
32     { \r
33     }\r
34     //Teardown\r
35     ~ProviderDescribe_TestFixture()\r
36     {\r
37     }\r
38 };\r
39 \r
40 // describe is mandatory\r
41 \r
42 /////////////////////////////////////////////////////////////////////////////\r
43 // Test Normal Operation\r
44 \r
45 TEST_FIXTURE(ProviderDescribe_TestFixture, \r
46              ProviderDescribe_FunctionExists)\r
47 {\r
48     CHECK(_provider->describe != NULL);\r
49 }\r
50 \r
51 TEST_FIXTURE(ProviderDescribe_TestFixture, \r
52              ProviderDescribe_ReturnNonNull)\r
53 {\r
54     CHECK((*_provider->describe)(_provider) != NULL);\r
55 }\r
56 \r
57 TEST_FIXTURE(ProviderDescribe_TestFixture, \r
58              ProviderDescribe_ReturnNotEmpty)\r
59 {\r
60     CHECK(strlen((*_provider->describe)(_provider)) != 0);\r
61 }\r
62 \r
63 TEST_FIXTURE(ProviderDescribe_TestFixture, \r
64              ProviderDescribe_ReturnsValidUtf8String)\r
65 {\r
66     CHECK(g_utf8_validate((*_provider->describe)(_provider), -1, NULL));\r
67 }\r
68