Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added unit tests for the CreateFilenamePath function.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 20 Mar 2016 16:04:45 +0000 (16:04 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 20 Mar 2016 16:04:45 +0000 (16:04 +0000)
source/tests/xestiaab_common.h

index 2efff91..3dafa80 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <gtest/gtest.h>
 #include "../common/dirs.h"
+#include "../common/filename.h"
 
 TEST(CommonFunctions, GetUserDir){
        
@@ -203,4 +204,24 @@ TEST(CommonFunctions, GetSettingsFile){
        
 #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
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