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

Unified Diff: tests/Test.cpp

Issue 132403008: Remove unnamed namespace usage from tests/ (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: SK_OVERRIDE Created 6 years, 11 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/PixelRefTest.cpp ('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 fe0f7c4a6b8f8b4631e030b9478abb3d4019c3fd..994a342128781d0b2fb816bcc2a45a7f41adf5fc 100644
--- a/tests/Test.cpp
+++ b/tests/Test.cpp
@@ -56,41 +56,39 @@ const char* Test::getName() {
return fName.c_str();
}
-namespace {
- class LocalReporter : public Reporter {
- public:
- explicit LocalReporter(Reporter* reporterToMimic) : fReporter(reporterToMimic) {}
-
- int failure_size() const { return fFailures.count(); }
- const SkString& failure(int i) const { return fFailures[i]; }
-
- protected:
- void onReportFailed(const SkString& desc) SK_OVERRIDE {
- fFailures.push_back(desc);
- }
-
- // Proxy down to fReporter. We assume these calls are threadsafe.
- virtual bool allowExtendedTest() const SK_OVERRIDE {
- return fReporter->allowExtendedTest();
- }
-
- virtual bool allowThreaded() const SK_OVERRIDE {
- return fReporter->allowThreaded();
- }
-
- virtual void bumpTestCount() SK_OVERRIDE {
- fReporter->bumpTestCount();
- }
-
- virtual bool verbose() const SK_OVERRIDE {
- return fReporter->verbose();
- }
-
- private:
- Reporter* fReporter; // Unowned.
- SkTArray<SkString> fFailures;
- };
-} // namespace
+class LocalReporter : public Reporter {
+public:
+ explicit LocalReporter(Reporter* reporterToMimic) : fReporter(reporterToMimic) {}
+
+ int numFailures() const { return fFailures.count(); }
+ const SkString& failure(int i) const { return fFailures[i]; }
+
+protected:
+ virtual void onReportFailed(const SkString& desc) SK_OVERRIDE {
+ fFailures.push_back(desc);
+ }
+
+ // Proxy down to fReporter. We assume these calls are threadsafe.
+ virtual bool allowExtendedTest() const SK_OVERRIDE {
+ return fReporter->allowExtendedTest();
+ }
+
+ virtual bool allowThreaded() const SK_OVERRIDE {
+ return fReporter->allowThreaded();
+ }
+
+ virtual void bumpTestCount() SK_OVERRIDE {
+ fReporter->bumpTestCount();
+ }
+
+ virtual bool verbose() const SK_OVERRIDE {
+ return fReporter->verbose();
+ }
+
+private:
+ Reporter* fReporter; // Unowned.
+ SkTArray<SkString> fFailures;
+};
void Test::run() {
// Clear the Skia error callback before running any test, to ensure that tests
@@ -105,11 +103,11 @@ void Test::run() {
// from other tests that might share fReporter.
LocalReporter local(fReporter);
this->onRun(&local);
- fPassed = local.failure_size() == 0;
+ fPassed = local.numFailures() == 0;
fElapsed = SkTime::GetMSecs() - start;
// Now tell fReporter about any failures and wrap up.
- for (int i = 0; i < local.failure_size(); i++) {
+ for (int i = 0; i < local.numFailures(); i++) {
fReporter->reportFailed(local.failure(i));
}
fReporter->endTest(this);
« no previous file with comments | « tests/PixelRefTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698