OSDN Git Service

Fix linter
authorHansong Zhang <hsz@google.com>
Fri, 15 Jan 2021 19:48:17 +0000 (11:48 -0800)
committerHansong Zhang <hsz@google.com>
Fri, 15 Jan 2021 20:17:27 +0000 (12:17 -0800)
Test: bluetooth_test_gd
Tag: #gd-refactor
Bug: 141555841
Change-Id: Icbf6ddfd077988ba1feb6646c6909ee1a91e50c6

gd/common/multi_priority_queue_test.cc
gd/l2cap/internal/scheduler_fifo_test.cc

index 6677525..c0918ad 100644 (file)
@@ -25,16 +25,16 @@ namespace common {
 
 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) {
@@ -43,7 +43,7 @@ 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();
   }
 }
@@ -54,7 +54,7 @@ TEST(MultiPriorityQueueTest, with_multiple_priority_item) {
   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();
   }
 }
index b45fdbf..9ab2cb5 100644 (file)
@@ -98,10 +98,10 @@ TEST_F(L2capSchedulerFifoTest, send_packet) {
   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();
 }
 
@@ -122,19 +122,19 @@ TEST_F(L2capSchedulerFifoTest, prioritize_channel) {
   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();
 }