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

Side by Side Diff: tests/DynamicHashTest.cpp

Issue 26962002: Remove unnamed namespace usage from tests. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: revert AreEqual change Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/FillPathTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
1 #include "Test.h" 8 #include "Test.h"
2 #include "SkTDynamicHash.h" 9 #include "SkTDynamicHash.h"
3 10
4 namespace { 11 namespace {
5 12
6 struct Entry { 13 struct Entry {
7 int key; 14 int key;
8 double value; 15 double value;
9 }; 16 };
17
10 const int& GetKey(const Entry& entry) { return entry.key; } 18 const int& GetKey(const Entry& entry) { return entry.key; }
11 uint32_t GetHash(const int& key) { return key; } 19 uint32_t GetHash(const int& key) { return key; }
12 bool AreEqual(const Entry& entry, const int& key) { return entry.key == key; } 20 bool AreEqual(const Entry& entry, const int& key) { return entry.key == key; }
13 21
14
15 class Hash : public SkTDynamicHash<Entry, int, GetKey, GetHash, AreEqual> { 22 class Hash : public SkTDynamicHash<Entry, int, GetKey, GetHash, AreEqual> {
16 public: 23 public:
17 Hash() : INHERITED() {} 24 Hash() : INHERITED() {}
18 Hash(int capacity) : INHERITED(capacity) {} 25 Hash(int capacity) : INHERITED(capacity) {}
19 26
20 // Promote protected methods to public for this test. 27 // Promote protected methods to public for this test.
21 int capacity() const { return this->INHERITED::capacity(); } 28 int capacity() const { return this->INHERITED::capacity(); }
22 int countCollisions(const int& key) const { return this->INHERITED::countCol lisions(key); } 29 int countCollisions(const int& key) const { return this->INHERITED::countCol lisions(key); }
23 30
24 private: 31 private:
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 141
135 static void test_dynamic_hash(skiatest::Reporter* reporter) { 142 static void test_dynamic_hash(skiatest::Reporter* reporter) {
136 test_growth(reporter); 143 test_growth(reporter);
137 test_add(reporter); 144 test_add(reporter);
138 test_lookup(reporter); 145 test_lookup(reporter);
139 test_remove(reporter); 146 test_remove(reporter);
140 } 147 }
141 148
142 #include "TestClassDef.h" 149 #include "TestClassDef.h"
143 DEFINE_TESTCLASS("DynamicHash", DynamicHashTestClass, test_dynamic_hash); 150 DEFINE_TESTCLASS("DynamicHash", DynamicHashTestClass, test_dynamic_hash);
OLDNEW
« no previous file with comments | « no previous file | tests/FillPathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698