Fix bug in setting directories for tests.
make_canonical_dir_path only worked if the provided directory
did not end with a slash. Remove this function, and call
SkPathJoin instead. Update the documentation to acknowledge
that this is an acceptable use of SkPathJoin, and update its
test.
R=epoger@google.com
Review URL: https://codereview.chromium.org/16098011
git-svn-id: http://skia.googlecode.com/svn/trunk@9458 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp
index 8f38f46..00c079a 100644
--- a/tests/StreamTest.cpp
+++ b/tests/StreamTest.cpp
@@ -35,8 +35,7 @@
}
static void test_filestreams(skiatest::Reporter* reporter, const char* tmpDir) {
- SkString path;
- path.printf("%s%s", tmpDir, "wstream_test");
+ SkString path = SkOSPath::SkPathJoin(tmpDir, "wstream_test");
const char s[] = "abcdefghijklmnopqrstuvwxyz";
@@ -98,8 +97,9 @@
}
delete[] dst;
- if (!skiatest::Test::GetTmpDir().isEmpty()) {
- test_filestreams(reporter, skiatest::Test::GetTmpDir().c_str());
+ SkString tmpDir = skiatest::Test::GetTmpDir();
+ if (!tmpDir.isEmpty()) {
+ test_filestreams(reporter, tmpDir.c_str());
}
}