Chromium Code Reviews| Index: tests/Test.cpp |
| diff --git a/tests/Test.cpp b/tests/Test.cpp |
| index fe0f7c4a6b8f8b4631e030b9478abb3d4019c3fd..67e300de91c4f6b04e2d9d2c45f3c720ebdc79e6 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 failure_size() const { return fFailures.count(); } |
|
robertphillips
2014/01/14 13:19:37
failureSize? numFailures would probably be better
|
| + const SkString& failure(int i) const { return fFailures[i]; } |
| + |
| +protected: |
|
robertphillips
2014/01/14 13:19:37
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 |