summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Albright <eric_albright@sil.org>2008-04-25 07:41:14 +0000
committerEric Albright <eric_albright@sil.org>2008-04-25 07:41:14 +0000
commitcc4235902c668c9d7f6f9f00c8b2dba4d28a3a72 (patch)
tree974d4bcdc0c48705f00682d4bf8b1d357c5ef87d
parentb006a2218d45cf8f8772fe71c988730f0c2418e1 (diff)
downloadenchant-cc4235902c668c9d7f6f9f00c8b2dba4d28a3a72.tar.gz
Get unit tests compiling again
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@23618 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r--msvc/enchant.sln1
-rw-r--r--msvc/libenchant_myspell.vcproj20
-rw-r--r--msvc/unittest-enchant.vcproj6
-rw-r--r--unittests/Enchant.Net.Tests/Enchant.Net.Tests.csproj4
-rw-r--r--unittests/EnchantBrokerTestFixture.h78
-rw-r--r--unittests/EnchantDictionaryTestFixture.h6
-rw-r--r--unittests/EnchantTestFixture.h129
-rw-r--r--unittests/broker/enchant_broker_describe_tests.cpp7
-rw-r--r--unittests/provider/enchant_provider_get_user_config_dirs_tests.cpp (renamed from unittests/provider/enchant_provider_get_config_home_dir_tests.cpp)69
-rw-r--r--unittests/provider/enchant_provider_get_user_home_dir_tests.cpp78
10 files changed, 211 insertions, 187 deletions
diff --git a/msvc/enchant.sln b/msvc/enchant.sln
index edc3274..d575cdc 100644
--- a/msvc/enchant.sln
+++ b/msvc/enchant.sln
@@ -235,7 +235,6 @@ Global
{5612C360-309B-4E73-8512-6A1265590B90}.Release|Win32.ActiveCfg = Release|Win32
{B35929B8-374C-442B-A0F5-494AD69EDE1A}.Debug|Any CPU.ActiveCfg = Debug|Win32
{B35929B8-374C-442B-A0F5-494AD69EDE1A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
- {B35929B8-374C-442B-A0F5-494AD69EDE1A}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{B35929B8-374C-442B-A0F5-494AD69EDE1A}.Debug|Win32.ActiveCfg = Debug|Win32
{B35929B8-374C-442B-A0F5-494AD69EDE1A}.Release|Any CPU.ActiveCfg = Release|Win32
{B35929B8-374C-442B-A0F5-494AD69EDE1A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
diff --git a/msvc/libenchant_myspell.vcproj b/msvc/libenchant_myspell.vcproj
index 7e97d67..aad3184 100644
--- a/msvc/libenchant_myspell.vcproj
+++ b/msvc/libenchant_myspell.vcproj
@@ -197,6 +197,10 @@
>
</File>
<File
+ RelativePath="..\src\myspell\filemgr.cxx"
+ >
+ </File>
+ <File
RelativePath="..\src\myspell\hashmgr.cxx"
>
</File>
@@ -205,6 +209,10 @@
>
</File>
<File
+ RelativePath="..\src\myspell\hunzip.cxx"
+ >
+ </File>
+ <File
RelativePath="..\src\myspell\myspell_checker.cpp"
>
</File>
@@ -259,6 +267,10 @@
>
</File>
<File
+ RelativePath="..\src\myspell\filemgr.hxx"
+ >
+ </File>
+ <File
RelativePath="..\src\myspell\hashmgr.hxx"
>
</File>
@@ -275,6 +287,10 @@
>
</File>
<File
+ RelativePath="..\src\myspell\hunzip.hxx"
+ >
+ </File>
+ <File
RelativePath="..\src\myspell\langnum.hxx"
>
</File>
@@ -286,6 +302,10 @@
RelativePath="..\src\myspell\suggestmgr.hxx"
>
</File>
+ <File
+ RelativePath="..\src\myspell\w_char.hxx"
+ >
+ </File>
</Filter>
<Filter
Name="Resource Files"
diff --git a/msvc/unittest-enchant.vcproj b/msvc/unittest-enchant.vcproj
index 008ed15..74b392e 100644
--- a/msvc/unittest-enchant.vcproj
+++ b/msvc/unittest-enchant.vcproj
@@ -302,10 +302,6 @@
>
</File>
<File
- RelativePath="..\unittests\provider\enchant_provider_get_config_home_dir_tests.cpp"
- >
- </File>
- <File
RelativePath="..\unittests\provider\enchant_provider_get_prefix_dir_tests.cpp"
>
</File>
@@ -314,7 +310,7 @@
>
</File>
<File
- RelativePath="..\unittests\provider\enchant_provider_get_user_home_dir_tests.cpp"
+ RelativePath="..\unittests\provider\enchant_provider_get_user_config_dirs_tests.cpp"
>
</File>
<File
diff --git a/unittests/Enchant.Net.Tests/Enchant.Net.Tests.csproj b/unittests/Enchant.Net.Tests/Enchant.Net.Tests.csproj
index 8bb1ac3..cbe87c8 100644
--- a/unittests/Enchant.Net.Tests/Enchant.Net.Tests.csproj
+++ b/unittests/Enchant.Net.Tests/Enchant.Net.Tests.csproj
@@ -28,7 +28,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="nunit.framework, Version=2.4.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />
+ <Reference Include="nunit.framework, Version=2.4.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
diff --git a/unittests/EnchantBrokerTestFixture.h b/unittests/EnchantBrokerTestFixture.h
index 0001b44..dbfda60 100644
--- a/unittests/EnchantBrokerTestFixture.h
+++ b/unittests/EnchantBrokerTestFixture.h
@@ -33,7 +33,6 @@
#include "mock_provider/mock_provider.h"
#include <stack>
#include <stdio.h>
-#include <io.h>
#include <direct.h>
#if !defined(_WIN32)
@@ -128,8 +127,6 @@ struct EnchantBrokerTestFixture : EnchantTestFixture
ConfigureHook user2Configuration=NULL,
bool includeNullProviders = false)
{
- CleanUpFiles(); //just in case we stopped the process in the middle.
-
userMockProviderConfiguration = userConfiguration;
userMockProvider2Configuration = user2Configuration;
@@ -161,7 +158,7 @@ struct EnchantBrokerTestFixture : EnchantTestFixture
CopyProvider("libenchant", "libenchant"); //not a provider
}
- SetUserRegistryConfigDir(GetEnchantPersonalDir());
+ SetUserRegistryConfigDir(GetTempUserEnchantDir());
InitializeBroker();
}
@@ -184,7 +181,6 @@ struct EnchantBrokerTestFixture : EnchantTestFixture
DeleteFile(pwlFilenames.top());
pwlFilenames.pop();
}
- CleanUpFiles();
}
void InitializeBroker()
@@ -192,14 +188,6 @@ struct EnchantBrokerTestFixture : EnchantTestFixture
_broker = enchant_broker_init ();
}
- void CleanUpFiles()
- {
- //clean up personal dictionaries from home dir
- DeleteDirAndFiles(GetEnchantPersonalDir());
- DeleteDirAndFiles(AddToPath(GetDirectoryOfThisModule(), "lib"));
- DeleteDirAndFiles(AddToPath(GetDirectoryOfThisModule(), "share"));
- }
-
void CopyProvider(const std::string& sourceProviderName, const std::string& destinationProviderName)
{
std::string sourceName = sourceProviderName +"."+ G_MODULE_SUFFIX;
@@ -224,15 +212,6 @@ struct EnchantBrokerTestFixture : EnchantTestFixture
}
}
- std::string GetEnchantPersonalDir()
- {
- return AddToPath(GetDirectoryOfThisModule(), ".enchant");
- }
-
- std::string GetEnchantConfigDir()
- {
- return AddToPath(AddToPath(GetDirectoryOfThisModule(), "share"), "enchant");
- }
EnchantProvider* GetMockProvider(){
return mock_provider;
@@ -251,61 +230,8 @@ struct EnchantBrokerTestFixture : EnchantTestFixture
return enchant_broker_request_dict(_broker, tag.c_str());
}
- static std::string GetTemporaryFilename(const std::string & extension){
- char* tempFileName = tempnam(".", extension.c_str());
- std::string temp(tempFileName);
- free(tempFileName);
- return temp;
- }
-
- static void CreateDirectory(const std::string& filepath)
- {
- g_mkdir_with_parents(filepath.c_str(), S_IREAD | S_IWRITE | S_IEXEC);
- }
- static void CreateFile(const std::string& filepath)
- {
- int fh = g_creat(filepath.c_str(), _S_IREAD | _S_IWRITE);
- if(fh != -1) {
- close(fh);
- }
- }
- static void DeleteFile(const std::string& filepath)
- {
- if(FileExists(filepath)){
- g_remove(filepath.c_str());
- }
- }
- static bool FileExists(const std::string& filepath)
- {
- return(g_access(filepath.c_str(), 0)==0);
- }
- static void DeleteDirAndFiles(const std::string& dir)
- {
- GDir* gdir = g_dir_open(dir.c_str(), 0, NULL);
- if(gdir != NULL)
- {
- const gchar* filename;
- for(;;){
- filename = g_dir_read_name(gdir);
- if(filename == NULL)
- {
- break;
- }
- std::string filepath = AddToPath(dir, filename);
- if(g_file_test(filepath.c_str(), G_FILE_TEST_IS_DIR)){
- DeleteDirAndFiles(filepath);
- }
- else {
- DeleteFile(filepath);
- }
- }
- g_dir_close(gdir);
- }
- g_rmdir(dir.c_str());
- }
-
EnchantDict* RequestPersonalDictionary()
- {
+ {
std::string pwlFileName = GetTemporaryFilename("epwl");
CreateFile(pwlFileName);
pwlFilenames.push(pwlFileName);
diff --git a/unittests/EnchantDictionaryTestFixture.h b/unittests/EnchantDictionaryTestFixture.h
index 777e782..25d621a 100644
--- a/unittests/EnchantDictionaryTestFixture.h
+++ b/unittests/EnchantDictionaryTestFixture.h
@@ -193,11 +193,11 @@ struct EnchantDictionaryTestFixture : EnchantBrokerTestFixture
}
std::string GetPersonalDictFileName(){
- return AddToPath(GetEnchantPersonalDir(), "qaa.dic");
+ return AddToPath(GetTempUserEnchantDir(), "qaa.dic");
}
std::string GetExcludeDictFileName(){
- return AddToPath(GetEnchantPersonalDir(), "qaa.exc");
+ return AddToPath(GetTempUserEnchantDir(), "qaa.exc");
}
void SetErrorOnMockDictionary(const std::string& error)
@@ -324,4 +324,4 @@ struct EnchantDictionaryTestFixture : EnchantBrokerTestFixture
#pragma warning(pop)
#endif
-#endif \ No newline at end of file
+#endif
diff --git a/unittests/EnchantTestFixture.h b/unittests/EnchantTestFixture.h
index 22391be..64daae4 100644
--- a/unittests/EnchantTestFixture.h
+++ b/unittests/EnchantTestFixture.h
@@ -31,6 +31,7 @@
#include <windows.h>
#include <shlwapi.h>
#endif
+#include <io.h>
#include <glib.h>
#include <string>
@@ -46,6 +47,9 @@ struct EnchantTestFixture
//Setup
EnchantTestFixture()
{
+ CleanUpFiles(); //just in case we stopped the process in the middle.
+ MoveEnchantUserFilesOutOfTheWay();
+
#ifdef _WIN32
savedRegistryHomeDir = GetRegistryHomeDir();
ClearRegistryHomeDir();
@@ -103,7 +107,130 @@ struct EnchantTestFixture
else {
SetMachineRegistryConfigDir(savedMachineRegistryConfigDir);
}
+
#endif
+ RestoreEnchantUserFiles();
+ CleanUpFiles();
+ }
+ void CleanUpFiles()
+ {
+ //clean up personal dictionaries from home dir
+ DeleteDirAndFiles(GetTempUserEnchantDir());
+ DeleteDirAndFiles(AddToPath(GetDirectoryOfThisModule(), "lib"));
+ DeleteDirAndFiles(AddToPath(GetDirectoryOfThisModule(), "share"));
+ }
+
+ std::string GetTempUserEnchantDir()
+ {
+ return GetEnchantHomeDirFromBase(GetDirectoryOfThisModule());
+ }
+
+ void MoveEnchantUserFilesOutOfTheWay()
+ {
+ GetFilesOutOfTheWay(GetEnchantHomeDirFromBase(g_get_user_config_dir()));
+ GetFilesOutOfTheWay(GetEnchantHomeDirFromBase(g_get_home_dir()));
+ }
+
+ void RestoreEnchantUserFiles()
+ {
+ RestoreFiles(GetEnchantHomeDirFromBase(g_get_user_config_dir()));
+ RestoreFiles(GetEnchantHomeDirFromBase(g_get_home_dir()));
+ }
+
+#define OUT_OF_THE_WAY ".real";
+
+ void GetFilesOutOfTheWay(const std::string& dir)
+ {
+ std::string toTheSideDir = dir + OUT_OF_THE_WAY;
+
+ if(!DirExists(toTheSideDir))
+ {
+ MoveDir(dir, toTheSideDir);
+ }
+
+ DeleteDirAndFiles(dir);
+ }
+
+ void RestoreFiles(const std::string& dir)
+ {
+ std::string toTheSideDir = dir + OUT_OF_THE_WAY;
+ if(DirExists(toTheSideDir))
+ {
+ MoveDir(toTheSideDir, dir);
+ }
+ }
+
+ std::string GetEnchantConfigDir()
+ {
+ return AddToPath(AddToPath(GetDirectoryOfThisModule(), "share"), "enchant");
+ }
+
+ static bool DirExists(const std::string& dir)
+ {
+ return g_file_test(dir.c_str(), G_FILE_TEST_IS_DIR);
+ }
+
+ static void MoveDir(const std::string& from, const std::string& to)
+ {
+ int result = g_rename(from.c_str(), to.c_str());
+ if(result)
+ {
+ perror("failed");
+ }
+ }
+
+ static void DeleteDirAndFiles(const std::string& dir)
+ {
+ GDir* gdir = g_dir_open(dir.c_str(), 0, NULL);
+ if(gdir != NULL)
+ {
+ const gchar* filename;
+ for(;;){
+ filename = g_dir_read_name(gdir);
+ if(filename == NULL)
+ {
+ break;
+ }
+ std::string filepath = AddToPath(dir, filename);
+ if(g_file_test(filepath.c_str(), G_FILE_TEST_IS_DIR)){
+ DeleteDirAndFiles(filepath);
+ }
+ else {
+ DeleteFile(filepath);
+ }
+ }
+ g_dir_close(gdir);
+ }
+ g_rmdir(dir.c_str());
+ }
+
+ static std::string GetTemporaryFilename(const std::string & prefix){
+ char* tempFileName = tempnam(".", prefix.c_str());
+ std::string temp(tempFileName);
+ free(tempFileName);
+ return temp;
+ }
+
+ static void CreateDirectory(const std::string& filepath)
+ {
+ g_mkdir_with_parents(filepath.c_str(), S_IREAD | S_IWRITE | S_IEXEC);
+ }
+ static void CreateFile(const std::string& filepath)
+ {
+ int fh = g_creat(filepath.c_str(), _S_IREAD | _S_IWRITE);
+ if(fh != -1) {
+ close(fh);
+ }
+ }
+ static void DeleteFile(const std::string& filepath)
+ {
+ if(FileExists(filepath)){
+ g_remove(filepath.c_str());
+ }
+ }
+ static bool FileExists(const std::string& filepath)
+ {
+ return(g_access(filepath.c_str(), 0)==0);
}
std::string Convert(const std::wstring & ws)
@@ -312,4 +439,4 @@ struct EnchantTestFixture
}
};
-#endif \ No newline at end of file
+#endif
diff --git a/unittests/broker/enchant_broker_describe_tests.cpp b/unittests/broker/enchant_broker_describe_tests.cpp
index 3b80a39..95114b2 100644
--- a/unittests/broker/enchant_broker_describe_tests.cpp
+++ b/unittests/broker/enchant_broker_describe_tests.cpp
@@ -71,12 +71,7 @@ struct EnchantBrokerNoProvidersTestFixture : EnchantTestFixture
//Setup
EnchantBrokerNoProvidersTestFixture()
{
-#ifdef _WIN32
- SetRegistryHomeDir("someplace_that_does_not_exist");
- SetUserRegistryModuleDir("someplace_that_does_not_exist");
- SetUserRegistryConfigDir("someplace_that_does_not_exist");
-#endif
- _broker = enchant_broker_init ();
+ _broker = enchant_broker_init ();
}
//Teardown
diff --git a/unittests/provider/enchant_provider_get_config_home_dir_tests.cpp b/unittests/provider/enchant_provider_get_user_config_dirs_tests.cpp
index 391eb56..7a4facd 100644
--- a/unittests/provider/enchant_provider_get_config_home_dir_tests.cpp
+++ b/unittests/provider/enchant_provider_get_user_config_dirs_tests.cpp
@@ -41,45 +41,82 @@
*/
#ifdef _WIN32
TEST_FIXTURE(EnchantTestFixture,
- GetUserConfigDir_FromRegistry)
+ GetUserConfigDir_FromRegistryConfigDataDir)
{
std::string configDir("here I am");
SetUserRegistryConfigDir(configDir);
- char * enchantUserConfigDir = enchant_get_user_config_dir();
+ GSList * enchantUserConfigDirs = enchant_get_user_config_dirs();
- CHECK(enchantUserConfigDir);
- CHECK_EQUAL(configDir, enchantUserConfigDir);
+ CHECK(enchantUserConfigDirs);
+ CHECK_EQUAL(configDir, (gchar*) enchantUserConfigDirs->data);
- g_free(enchantUserConfigDir);
+ g_slist_free(enchantUserConfigDirs);
}
TEST_FIXTURE(EnchantTestFixture,
- GetUserConfigDir_BlankFromRegistry_RegistryEntryIgnored)
+ GetUserConfigDir_BlankFromRegistryConfigDataDir_RegistryEntryIgnored)
{
std::string configDir("");
SetUserRegistryConfigDir(configDir);
- char * enchantUserConfigDir = enchant_get_user_config_dir();
+ GSList * enchantUserConfigDirs = enchant_get_user_config_dirs();
- CHECK(enchantUserConfigDir);
+ CHECK(enchantUserConfigDirs);
- CHECK_EQUAL(GetEnchantHomeDirFromBase(g_get_user_config_dir()), enchantUserConfigDir);
+ CHECK_EQUAL(GetEnchantHomeDirFromBase(g_get_user_config_dir()), (gchar*) enchantUserConfigDirs->data);
- g_free(enchantUserConfigDir);
+ g_slist_free(enchantUserConfigDirs);
}
+
+TEST_FIXTURE(EnchantTestFixture,
+ GetUserConfigDir_FromRegistryConfigHomeDir)
+{
+ std::string homeDir("here I am");
+ SetRegistryHomeDir(homeDir);
+
+ GSList * enchantUserConfigDirs = enchant_get_user_config_dirs();
+
+ CHECK(enchantUserConfigDirs);
+ GSList* iter = enchantUserConfigDirs->next;
+ CHECK(iter);
+
+ CHECK_EQUAL(GetEnchantHomeDirFromBase(homeDir), (gchar*) iter->data);
+
+ g_slist_free(enchantUserConfigDirs);
+}
+
+TEST_FIXTURE(EnchantTestFixture,
+ GetUserConfigDir_BlankFromRegistryConfigHomeDir_RegistryEntryIgnored)
+{
+ std::string homeDir("");
+ SetRegistryHomeDir(homeDir);
+
+ GSList * enchantUserConfigDirs = enchant_get_user_config_dirs();
+
+ CHECK(enchantUserConfigDirs);
+ GSList* iter = enchantUserConfigDirs->next;
+ CHECK(iter);
+
+ CHECK_EQUAL(GetEnchantHomeDirFromBase(g_get_home_dir()), (gchar*) iter->data);
+
+ g_slist_free(enchantUserConfigDirs);
+}
+
#endif
TEST_FIXTURE(EnchantTestFixture,
GetUserConfigDir)
{
- char * enchantUserConfigDir = enchant_get_user_config_dir();
+ GSList * enchantUserConfigDirs = enchant_get_user_config_dirs();
- CHECK(enchantUserConfigDir);
+ CHECK(enchantUserConfigDirs);
+ GSList* iter = enchantUserConfigDirs;
#ifdef _WIN32
- CHECK_EQUAL(GetEnchantHomeDirFromBase(g_get_user_config_dir()), enchantUserConfigDir);
-#else
- CHECK_EQUAL(GetEnchantHomeDirFromBase(g_get_home_dir()), enchantUserConfigDir);
+ CHECK_EQUAL(GetEnchantHomeDirFromBase(g_get_user_config_dir()), (gchar*) iter->data);
+ iter = iter->next;
#endif
- g_free(enchantUserConfigDir);
+
+ CHECK_EQUAL(GetEnchantHomeDirFromBase(g_get_home_dir()), (gchar*) iter->data);
+ g_slist_free(enchantUserConfigDirs);
} \ No newline at end of file
diff --git a/unittests/provider/enchant_provider_get_user_home_dir_tests.cpp b/unittests/provider/enchant_provider_get_user_home_dir_tests.cpp
deleted file mode 100644
index 6cab018..0000000
--- a/unittests/provider/enchant_provider_get_user_home_dir_tests.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Copyright (c) 2007 Eric Scott Albright
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include "../EnchantTestFixture.h"
-#include <UnitTest++.h>
-#include <enchant-provider.h>
-
-/**
- * enchant_get_user_home_dir
- *
- * Returns: the user's home directory, or %null. Returned value
- * must be free'd.
- *
- * This API is private to the providers.
- */
-
-/*
- * The user's home directory on windows can be overridden using the registry
- * setting HKEY_CURRENT_USER\Software\Enchant\Config\Home_Dir
- */
-#ifdef _WIN32
-TEST_FIXTURE(EnchantTestFixture,
- GetUserHomeDir_FromRegistry)
-{
- std::string homeDir("here I am");
- SetRegistryHomeDir(homeDir);
-
- char * enchantUserHomeDir = enchant_get_user_home_dir();
-
- CHECK(enchantUserHomeDir);
- CHECK_EQUAL(homeDir, enchantUserHomeDir);
-
- g_free(enchantUserHomeDir);
-}
-
-TEST_FIXTURE(EnchantTestFixture,
- GetUserHomeDir_BlankFromRegistry_RegistryEntryIgnored)
-{
- std::string homeDir("");
- SetRegistryHomeDir(homeDir);
-
- char * enchantUserHomeDir = enchant_get_user_home_dir();
-
- CHECK(enchantUserHomeDir);
- CHECK_EQUAL(g_get_home_dir(), enchantUserHomeDir);
-
- g_free(enchantUserHomeDir);
-}
-#endif
-
-TEST_FIXTURE(EnchantTestFixture,
- GetUserHomeDir)
-{
- char * enchantUserHomeDir = enchant_get_user_home_dir();
-
- CHECK(enchantUserHomeDir);
- CHECK_EQUAL(g_get_home_dir(), enchantUserHomeDir);
-
- g_free(enchantUserHomeDir);
-} \ No newline at end of file