From 7f79ec2c095cc3ab182ad2e3841ae6b1a960b33b Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 20 Mar 2016 15:25:54 +0000 Subject: [PATCH] Added unit tests for the GetSettingsFile function. --- source/tests/xestiaab_common.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/source/tests/xestiaab_common.h b/source/tests/xestiaab_common.h index 248582e..2efff91 100644 --- a/source/tests/xestiaab_common.h +++ b/source/tests/xestiaab_common.h @@ -177,4 +177,30 @@ 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 + } \ No newline at end of file -- 2.39.5