1 /* Copyright (c) 2007 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 "../EnchantTestFixture.h"
\r
27 struct EnchantGetPrefixDirTestFixture : EnchantTestFixture{
\r
29 EnchantGetPrefixDirTestFixture()
\r
31 expectedPrefixDir = GetDirectoryOfThisModule();
\r
34 const char* ExpectedPrefixDir()
\r
36 if(expectedPrefixDir.empty()){
\r
40 return expectedPrefixDir.c_str();
\r
43 std::string expectedPrefixDir;
\r
48 * enchant_get_prefix_dir
\r
50 * Returns a string giving the location of the base directory
\r
51 * of the enchant installation. This corresponds roughly to
\r
52 * the --prefix option given to ./configure when enchant is
\r
53 * compiled, except it is determined at runtime based on the location
\r
54 * of the enchant library.
\r
56 * This API is private to the providers.
\r
58 * returns NULL if it cannot dynamically determine the location of
\r
59 * the enchant library
\r
62 TEST_FIXTURE(EnchantGetPrefixDirTestFixture,
\r
63 EnchantGetPrefixDir)
\r
65 char* prefixDir = enchant_get_prefix_dir();
\r
66 CHECK_EQUAL(ExpectedPrefixDir(), prefixDir);
\r