From 4b50fcda51b546f44f2d0b6bd95b378ae147e313 Mon Sep 17 00:00:00 2001 From: Jack He Date: Thu, 4 Oct 2018 18:42:37 -0700 Subject: [PATCH] VTS: Check return status of initialize and close Test: atest VtsHalBluetoothV1_0TargetTest Change-Id: I579c4d5f4c6e24b358c67c3dc8a8a8ceb1f936e2 --- .../VtsHalBluetoothV1_0TargetTest.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp index bf8b547f99..439c5fb142 100644 --- a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp +++ b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp @@ -170,8 +170,9 @@ class BluetoothHidlTest : public ::testing::VtsHalHidlTargetTestBase { acl_cb_count = 0; sco_cb_count = 0; - ASSERT_EQ(initialized, false); - bluetooth->initialize(bluetooth_cb); + ASSERT_FALSE(initialized); + // Should not be checked in production code + ASSERT_TRUE(bluetooth->initialize(bluetooth_cb).isOk()); bluetooth_cb->SetWaitTimeout(kCallbackNameInitializationComplete, WAIT_FOR_INIT_TIMEOUT); @@ -186,15 +187,16 @@ class BluetoothHidlTest : public ::testing::VtsHalHidlTargetTestBase { bluetooth_cb->WaitForCallback(kCallbackNameInitializationComplete) .no_timeout); - ASSERT_EQ(initialized, true); + ASSERT_TRUE(initialized); } virtual void TearDown() override { - bluetooth->close(); - handle_no_ops(); - EXPECT_EQ(static_cast(0), event_queue.size()); - EXPECT_EQ(static_cast(0), sco_queue.size()); - EXPECT_EQ(static_cast(0), acl_queue.size()); + // Should not be checked in production code + ASSERT_TRUE(bluetooth->close().isOk()); + handle_no_ops(); + EXPECT_EQ(static_cast(0), event_queue.size()); + EXPECT_EQ(static_cast(0), sco_queue.size()); + EXPECT_EQ(static_cast(0), acl_queue.size()); } void setBufferSizes();