aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/OSPathTest.cpp
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@google.com>2018-01-05 18:21:48 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-05 18:21:55 +0000
commit5ef4ebf3c464210ab0eec84e62438d6135f44f8a (patch)
tree64cce26221e9e7f8660c965e41fd12336b376cfe /tests/OSPathTest.cpp
parent88d99df31f4c181b926c61204abf61df9e4960b6 (diff)
Revert "allow both slash types"
This reverts commit 7a600416e131b33610b1c96a367b3cb2569f458e. Reason for revert: <speculative revert; may have broken nanobench> Original change's description: > allow both slash types > > Windows allows forwards and backwards slashes > for path directory delimiters. > > R=​halcanary@google.com > > Change-Id: Ie6f1257c98ac8e2468d9297b5dc391fd17f4ae82 > Reviewed-on: https://skia-review.googlesource.com/90821 > Reviewed-by: Hal Canary <halcanary@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=halcanary@google.com,bungeman@google.com,caryclark@google.com,caryclark@skia.org Change-Id: If2eefdc6dbf6b7df0280b005cea12aff4b91cf09 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/91401 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'tests/OSPathTest.cpp')
-rw-r--r--tests/OSPathTest.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/tests/OSPathTest.cpp b/tests/OSPathTest.cpp
index 74ca802304..22deff80a5 100644
--- a/tests/OSPathTest.cpp
+++ b/tests/OSPathTest.cpp
@@ -32,8 +32,7 @@ static void test_dir_with_file(skiatest::Reporter* reporter, SkString dir,
// fullName should be the combined size of dir and file, plus one if
// dir did not include the final path separator.
size_t expectedSize = dir.size() + filename.size();
- if (!dir.endsWith(SkOSPath::SEPARATOR) && ('\\' != SkOSPath::SEPARATOR ||
- !dir.endsWith('/')) && !dir.isEmpty()) {
+ if (!dir.endsWith(SkOSPath::SEPARATOR) && !dir.isEmpty()) {
expectedSize++;
}
REPORTER_ASSERT(reporter, fullName.size() == expectedSize);
@@ -47,10 +46,7 @@ static void test_dir_with_file(skiatest::Reporter* reporter, SkString dir,
// dirname should be the same as dir with any trailing seperators removed.
// Except when the the string is just "/".
SkString strippedDir = dir;
- while (strippedDir.size() > 2 &&
- (strippedDir[strippedDir.size() - 1] == SkOSPath::SEPARATOR ||
- ('\\' == SkOSPath::SEPARATOR &&
- strippedDir[strippedDir.size() - 1] == '/'))) {
+ while (strippedDir.size() > 2 && strippedDir[strippedDir.size() - 1] == SkOSPath::SEPARATOR) {
strippedDir.remove(strippedDir.size() - 1, 1);
}
if (!dirname.equals(strippedDir)) {
@@ -106,13 +102,4 @@ DEF_TEST(OSPath, reporter) {
// Test that nullptr can be used for the directory and filename.
SkString emptyPath = SkOSPath::Join(nullptr, nullptr);
REPORTER_ASSERT(reporter, emptyPath.isEmpty());
-
-#ifdef SK_BUILD_FOR_WIN
- test_dir_with_file(reporter, SkString("dir/"), filename);
- test_dir_with_file(reporter, SkString("dir/dir"), filename);
- test_dir_with_file(reporter, SkString("dir\\dir/"), filename);
- test_dir_with_file(reporter, SkString("dir/dir\\"), filename);
- test_dir_with_file(reporter, SkString("dir\\dir/dir"), filename);
- test_dir_with_file(reporter, SkString("dir/dir\\dir"), filename);
-#endif
}