| Index: runtime/vm/hash_table_test.cc
|
| diff --git a/runtime/vm/hash_table_test.cc b/runtime/vm/hash_table_test.cc
|
| index 2d597b1068aad6bb102d57ce673a733a973a183e..9c8daca94d4bd0ea9bed51fb5adf913a75d31eab 100644
|
| --- a/runtime/vm/hash_table_test.cc
|
| +++ b/runtime/vm/hash_table_test.cc
|
| @@ -26,23 +26,17 @@ class TestTraits {
|
| static bool IsMatch(const char* key, const Object& obj) {
|
| return String::Cast(obj).Equals(key);
|
| }
|
| - static uword Hash(const char* key) {
|
| - return static_cast<uword>(strlen(key));
|
| - }
|
| + static uword Hash(const char* key) { return static_cast<uword>(strlen(key)); }
|
| static bool IsMatch(const Object& a, const Object& b) {
|
| return a.IsString() && b.IsString() &&
|
| - String::Cast(a).Equals(String::Cast(b));
|
| - }
|
| - static uword Hash(const Object& obj) {
|
| - return String::Cast(obj).Length();
|
| - }
|
| - static RawObject* NewKey(const char* key) {
|
| - return String::New(key);
|
| + String::Cast(a).Equals(String::Cast(b));
|
| }
|
| + static uword Hash(const Object& obj) { return String::Cast(obj).Length(); }
|
| + static RawObject* NewKey(const char* key) { return String::New(key); }
|
| };
|
|
|
|
|
| -template<typename Table>
|
| +template <typename Table>
|
| void Validate(const Table& table) {
|
| // Verify consistency of entry state tracking.
|
| intptr_t num_entries = table.NumEntries();
|
| @@ -135,7 +129,7 @@ std::string ToStdString(const String& str) {
|
| // Checks that 'expected' and 'actual' are equal sets. If 'ordered' is true,
|
| // it also verifies that their iteration orders match, i.e., that actual's
|
| // insertion order coincides with lexicographic order.
|
| -template<typename Set>
|
| +template <typename Set>
|
| void VerifyStringSetsEqual(const std::set<std::string>& expected,
|
| const Set& actual,
|
| bool ordered) {
|
| @@ -158,15 +152,15 @@ void VerifyStringSetsEqual(const std::set<std::string>& expected,
|
| if (!ordered) {
|
| std::sort(actual_vec.begin(), actual_vec.end());
|
| }
|
| - EXPECT(std::equal(actual_vec.begin(), actual_vec.end(),
|
| - expected_vec.begin()));
|
| + EXPECT(
|
| + std::equal(actual_vec.begin(), actual_vec.end(), expected_vec.begin()));
|
| }
|
|
|
|
|
| // Checks that 'expected' and 'actual' are equal maps. If 'ordered' is true,
|
| // it also verifies that their iteration orders match, i.e., that actual's
|
| // insertion order coincides with lexicographic order.
|
| -template<typename Map>
|
| +template <typename Map>
|
| void VerifyStringMapsEqual(const std::map<std::string, int>& expected,
|
| const Map& actual,
|
| bool ordered) {
|
| @@ -200,7 +194,7 @@ void VerifyStringMapsEqual(const std::map<std::string, int>& expected,
|
| }
|
|
|
|
|
| -template<typename Set>
|
| +template <typename Set>
|
| void TestSet(intptr_t initial_capacity, bool ordered) {
|
| std::set<std::string> expected;
|
| Set actual(HashTables::New<Set>(initial_capacity));
|
| @@ -226,7 +220,7 @@ void TestSet(intptr_t initial_capacity, bool ordered) {
|
| }
|
|
|
|
|
| -template<typename Map>
|
| +template <typename Map>
|
| void TestMap(intptr_t initial_capacity, bool ordered) {
|
| std::map<std::string, int> expected;
|
| Map actual(HashTables::New<Map>(initial_capacity));
|
| @@ -258,8 +252,7 @@ void TestMap(intptr_t initial_capacity, bool ordered) {
|
|
|
|
|
| TEST_CASE(Sets) {
|
| - for (intptr_t initial_capacity = 0;
|
| - initial_capacity < 32;
|
| + for (intptr_t initial_capacity = 0; initial_capacity < 32;
|
| ++initial_capacity) {
|
| TestSet<UnorderedHashSet<TestTraits> >(initial_capacity, false);
|
| }
|
| @@ -267,8 +260,7 @@ TEST_CASE(Sets) {
|
|
|
|
|
| TEST_CASE(Maps) {
|
| - for (intptr_t initial_capacity = 0;
|
| - initial_capacity < 32;
|
| + for (intptr_t initial_capacity = 0; initial_capacity < 32;
|
| ++initial_capacity) {
|
| TestMap<UnorderedHashMap<TestTraits> >(initial_capacity, false);
|
| }
|
|
|