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

Side by Side Diff: tests/DynamicHashTest.cpp

Issue 100113004: Use DEFINE_TESTCLASS_SHORT macro in tests. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years 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 | « tests/DrawTextTest.cpp ('k') | tests/EmptyPathTest.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 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Test.h" 8 #include "Test.h"
9 #include "TestClassDef.h"
9 #include "SkTDynamicHash.h" 10 #include "SkTDynamicHash.h"
10 11
11 namespace { 12 namespace {
12 13
13 struct Entry { 14 struct Entry {
14 int key; 15 int key;
15 double value; 16 double value;
16 }; 17 };
17 18
18 const int& GetKey(const Entry& entry) { return entry.key; } 19 const int& GetKey(const Entry& entry) { return entry.key; }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 133
133 // This will go in the same slot as 'a' did before. 134 // This will go in the same slot as 'a' did before.
134 ASSERT(hash.countCollisions(9) == 0); 135 ASSERT(hash.countCollisions(9) == 0);
135 hash.add(&c); 136 hash.add(&c);
136 ASSERT(hash.find(9) != NULL); 137 ASSERT(hash.find(9) != NULL);
137 ASSERT(hash.find(9)->value == 4.0); 138 ASSERT(hash.find(9)->value == 4.0);
138 ASSERT(hash.find(5) != NULL); 139 ASSERT(hash.find(5) != NULL);
139 ASSERT(hash.find(5)->value == 3.0); 140 ASSERT(hash.find(5)->value == 3.0);
140 } 141 }
141 142
142 static void test_dynamic_hash(skiatest::Reporter* reporter) { 143 DEF_TEST(DynamicHash, reporter) {
143 test_growth(reporter); 144 test_growth(reporter);
144 test_add(reporter); 145 test_add(reporter);
145 test_lookup(reporter); 146 test_lookup(reporter);
146 test_remove(reporter); 147 test_remove(reporter);
147 } 148 }
148
149 #include "TestClassDef.h"
150 DEFINE_TESTCLASS("DynamicHash", DynamicHashTestClass, test_dynamic_hash);
OLDNEW
« no previous file with comments | « tests/DrawTextTest.cpp ('k') | tests/EmptyPathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698