Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a8aeb1d authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Fix linter

Test: bluetooth_test_gd
Tag: #gd-refactor
Bug: 141555841
Change-Id: Icbf6ddfd077988ba1feb6646c6909ee1a91e50c6
parent 2753907a
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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();
  }
}
+9 −9
Original line number Diff line number Diff line
@@ -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();
}