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

Commit 3f402a5c authored by Chris Manton's avatar Chris Manton
Browse files

gd: gd/hci/le_address_manager_test::ASSERT_LOG when command queue is empty

Returning an empty vector causes debug headaches

Bug: 171568335
Test: CtsVerifier
Test: gd/cert/run --host
Test: atest --host bluetooth_test_gd
Tag: #refactor
Change-Id: I9d5f2ecacfe2bbcea7a333d3701523a6d9cfcaae
parent 4a9ee5c1
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -76,10 +76,8 @@ class TestHciLayer : public HciLayer {
      auto result = command_future_->wait_for(std::chrono::milliseconds(1000));
      EXPECT_NE(std::future_status::timeout, result);
    }
    if (command_queue_.empty()) {
      return ConnectionManagementCommandView::Create(
          CommandPacketView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>())));
    }
    ASSERT_LOG(
        !command_queue_.empty(), "Expecting command %s but command queue was empty", OpCodeText(op_code).c_str());
    CommandPacketView command_packet_view = GetLastCommand();
    EXPECT_TRUE(command_packet_view.IsValid());
    EXPECT_EQ(command_packet_view.GetOpCode(), op_code);