Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Unified Diff: tests/skia_test.cpp

Issue 16098011: Fix bug in setting directories for tests. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/OSPathTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/skia_test.cpp
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index 238252d7377629e19f193b1f7de93d945fa75b0b..f6c7839609d5f2ab39151589ae7e603c477b3622 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -112,22 +112,6 @@ private:
bool fAllowThreaded;
};
-static const char* make_canonical_dir_path(const char* path, SkString* storage) {
- if (path) {
- // clean it up so it always has a trailing searator
- size_t len = strlen(path);
- if (0 == len) {
- path = NULL;
- } else if (SkPATH_SEPARATOR != path[len - 1]) {
- // resize to len + 1, to make room for searator
- storage->set(path, len + 1);
- storage->writable_str()[len] = SkPATH_SEPARATOR;
- path = storage->c_str();
- }
- }
- return path;
-}
-
static SkString gTmpDir;
epoger 2013/06/04 15:15:34 Hey, if this change fixes an existing problem, I'm
scroggo 2013/06/04 19:50:39 Done.
epoger 2013/06/05 14:34:14 My reasoning was: why use 2 global variables (gTmp
const SkString& Test::GetTmpDir() {
@@ -219,10 +203,10 @@ int tool_main(int argc, char** argv) {
SkCommandLineFlags::Parse(argc, argv);
if (!FLAGS_tmpDir.isEmpty()) {
- make_canonical_dir_path(FLAGS_tmpDir[0], &gTmpDir);
+ gTmpDir = SkOSPath::SkPathJoin(FLAGS_tmpDir[0], NULL);
}
if (!FLAGS_resourcePath.isEmpty()) {
- make_canonical_dir_path(FLAGS_resourcePath[0], &gResourcePath);
+ gResourcePath = SkOSPath::SkPathJoin(FLAGS_resourcePath[0], NULL);
}
#if SK_ENABLE_INST_COUNT
« no previous file with comments | « tests/OSPathTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698