Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added initial common functions unit tests.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 20 Mar 2016 13:49:07 +0000 (13:49 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 20 Mar 2016 13:49:07 +0000 (13:49 +0000)
source/tests/xestiaab_common.h [new file with mode: 0644]

diff --git a/source/tests/xestiaab_common.h b/source/tests/xestiaab_common.h
new file mode 100644 (file)
index 0000000..3bc6126
--- /dev/null
@@ -0,0 +1,68 @@
+ // xestiaab_common.h - Xestia Address Book Common Functions Unit Tests.
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
+
+#include <gtest/gtest.h>
+#include "../common/dirs.h"
+
+TEST(CommonFunctions, GetUserDir){
+       
+       // 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/<user>/.xestiaab
+       
+       wxString UserDirCheck = "";
+       UserDirCheck.Append(wxString::FromUTF8(getenv("HOME")));
+       UserDirCheck.Append(wxT("/.xestiaab/"));
+       
+       wxString UserDir = GetUserDir();
+       
+       ASSERT_EQ(UserDir, UserDirCheck);
+       
+#endif
+       
+}
+
+TEST(CommonFunctions, GetUserPrefDir){
+       
+       // 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/<user>/.xestiaab/preferences
+       
+       wxString UserDirCheck = "";
+       UserDirCheck.Append(wxString::FromUTF8(getenv("HOME")));
+       UserDirCheck.Append(wxT("/.xestiaab/preferences/"));
+       
+       wxString UserDir = GetUserPrefDir();
+       
+       ASSERT_EQ(UserDir, UserDirCheck);
+       
+#endif
+       
+}
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy