diff options
author | humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-25 18:33:49 +0000 |
---|---|---|
committer | humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-25 18:33:49 +0000 |
commit | 8dd94f0931b9f5839ce1b89f1489ba871517af39 (patch) | |
tree | fa4be31c601193f67b000927b450005bf7db2f70 /tests/Test.cpp | |
parent | 49ce11ba14b044d98c3a44e3b2c19903fcdabaa5 (diff) |
Avoid side effects related to skia error callbacks in the testing infrastructure
BUG=
Review URL: https://codereview.chromium.org/14447018
git-svn-id: http://skia.googlecode.com/svn/trunk@8867 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/Test.cpp')
-rw-r--r-- | tests/Test.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/Test.cpp b/tests/Test.cpp index 5558a0be5e..f8f2e62610 100644 --- a/tests/Test.cpp +++ b/tests/Test.cpp @@ -10,6 +10,7 @@ #include "SkString.h" #include "SkTArray.h" #include "SkTime.h" +#include "SkError.h" #if SK_SUPPORT_GPU #include "GrContext.h" @@ -92,6 +93,10 @@ namespace { } // namespace void Test::run() { + // Clear the Skia error callback before running any test, to ensure that tests + // don't have unintended side effects when running more than one. + SkSetErrorCallback( NULL, NULL ); + // Tell (likely shared) fReporter that this test has started. fReporter->startTest(this); @@ -108,6 +113,7 @@ void Test::run() { fReporter->report(local.failure(i), Reporter::kFailed); } fReporter->endTest(this); + } /////////////////////////////////////////////////////////////////////////////// |