summaryrefslogtreecommitdiffstats
path: root/libutils/tests/LruCache_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libutils/tests/LruCache_test.cpp')
-rw-r--r--libutils/tests/LruCache_test.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/libutils/tests/LruCache_test.cpp b/libutils/tests/LruCache_test.cpp
index bcbea32..6534211 100644
--- a/libutils/tests/LruCache_test.cpp
+++ b/libutils/tests/LruCache_test.cpp
@@ -20,7 +20,7 @@
#include <cutils/log.h>
#include <gtest/gtest.h>
-namespace android {
+namespace {
typedef int SimpleKey;
typedef const char* StringValue;
@@ -53,10 +53,6 @@ struct ComplexKey {
ssize_t ComplexKey::instanceCount = 0;
-template<> inline hash_t hash_type(const ComplexKey& value) {
- return hash_type(value.k);
-}
-
struct ComplexValue {
int v;
@@ -77,8 +73,17 @@ struct ComplexValue {
ssize_t ComplexValue::instanceCount = 0;
+} // namespace
+
+
+namespace android {
+
typedef LruCache<ComplexKey, ComplexValue> ComplexCache;
+template<> inline android::hash_t hash_type(const ComplexKey& value) {
+ return hash_type(value.k);
+}
+
class EntryRemovedCallback : public OnEntryRemoved<SimpleKey, StringValue> {
public:
EntryRemovedCallback() : callbackCount(0), lastKey(-1), lastValue(NULL) { }