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

Unified Diff: tests/Test.cpp

Issue 13983011: Also proxy bumpTestCount. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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 | « tests/Test.h ('k') | 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 07db96953e7bc01a2603c5adf65c7d44e386a5d1..5558a0be5ecc7f415a4eaa370ed321d47893ec1d 100644
--- a/tests/Test.cpp
+++ b/tests/Test.cpp
@@ -60,7 +60,7 @@ const char* Test::getName() {
namespace {
class LocalReporter : public Reporter {
public:
- explicit LocalReporter(const Reporter& reporterToMimic) : fReporter(reporterToMimic) {}
+ explicit LocalReporter(Reporter* reporterToMimic) : fReporter(reporterToMimic) {}
int failure_size() const { return fFailures.count(); }
const char* failure(int i) const { return fFailures[i].c_str(); }
@@ -72,16 +72,21 @@ namespace {
}
}
+ // Proxy down to fReporter. We assume these calls are threadsafe.
virtual bool allowExtendedTest() const SK_OVERRIDE {
- return fReporter.allowExtendedTest();
+ return fReporter->allowExtendedTest();
}
virtual bool allowThreaded() const SK_OVERRIDE {
- return fReporter.allowThreaded();
+ return fReporter->allowThreaded();
+ }
+
+ virtual void bumpTestCount() SK_OVERRIDE {
+ fReporter->bumpTestCount();
}
private:
- const Reporter& fReporter;
+ Reporter* fReporter; // Unowned.
SkTArray<SkString> fFailures;
};
} // namespace
@@ -93,7 +98,7 @@ void Test::run() {
const SkMSec start = SkTime::GetMSecs();
// Run the test into a LocalReporter so we know if it's passed or failed without interference
// from other tests that might share fReporter.
- LocalReporter local(*fReporter);
+ LocalReporter local(fReporter);
this->onRun(&local);
fPassed = local.failure_size() == 0;
fElapsed = SkTime::GetMSecs() - start;
« no previous file with comments | « tests/Test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698