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

Unified Diff: runtime/vm/hash_table_test.cc

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month 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 | « runtime/vm/hash_table.h ('k') | runtime/vm/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « runtime/vm/hash_table.h ('k') | runtime/vm/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698