TEST(MultiPriorityQueueTest, without_high_priority_item) {
common::MultiPriorityQueue<int, 2> q;
- EXPECT_TRUE(q.empty());
+ ASSERT_TRUE(q.empty());
q.push(0);
q.push(1, 0);
q.push(2);
- EXPECT_EQ(q.size(), 3);
+ ASSERT_EQ(q.size(), 3);
for (int i = 0; i < 3; i++) {
- EXPECT_EQ(q.front(), i);
+ ASSERT_EQ(q.front(), i);
q.pop();
}
- EXPECT_TRUE(q.empty());
+ ASSERT_TRUE(q.empty());
}
TEST(MultiPriorityQueueTest, with_high_priority_item) {
q.push(2);
q.push(0, 1);
for (int i = 0; i < 3; i++) {
- EXPECT_EQ(q.front(), i);
+ ASSERT_EQ(q.front(), i);
q.pop();
}
}
q.push(0, 2);
q.push(2, 0);
for (int i = 0; i < 3; i++) {
- EXPECT_EQ(q.front(), i);
+ ASSERT_EQ(q.front(), i);
q.pop();
}
}
auto&& packet = enqueue_.enqueued.front();
auto packet_view = GetPacketView(std::move(packet));
auto basic_frame_view = BasicFrameView::Create(packet_view);
- EXPECT_TRUE(basic_frame_view.IsValid());
- EXPECT_EQ(basic_frame_view.GetChannelId(), 1);
+ ASSERT_TRUE(basic_frame_view.IsValid());
+ ASSERT_EQ(basic_frame_view.GetChannelId(), 1);
auto payload = basic_frame_view.GetPayload();
- EXPECT_EQ(std::string(payload.begin(), payload.end()), "abc");
+ ASSERT_EQ(std::string(payload.begin(), payload.end()), "abc");
enqueue_.enqueued.pop();
}
auto packet1 = std::move(enqueue_.enqueued.front());
auto packet_view = GetPacketView(std::move(packet1));
auto basic_frame_view = BasicFrameView::Create(packet_view);
- EXPECT_TRUE(basic_frame_view.IsValid());
- EXPECT_EQ(basic_frame_view.GetChannelId(), 1);
+ ASSERT_TRUE(basic_frame_view.IsValid());
+ ASSERT_EQ(basic_frame_view.GetChannelId(), 1);
auto payload = basic_frame_view.GetPayload();
- EXPECT_EQ(std::string(payload.begin(), payload.end()), "abc");
+ ASSERT_EQ(std::string(payload.begin(), payload.end()), "abc");
enqueue_.enqueued.pop();
auto packet2 = std::move(enqueue_.enqueued.front());
packet_view = GetPacketView(std::move(packet2));
basic_frame_view = BasicFrameView::Create(packet_view);
- EXPECT_TRUE(basic_frame_view.IsValid());
- EXPECT_EQ(basic_frame_view.GetChannelId(), 2);
+ ASSERT_TRUE(basic_frame_view.IsValid());
+ ASSERT_EQ(basic_frame_view.GetChannelId(), 2);
payload = basic_frame_view.GetPayload();
- EXPECT_EQ(std::string(payload.begin(), payload.end()), "def");
+ ASSERT_EQ(std::string(payload.begin(), payload.end()), "def");
enqueue_.enqueued.pop();
}