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

Unified Diff: net/base/priority_queue_unittest.cc

Issue 22909037: [net/dns] Reland of 218616 (Simultaneous A/AAAA queries). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix printing unsigned Created 7 years, 4 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 | « net/base/priority_queue.h ('k') | net/dns/dns_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/priority_queue_unittest.cc
===================================================================
--- net/base/priority_queue_unittest.cc (revision 219192)
+++ net/base/priority_queue_unittest.cc (working copy)
@@ -91,7 +91,7 @@
queue_.Erase(pointers_[2]);
queue_.Erase(pointers_[3]);
- int expected_order[] = { 8, 1, 6, 0, 5, 4, 7 };
+ const int expected_order[] = { 8, 1, 6, 0, 5, 4, 7 };
for (size_t i = 0; i < arraysize(expected_order); ++i) {
EXPECT_EQ(expected_order[i], queue_.FirstMin().value());
@@ -100,6 +100,21 @@
CheckEmpty();
}
+TEST_F(PriorityQueueTest, InsertAtFront) {
+ queue_.InsertAtFront(9, 2);
+ queue_.InsertAtFront(10, 0);
+ queue_.InsertAtFront(11, 1);
+ queue_.InsertAtFront(12, 1);
+
+ const int expected_order[] = { 10, 3, 8, 12, 11, 1, 6, 9, 0, 2, 5, 4, 7 };
+
+ for (size_t i = 0; i < arraysize(expected_order); ++i) {
+ EXPECT_EQ(expected_order[i], queue_.FirstMin().value());
+ queue_.Erase(queue_.FirstMin());
+ }
+ CheckEmpty();
+}
+
} // namespace
} // namespace net
« no previous file with comments | « net/base/priority_queue.h ('k') | net/dns/dns_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698