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

Unified Diff: net/spdy/spdy_priority_forest_test.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/spdy/spdy_priority_forest_test.cc
diff --git a/net/spdy/spdy_priority_forest_test.cc b/net/spdy/spdy_priority_forest_test.cc
index 58b21d469e3ff916acaf0edd4e9b076cc811fd17..3228b7828dcb971fd7670748b263e4d30f14b41f 100644
--- a/net/spdy/spdy_priority_forest_test.cc
+++ b/net/spdy/spdy_priority_forest_test.cc
@@ -10,7 +10,7 @@
namespace net {
TEST(SpdyPriorityForestTest, AddAndRemoveNodes) {
- SpdyPriorityForest<uint32,int16> forest;
+ SpdyPriorityForest<uint32, int16> forest;
EXPECT_EQ(0, forest.num_nodes());
EXPECT_FALSE(forest.NodeExists(1));
@@ -55,7 +55,7 @@ TEST(SpdyPriorityForestTest, AddAndRemoveNodes) {
}
TEST(SpdyPriorityForestTest, SetParent) {
- SpdyPriorityForest<uint32,int16> forest;
+ SpdyPriorityForest<uint32, int16> forest;
forest.AddRootNode(1, 1000);
forest.AddNonRootNode(2, 1, false);
forest.AddNonRootNode(3, 2, false);
@@ -100,7 +100,7 @@ TEST(SpdyPriorityForestTest, SetParent) {
}
TEST(SpdyPriorityForestTest, RemoveNodesFromMiddleOfChain) {
- SpdyPriorityForest<uint32,int16> forest;
+ SpdyPriorityForest<uint32, int16> forest;
forest.AddRootNode(1, 1000);
forest.AddNonRootNode(2, 1, false);
forest.AddNonRootNode(3, 2, true);
@@ -155,7 +155,7 @@ TEST(SpdyPriorityForestTest, RemoveNodesFromMiddleOfChain) {
}
TEST(SpdyPriorityForestTest, MergeOrderedAndUnorderedLinks1) {
- SpdyPriorityForest<uint32,int16> forest;
+ SpdyPriorityForest<uint32, int16> forest;
forest.AddRootNode(1, 1000);
forest.AddNonRootNode(2, 1, true);
forest.AddNonRootNode(3, 2, false);
@@ -176,7 +176,7 @@ TEST(SpdyPriorityForestTest, MergeOrderedAndUnorderedLinks1) {
}
TEST(SpdyPriorityForestTest, MergeOrderedAndUnorderedLinks2) {
- SpdyPriorityForest<uint32,int16> forest;
+ SpdyPriorityForest<uint32, int16> forest;
forest.AddRootNode(1, 1000);
forest.AddNonRootNode(2, 1, false);
forest.AddNonRootNode(3, 2, true);
@@ -197,7 +197,7 @@ TEST(SpdyPriorityForestTest, MergeOrderedAndUnorderedLinks2) {
}
TEST(SpdyPriorityForestTest, WeightedSelectionOfForests) {
- SpdyPriorityForest<uint32,int16> forest;
+ SpdyPriorityForest<uint32, int16> forest;
forest.AddRootNode(1, 10);
forest.AddRootNode(3, 20);
forest.AddRootNode(5, 70);
@@ -216,16 +216,19 @@ TEST(SpdyPriorityForestTest, WeightedSelectionOfForests) {
int counts[8] = {0};
for (int i = 0; i < 7000; ++i) {
const uint32 node_id = forest.NextNodeToRead();
- ASSERT_TRUE(node_id == 1 || node_id == 5 || node_id == 7)
- << "node_id is " << node_id;
+ ASSERT_TRUE(node_id == 1 || node_id == 5 || node_id == 7) << "node_id is "
+ << node_id;
++counts[node_id];
}
// In theory, these could fail even if the weighted random selection is
// implemented correctly, but it's very unlikely.
- EXPECT_GE(counts[1], 800); EXPECT_LE(counts[1], 1200);
- EXPECT_GE(counts[7], 1600); EXPECT_LE(counts[7], 2400);
- EXPECT_GE(counts[5], 3200); EXPECT_LE(counts[5], 4800);
+ EXPECT_GE(counts[1], 800);
+ EXPECT_LE(counts[1], 1200);
+ EXPECT_GE(counts[7], 1600);
+ EXPECT_LE(counts[7], 2400);
+ EXPECT_GE(counts[5], 3200);
+ EXPECT_LE(counts[5], 4800);
// If we unmark all but one node, then we know for sure that that node will
// be selected next.
@@ -238,7 +241,7 @@ TEST(SpdyPriorityForestTest, WeightedSelectionOfForests) {
}
TEST(SpdyPriorityForestTest, SelectionBetweenUnorderedNodes) {
- SpdyPriorityForest<uint32,int16> forest;
+ SpdyPriorityForest<uint32, int16> forest;
forest.AddRootNode(1, 1000);
forest.AddNonRootNode(2, 1, false);
forest.AddNonRootNode(3, 2, true);
@@ -257,16 +260,19 @@ TEST(SpdyPriorityForestTest, SelectionBetweenUnorderedNodes) {
int counts[8] = {0};
for (int i = 0; i < 6000; ++i) {
const uint32 node_id = forest.NextNodeToWrite();
- ASSERT_TRUE(node_id == 2 || node_id == 4 || node_id == 6)
- << "node_id is " << node_id;
+ ASSERT_TRUE(node_id == 2 || node_id == 4 || node_id == 6) << "node_id is "
+ << node_id;
++counts[node_id];
}
// In theory, these could fail even if the random selection is implemented
// correctly, but it's very unlikely.
- EXPECT_GE(counts[2], 1600); EXPECT_LE(counts[2], 2400);
- EXPECT_GE(counts[4], 1600); EXPECT_LE(counts[4], 2400);
- EXPECT_GE(counts[6], 1600); EXPECT_LE(counts[6], 2400);
+ EXPECT_GE(counts[2], 1600);
+ EXPECT_LE(counts[2], 2400);
+ EXPECT_GE(counts[4], 1600);
+ EXPECT_LE(counts[4], 2400);
+ EXPECT_GE(counts[6], 1600);
+ EXPECT_LE(counts[6], 2400);
// Once we unmark that group of nodes, the next node up should be node 7,
// which has an ordered dependency on said group.

Powered by Google App Engine
This is Rietveld 408576698