Loading system/gd/hci/hci_layer.cc +1 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,7 @@ struct HciLayer::impl { OpCodeText(op_code).c_str()); if (waiting_command_ == OpCode::CONTROLLER_DEBUG_INFO && op_code != OpCode::CONTROLLER_DEBUG_INFO) { LOG_ERROR("Discarding event that came after timeout 0x%02hx (%s)", op_code, OpCodeText(op_code).c_str()); common::StopWatch::DumpStopWatchLog(); return; } ASSERT_LOG( Loading system/gd/hci/hci_layer_unittest.cc +21 −0 Original line number Diff line number Diff line Loading @@ -156,6 +156,27 @@ TEST_F(HciLayerDeathTest, abort_after_hci_restart_timeout) { ""); } TEST_F(HciLayerDeathTest, discard_event_after_hci_timeout) { FailIfResetNotSent(); FakeTimerAdvance(HciLayer::kHciTimeoutMs.count()); auto sent_command = hal_->GetSentCommand(); ASSERT_TRUE(sent_command.has_value()); auto debug_info_view = ControllerDebugInfoView::Create(VendorCommandView::Create(*sent_command)); ASSERT_TRUE(debug_info_view.IsValid()); // This event should be discarded, not cause an abort. hal_->InjectEvent(ResetCompleteBuilder::Create(1, ErrorCode::SUCCESS)); sync_handler(); ASSERT_DEATH( { FakeTimerAdvance(HciLayer::kHciTimeoutRestartMs.count()); sync_handler(); }, ""); } TEST_F(HciLayerDeathTest, abort_on_root_inflammation_event) { FailIfResetNotSent(); Loading Loading
system/gd/hci/hci_layer.cc +1 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,7 @@ struct HciLayer::impl { OpCodeText(op_code).c_str()); if (waiting_command_ == OpCode::CONTROLLER_DEBUG_INFO && op_code != OpCode::CONTROLLER_DEBUG_INFO) { LOG_ERROR("Discarding event that came after timeout 0x%02hx (%s)", op_code, OpCodeText(op_code).c_str()); common::StopWatch::DumpStopWatchLog(); return; } ASSERT_LOG( Loading
system/gd/hci/hci_layer_unittest.cc +21 −0 Original line number Diff line number Diff line Loading @@ -156,6 +156,27 @@ TEST_F(HciLayerDeathTest, abort_after_hci_restart_timeout) { ""); } TEST_F(HciLayerDeathTest, discard_event_after_hci_timeout) { FailIfResetNotSent(); FakeTimerAdvance(HciLayer::kHciTimeoutMs.count()); auto sent_command = hal_->GetSentCommand(); ASSERT_TRUE(sent_command.has_value()); auto debug_info_view = ControllerDebugInfoView::Create(VendorCommandView::Create(*sent_command)); ASSERT_TRUE(debug_info_view.IsValid()); // This event should be discarded, not cause an abort. hal_->InjectEvent(ResetCompleteBuilder::Create(1, ErrorCode::SUCCESS)); sync_handler(); ASSERT_DEATH( { FakeTimerAdvance(HciLayer::kHciTimeoutRestartMs.count()); sync_handler(); }, ""); } TEST_F(HciLayerDeathTest, abort_on_root_inflammation_event) { FailIfResetNotSent(); Loading