Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added the SplitPathFilename subroutine and unit tests
[xestiacalendar/.git] / source / tests / xestiacalendar_commonfunctions.h
index e667aa6..1b8af0b 100644 (file)
@@ -261,6 +261,39 @@ TEST(CommonFunctions, HexToInt){
 
 }
 
+TEST(CommonFunctions, SplitPathFilename){
+       
+       // Setup the file split.
+       
+       string PathFilenameOriginal = "/example/file/yay.txt";
+       string Path = "";
+       string File = "";
+       
+       SplitPathFilename(&PathFilenameOriginal, &Path, &File);
+       
+       ASSERT_EQ("/example/file/", Path);
+       ASSERT_EQ("yay.txt", File);
+       
+       PathFilenameOriginal = "/a/path/with/lots/of/bits/in/andthenthis.html";
+       Path.clear();
+       File.clear();
+       
+       SplitPathFilename(&PathFilenameOriginal, &Path, &File);
+       
+       ASSERT_EQ("/a/path/with/lots/of/bits/in/", Path);
+       ASSERT_EQ("andthenthis.html", File);
+
+       PathFilenameOriginal = "/one/more/for/a/laugh/hahaha.zip";
+       Path.clear();
+       File.clear();
+       
+       SplitPathFilename(&PathFilenameOriginal, &Path, &File);
+       
+       ASSERT_EQ("/one/more/for/a/laugh/", Path);
+       ASSERT_EQ("hahaha.zip", File);
+
+}
+
 TEST(CommonFunctions, ColourStruct){
        
        Colour Colour1;
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