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

Unified Diff: tests/Test.cpp

Issue 14447018: Avoid side effects related to skia error callbacks in the testing infrastructure (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: missing include Created 7 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/Test.cpp
diff --git a/tests/Test.cpp b/tests/Test.cpp
index 5558a0be5ecc7f415a4eaa370ed321d47893ec1d..f8f2e62610e57b1807903c051ade7466471a6e16 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);
+
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698