Chromium Code Reviews| Index: tests/DynamicHashTest.cpp |
| diff --git a/tests/DynamicHashTest.cpp b/tests/DynamicHashTest.cpp |
| index 2425ea24cabf31e27da94b59ec84c4c08d53636a..a384bc43a73567426de79b95d440360c95dfd00e 100644 |
| --- a/tests/DynamicHashTest.cpp |
| +++ b/tests/DynamicHashTest.cpp |
| @@ -1,16 +1,23 @@ |
| +/* |
| + * Copyright 2013 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| #include "Test.h" |
| #include "SkTDynamicHash.h" |
| -namespace { |
| - |
| struct Entry { |
| int key; |
| double value; |
| }; |
| -const int& GetKey(const Entry& entry) { return entry.key; } |
| -uint32_t GetHash(const int& key) { return key; } |
| -bool AreEqual(const Entry& entry, const int& key) { return entry.key == key; } |
| +static const int& GetKey(const Entry& entry) { return entry.key; } |
|
bsalomon
2013/10/11 14:46:41
Hey Thiago, static functions cannot be used as tem
tfarina
2013/10/11 23:47:04
Done.
|
| +static uint32_t GetHash(const int& key) { return key; } |
| +static bool AreEqual(const Entry& entry, const int& key) { |
| + return entry.key == key; |
| +} |
| class Hash : public SkTDynamicHash<Entry, int, GetKey, GetHash, AreEqual> { |
| public: |
| @@ -25,8 +32,6 @@ private: |
| typedef SkTDynamicHash<Entry, int, GetKey, GetHash, AreEqual> INHERITED; |
| }; |
| -} // namespace |
| - |
| #define ASSERT(x) REPORTER_ASSERT(reporter, x) |
| static void test_growth(skiatest::Reporter* reporter) { |