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

Commit 779985a2 authored by grekit1024's avatar grekit1024
Browse files

nfc: Change EXPECT_TRUE to ASSERT_TRUE



because if the timeout occurs, a null pointer exception will be caused, and ASSERT_TRUE can interrupt the continued execution of the case.

Test: done
Bug:357008220

Change-Id: I17332c065e35c69630fc24ca2d929c6bff767c08
Signed-off-by: default avatargrekit1024 <grekit1024@gmail.com>
parent f1527f5a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -564,14 +564,14 @@ TEST_P(NfcHidlTest, OpenAfterOpen) {
  EXPECT_EQ(NfcStatus::OK, nfc_->open(nfc_cb_));
  // Wait for OPEN_CPLT event
  auto res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
  EXPECT_TRUE(res.no_timeout);
  ASSERT_TRUE(res.no_timeout);
  EXPECT_EQ(NfcEvent::OPEN_CPLT, res.args->last_event_);
  EXPECT_EQ(NfcStatus::OK, res.args->last_status_);

  EXPECT_EQ(NfcStatus::OK, nfc_->open(nfc_cb_));
  // Wait for OPEN_CPLT event
  res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
  EXPECT_TRUE(res.no_timeout);
  ASSERT_TRUE(res.no_timeout);
  EXPECT_EQ(NfcEvent::OPEN_CPLT, res.args->last_event_);
  EXPECT_EQ(NfcStatus::OK, res.args->last_status_);
}