diff options
author | Dan Albert <danalbert@google.com> | 2014-10-16 20:47:51 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2014-11-04 17:19:55 -0800 |
commit | 27d166cb3aecc003b2ea576ec23695aff78de1a5 (patch) | |
tree | bf74b1d1b951199d2b6a48411ea477401c047521 /libutils/tests/LruCache_test.cpp | |
parent | a11ac45536f0722becefccdb6b58378c5d9d0d4b (diff) | |
download | system_core-27d166cb3aecc003b2ea576ec23695aff78de1a5.zip system_core-27d166cb3aecc003b2ea576ec23695aff78de1a5.tar.gz system_core-27d166cb3aecc003b2ea576ec23695aff78de1a5.tar.bz2 |
Clean up some test makefiles.
Needed for building with libc++ as the default STL.
Bug: 15193147
Change-Id: I8b462bd288fbea7e0ab182f85ffcbf438afb6aa4
Diffstat (limited to 'libutils/tests/LruCache_test.cpp')
-rw-r--r-- | libutils/tests/LruCache_test.cpp | 15 |
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) { } |