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

Unified Diff: Source/wtf/HashMapTest.cpp

Issue 1184043002: Fix unit test style in Source/wtf/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: apply review comments Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/FunctionalTest.cpp ('k') | Source/wtf/HashSetTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/HashMapTest.cpp
diff --git a/Source/wtf/HashMapTest.cpp b/Source/wtf/HashMapTest.cpp
index 6fe352e06ab685ad4be453f54e746d88b5a2c234..cbdbca6eb6c1c11b65ad3537b508e6267e0067ea 100644
--- a/Source/wtf/HashMapTest.cpp
+++ b/Source/wtf/HashMapTest.cpp
@@ -24,8 +24,8 @@
*/
#include "config.h"
-
#include "wtf/HashMap.h"
+
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/PassRefPtr.h"
@@ -33,9 +33,11 @@
#include "wtf/Vector.h"
#include <gtest/gtest.h>
+namespace WTF {
+
namespace {
-typedef WTF::HashMap<int, int> IntHashMap;
+using IntHashMap = HashMap<int, int>;
TEST(HashMapTest, IteratorComparison)
{
@@ -59,9 +61,9 @@ struct TestDoubleHashTraits : HashTraits<double> {
static const unsigned minimumTableSize = 8;
};
-typedef HashMap<double, int64_t, DefaultHash<double>::Hash, TestDoubleHashTraits> DoubleHashMap;
+using DoubleHashMap = HashMap<double, int64_t, DefaultHash<double>::Hash, TestDoubleHashTraits>;
-static int bucketForKey(double key)
+int bucketForKey(double key)
{
return DefaultHash<double>::Hash::hash(key) & (TestDoubleHashTraits::minimumTableSize - 1);
}
@@ -102,7 +104,7 @@ private:
int* m_destructNumber;
};
-typedef WTF::HashMap<int, OwnPtr<DestructCounter>> OwnPtrHashMap;
+using OwnPtrHashMap = HashMap<int, OwnPtr<DestructCounter>>;
TEST(HashMapTest, OwnPtrAsValue)
{
@@ -137,8 +139,7 @@ TEST(HashMapTest, OwnPtrAsValue)
EXPECT_EQ(2, destructNumber);
}
-
-class DummyRefCounted: public WTF::RefCounted<DummyRefCounted> {
+class DummyRefCounted : public RefCounted<DummyRefCounted> {
public:
DummyRefCounted(bool& isDeleted) : m_isDeleted(isDeleted) { m_isDeleted = false; }
~DummyRefCounted()
@@ -242,7 +243,7 @@ public:
private:
int m_v;
};
-typedef HashMap<int, OwnPtr<SimpleClass>> IntSimpleMap;
+using IntSimpleMap = HashMap<int, OwnPtr<SimpleClass>>;
TEST(HashMapTest, AddResult)
{
@@ -302,4 +303,6 @@ TEST(HashMapTest, ValueTypeDestructed)
EXPECT_EQ(0, InstanceCounter::counter);
}
-} // namespace
+} // anonymous namespace
+
+} // namespace WTF
« no previous file with comments | « Source/wtf/FunctionalTest.cpp ('k') | Source/wtf/HashSetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698