diff options
author | tfarina@chromium.org <tfarina@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-21 23:39:22 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-21 23:39:22 +0000 |
commit | 58674817a7a5003556a1d0b5b8fa522782a729fa (patch) | |
tree | 939ba9acc70963fcd1db2065d37137cbde0b7b49 /tests/Test.cpp | |
parent | 34f47f9e7c0dec305a73e044cdf893315c489ff7 (diff) |
Remove unnamed namespace usage from tests/
Skia preference is to use 'static' keyword rather than use unnamed
namespace.
BUG=None
TEST=tests
R=robertphillips@google.com, bsalomon@google.com
Review URL: https://codereview.chromium.org/132403008
git-svn-id: http://skia.googlecode.com/svn/trunk@13138 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/Test.cpp')
-rw-r--r-- | tests/Test.cpp | 72 |
1 files changed, 35 insertions, 37 deletions
diff --git a/tests/Test.cpp b/tests/Test.cpp index fe0f7c4a6b..994a342128 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); |