X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Ftests%2Fxestiaab_common.h;h=3dafa80926cd6940477baa1b2fa22ab7d9ef1942;hb=37db4740a4c7b83b25da0450ba95d6de8c1c42ec;hp=248582e8f69b5ac24c7cfdff56e51f057eb5d864;hpb=d4087a12e1dccd74c089f2583500578fa5e59212;p=xestiaab%2F.git diff --git a/source/tests/xestiaab_common.h b/source/tests/xestiaab_common.h index 248582e..3dafa80 100644 --- a/source/tests/xestiaab_common.h +++ b/source/tests/xestiaab_common.h @@ -18,6 +18,7 @@ #include #include "../common/dirs.h" +#include "../common/filename.h" TEST(CommonFunctions, GetUserDir){ @@ -177,4 +178,50 @@ TEST(CommonFunctions, GetAccountsFile){ #endif +} + +TEST(CommonFunctions, GetSettingsFile){ + + // Run the unit tests depending on the operating system being used. + +#if defined(__WIN32__) + +#elif defined(__APPLE__) + +#else + + // Setup for comparison purposes. Should be + // /home//.xestiaab/preferences/accounts + + wxString SettingsFileCheck = ""; + SettingsFileCheck.Clear(); + SettingsFileCheck.Append(wxString::FromUTF8(getenv("HOME"))); + SettingsFileCheck.Append(wxT("/.xestiaab/preferences/settings")); + + wxString SettingsFile = GetSettingsFile(); + + ASSERT_EQ(SettingsFile, SettingsFileCheck); + +#endif + +} + +TEST(CommonFunctions, CreateFilenamePath){ + + // Run the unit tests depending on the operating system being used. + +#if defined(__WIN32__) + +#elif defined(__APPLE__) + +#else + + ASSERT_EQ("/test", CreateFilenamePath("", "test")); + ASSERT_EQ("/example/test", CreateFilenamePath("/example", "test")); + ASSERT_EQ("/home/meep/test", CreateFilenamePath("/home/meep", "test")); + ASSERT_EQ("/home/meep/moo/test", CreateFilenamePath("/home/meep/moo", "test")); + ASSERT_EQ("/home/meep/moo/yargh/test", CreateFilenamePath("/home/meep/moo/yargh", "test")); + +#endif + } \ No newline at end of file