X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Ftests%2Fxestiacalendar_commonfunctions.h;h=1b8af0b4a50ccbb2a533fc20f54338d9a2d6a55a;hb=b21ea336e08289c984eccd4baeefdb67e5901281;hp=e667aa6ee7e0610e05eb1095086fac82e90fa1d3;hpb=d22dbc7054f255d8df75b273f8f2df625aab5aa2;p=xestiacalendar%2F.git diff --git a/source/tests/xestiacalendar_commonfunctions.h b/source/tests/xestiacalendar_commonfunctions.h index e667aa6..1b8af0b 100644 --- a/source/tests/xestiacalendar_commonfunctions.h +++ b/source/tests/xestiacalendar_commonfunctions.h @@ -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;