aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTobia Tesan2016-12-26 11:55:06 +0100
committerTobia Tesan2016-12-26 12:05:41 +0100
commit72376681afad3e57ffa2134d76ad649a38c86023 (patch)
tree2703dc08691260642a8604283909cf543dce08f3 /test
parent93394902368a0fb2c25647f0d6205f5a43282933 (diff)
downloadscummvm-rg350-72376681afad3e57ffa2134d76ad649a38c86023.tar.gz
scummvm-rg350-72376681afad3e57ffa2134d76ad649a38c86023.tar.bz2
scummvm-rg350-72376681afad3e57ffa2134d76ad649a38c86023.zip
WINTERMUTE: Try to "correctly" handle dir paths
I put scare quotes around "correctly" because I can't swear this is the intended behaviour of the original interpreter. I don't think accessing filenames that end with / in the .DCPs is even defined behaviour, so this is a best guess.
Diffstat (limited to 'test')
-rw-r--r--test/engines/wintermute/path_utils.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/engines/wintermute/path_utils.h b/test/engines/wintermute/path_utils.h
index 3cacf47fd9..26f3404396 100644
--- a/test/engines/wintermute/path_utils.h
+++ b/test/engines/wintermute/path_utils.h
@@ -23,6 +23,8 @@ class PathUtilTestSuite : public CxxTest::TestSuite {
const Common::String mixedSlashesPath2;
const Common::String unixRelativePath;
const Common::String windowsRelativePath;
+ const Common::String unixDirPath;
+ const Common::String windowsDirPath;
PathUtilTestSuite () :
unixPath("/some/file.ext"),
unixCapPath("/SOME/FILE.EXT"),
@@ -34,7 +36,9 @@ class PathUtilTestSuite : public CxxTest::TestSuite {
mixedSlashesPath1("C:\\this/IS_REALLY\\weird.exe"),
mixedSlashesPath2("/pretty\\weird/indeed.txt"),
unixRelativePath("some/file.ext"),
- windowsRelativePath("some\\file.ext")
+ windowsRelativePath("some\\file.ext"),
+ unixDirPath("/some/dir/"),
+ windowsDirPath("C:\\some\\dir\\")
{}
void test_getdirectoryname() {
TS_ASSERT_EQUALS(
@@ -57,6 +61,14 @@ class PathUtilTestSuite : public CxxTest::TestSuite {
Wintermute::PathUtil::getDirectoryName(emptyString),
Common::String("")
);
+ TS_ASSERT_EQUALS(
+ Wintermute::PathUtil::getDirectoryName(unixDirPath),
+ Common::String("/some/dir/")
+ );
+ TS_ASSERT_EQUALS(
+ Wintermute::PathUtil::getDirectoryName(windowsDirPath),
+ Common::String("C:\\some\\dir\\")
+ );
}
void test_getfilename() {