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

Commit 5aa1ec4b authored by Myles Watson's avatar Myles Watson Committed by Gerrit Code Review
Browse files

Merge "HCI: Create Death test class for ASSERT_DEATH" into main

parents d2861947 b1fcf81c
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -118,6 +118,8 @@ class HciLayerTest : public ::testing::Test {
  TestModuleRegistry fake_registry_;
};

class HciLayerDeathTest : public HciLayerTest {};

TEST_F(HciLayerTest, setup_teardown) {}

TEST_F(HciLayerTest, reset_command_sent_on_start) {
@@ -136,7 +138,7 @@ TEST_F(HciLayerTest, controller_debug_info_requested_on_hci_timeout) {
  ASSERT_TRUE(debug_info_view.IsValid());
}

TEST_F(HciLayerTest, abort_after_hci_restart_timeout) {
TEST_F(HciLayerDeathTest, abort_after_hci_restart_timeout) {
  FailIfResetNotSent();
  FakeTimerAdvance(HciLayer::kHciTimeoutMs.count());

@@ -154,7 +156,7 @@ TEST_F(HciLayerTest, abort_after_hci_restart_timeout) {
      "");
}

TEST_F(HciLayerTest, abort_on_root_inflammation_event) {
TEST_F(HciLayerDeathTest, abort_on_root_inflammation_event) {
  FailIfResetNotSent();

  ASSERT_DEATH(
@@ -174,7 +176,7 @@ TEST_F(HciLayerTest, successful_reset) {
  sync_handler();
}

TEST_F(HciLayerTest, abort_if_reset_complete_returns_error) {
TEST_F(HciLayerDeathTest, abort_if_reset_complete_returns_error) {
  FailIfResetNotSent();
  ASSERT_DEATH(
      {
@@ -213,7 +215,7 @@ TEST_F(HciLayerTest, le_event_handler_is_invoked) {
      ClockAccuracy::PPM_30));
}

TEST_F(HciLayerTest, abort_on_second_register_event_handler) {
TEST_F(HciLayerDeathTest, abort_on_second_register_event_handler) {
  FailIfResetNotSent();
  ASSERT_DEATH(
      {
@@ -226,7 +228,7 @@ TEST_F(HciLayerTest, abort_on_second_register_event_handler) {
      "");
}

TEST_F(HciLayerTest, abort_on_second_register_le_event_handler) {
TEST_F(HciLayerDeathTest, abort_on_second_register_le_event_handler) {
  ASSERT_DEATH(
      {
        FailIfResetNotSent();
@@ -378,7 +380,7 @@ TEST_F(HciLayerTest, our_command_status_callback_is_invoked) {
}

TEST_F(
    HciLayerTest,
    HciLayerDeathTest,
    command_complete_callback_is_invoked_with_an_opcode_that_does_not_match_command_queue) {
  ASSERT_DEATH(
      {
@@ -392,7 +394,7 @@ TEST_F(
}

TEST_F(
    HciLayerTest,
    HciLayerDeathTest,
    command_status_callback_is_invoked_with_an_opcode_that_does_not_match_command_queue) {
  ASSERT_DEATH(
      {
@@ -405,7 +407,7 @@ TEST_F(
      "");
}

TEST_F(HciLayerTest, command_complete_callback_is_invoked_but_command_queue_empty) {
TEST_F(HciLayerDeathTest, command_complete_callback_is_invoked_but_command_queue_empty) {
  ASSERT_DEATH(
      {
        FailIfResetNotSent();
@@ -416,7 +418,7 @@ TEST_F(HciLayerTest, command_complete_callback_is_invoked_but_command_queue_empt
      "");
}

TEST_F(HciLayerTest, command_status_callback_is_invoked_but_command_queue_empty) {
TEST_F(HciLayerDeathTest, command_status_callback_is_invoked_but_command_queue_empty) {
  ASSERT_DEATH(
      {
        FailIfResetNotSent();