diff options
author | mtklein <mtklein@google.com> | 2014-06-08 07:02:47 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-06-08 07:02:47 -0700 |
commit | 91359bed48bc006a4319da86eb26db3b2e6d4afb (patch) | |
tree | 923d1ac57009191855db0b4a49b487d9bf39a283 /tests/Test.cpp | |
parent | 643b8bd6617e333f7a970a57ad9166f3d6675d1a (diff) |
Revert of Clean up Test's resourcePath code. (https://codereview.chromium.org/319473003/)
Reason for revert:
Some benchmarks are written in a way that makes this change unsafe (e.g. const char* resPath = GetResourcePath().c_str(); in SkipZeroesBench) and Valgrind and ASAN caught that. We can try again after a more careful cleanup of GetResourcePath().
Original issue's description:
> Clean up resourcePath code.
>
> 1) Make the implementation of SetResourcePath/GetResourcePath of GM and SkBenchmark match with the one in Test.
> 2) Make gResourcePath a static pointer to const char and move it inside the classes.
>
> BUG=None
> TEST=make tests && out/Debug/tests
> make gm && out/Debug/gm
> make bench && out/Debug/bench
> R=mtklein@google.com
>
> Committed: https://skia.googlesource.com/skia/+/52e4f413ffe2d281f9e90ff2147db08083ffcba7
R=tfarina@chromium.org
TBR=tfarina@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=None
Author: mtklein@google.com
Review URL: https://codereview.chromium.org/320733002
Diffstat (limited to 'tests/Test.cpp')
-rw-r--r-- | tests/Test.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/Test.cpp b/tests/Test.cpp index b904d5a76d..e57427a354 100644 --- a/tests/Test.cpp +++ b/tests/Test.cpp @@ -1,10 +1,10 @@ + /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ - #include "Test.h" #include "SkCommandLineFlags.h" @@ -41,8 +41,6 @@ void Reporter::endTest(Test* test) { /////////////////////////////////////////////////////////////////////////////// -const char* Test::gResourcePath; - Test::Test() : fReporter(NULL), fPassed(true) {} Test::~Test() { @@ -123,9 +121,8 @@ SkString Test::GetTmpDir() { return SkString(tmpDir); } -void Test::SetResourcePath(const char* resourcePath) { - gResourcePath = resourcePath; -} +static const char* gResourcePath = NULL; +void Test::SetResourcePath(const char* resourcePath) { gResourcePath = resourcePath; } SkString Test::GetResourcePath() { return SkString(gResourcePath); |