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

Unified Diff: net/dns/host_cache_unittest.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
Index: net/dns/host_cache_unittest.cc
diff --git a/net/dns/host_cache_unittest.cc b/net/dns/host_cache_unittest.cc
index 34309c1223cc3d2815e5fcdadd035de222dbc3db..ea8b1b220f51962d70a1727ccb098c352b1cfe35 100644
--- a/net/dns/host_cache_unittest.cc
+++ b/net/dns/host_cache_unittest.cc
@@ -219,10 +219,10 @@ TEST(HostCacheTest, HostResolverFlagsArePartOfKey) {
base::TimeTicks now;
HostCache::Key key1("foobar.com", ADDRESS_FAMILY_IPV4, 0);
- HostCache::Key key2("foobar.com", ADDRESS_FAMILY_IPV4,
- HOST_RESOLVER_CANONNAME);
- HostCache::Key key3("foobar.com", ADDRESS_FAMILY_IPV4,
- HOST_RESOLVER_LOOPBACK_ONLY);
+ HostCache::Key key2(
+ "foobar.com", ADDRESS_FAMILY_IPV4, HOST_RESOLVER_CANONNAME);
+ HostCache::Key key3(
+ "foobar.com", ADDRESS_FAMILY_IPV4, HOST_RESOLVER_LOOPBACK_ONLY);
HostCache::Entry entry = HostCache::Entry(OK, AddressList());
EXPECT_EQ(0U, cache.size());
@@ -265,7 +265,7 @@ TEST(HostCacheTest, NoCache) {
HostCache::Entry entry = HostCache::Entry(OK, AddressList());
// Lookup and Set should have no effect.
- EXPECT_FALSE(cache.Lookup(Key("foobar.com"),now));
+ EXPECT_FALSE(cache.Lookup(Key("foobar.com"), now));
cache.Set(Key("foobar.com"), entry, now, kTTL);
EXPECT_FALSE(cache.Lookup(Key("foobar.com"), now));
@@ -309,56 +309,31 @@ TEST(HostCacheTest, KeyComparators) {
// 1 means key1 is greater than key2
int expected_comparison;
} tests[] = {
- {
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
- 0
- },
- {
- HostCache::Key("host1", ADDRESS_FAMILY_IPV4, 0),
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
- 1
- },
- {
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
- HostCache::Key("host1", ADDRESS_FAMILY_IPV4, 0),
- -1
- },
- {
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
- HostCache::Key("host2", ADDRESS_FAMILY_UNSPECIFIED, 0),
- -1
- },
- {
- HostCache::Key("host1", ADDRESS_FAMILY_IPV4, 0),
- HostCache::Key("host2", ADDRESS_FAMILY_UNSPECIFIED, 0),
- 1
- },
- {
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
- HostCache::Key("host2", ADDRESS_FAMILY_IPV4, 0),
- -1
- },
- {
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED,
- HOST_RESOLVER_CANONNAME),
- -1
- },
- {
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED,
- HOST_RESOLVER_CANONNAME),
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
- 1
- },
- {
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED,
- HOST_RESOLVER_CANONNAME),
- HostCache::Key("host2", ADDRESS_FAMILY_UNSPECIFIED,
- HOST_RESOLVER_CANONNAME),
- -1
- },
- };
+ {HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
+ HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), 0},
+ {HostCache::Key("host1", ADDRESS_FAMILY_IPV4, 0),
+ HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), 1},
+ {HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
+ HostCache::Key("host1", ADDRESS_FAMILY_IPV4, 0), -1},
+ {HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
+ HostCache::Key("host2", ADDRESS_FAMILY_UNSPECIFIED, 0), -1},
+ {HostCache::Key("host1", ADDRESS_FAMILY_IPV4, 0),
+ HostCache::Key("host2", ADDRESS_FAMILY_UNSPECIFIED, 0), 1},
+ {HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
+ HostCache::Key("host2", ADDRESS_FAMILY_IPV4, 0), -1},
+ {HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0),
+ HostCache::Key(
+ "host1", ADDRESS_FAMILY_UNSPECIFIED, HOST_RESOLVER_CANONNAME),
+ -1},
+ {HostCache::Key(
+ "host1", ADDRESS_FAMILY_UNSPECIFIED, HOST_RESOLVER_CANONNAME),
+ HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), 1},
+ {HostCache::Key(
+ "host1", ADDRESS_FAMILY_UNSPECIFIED, HOST_RESOLVER_CANONNAME),
+ HostCache::Key(
+ "host2", ADDRESS_FAMILY_UNSPECIFIED, HOST_RESOLVER_CANONNAME),
+ -1},
+ };
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]", i));

Powered by Google App Engine
This is Rietveld 408576698