Loading broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp +4 −5 Original line number Original line Diff line number Diff line Loading @@ -54,8 +54,7 @@ using ::android::hardware::broadcastradio::V1_0::vts::RadioClassFromString; #define RETURN_IF_SKIPPED \ #define RETURN_IF_SKIPPED \ if (skipped) { \ if (skipped) { \ std::cout << "[ SKIPPED ] This device class is not supported. " << std::endl; \ GTEST_SKIP() << "This device class is not supported."; \ return; \ } } // The main test class for Broadcast Radio HIDL HAL. // The main test class for Broadcast Radio HIDL HAL. Loading broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp +3 −23 Original line number Original line Diff line number Diff line Loading @@ -73,10 +73,6 @@ static constexpr ProgramType kStandardProgramTypes[] = { ProgramType::AM, ProgramType::FM, ProgramType::AM_HD, ProgramType::FM_HD, ProgramType::AM, ProgramType::FM, ProgramType::AM_HD, ProgramType::FM_HD, ProgramType::DAB, ProgramType::DRMO, ProgramType::SXM}; ProgramType::DAB, ProgramType::DRMO, ProgramType::SXM}; static void printSkipped(std::string msg) { std::cout << "[ SKIPPED ] " << msg << std::endl; } struct TunerCallbackMock : public ITunerCallback { struct TunerCallbackMock : public ITunerCallback { TunerCallbackMock() { EXPECT_CALL(*this, hardwareFailure()).Times(0); } TunerCallbackMock() { EXPECT_CALL(*this, hardwareFailure()).Times(0); } Loading Loading @@ -106,7 +102,6 @@ class BroadcastRadioHalTest bool getProgramList(std::function<void(const hidl_vec<ProgramInfo>& list)> cb); bool getProgramList(std::function<void(const hidl_vec<ProgramInfo>& list)> cb); Class radioClass; Class radioClass; bool skipped = false; sp<IBroadcastRadio> mRadioModule; sp<IBroadcastRadio> mRadioModule; sp<ITuner> mTuner; sp<ITuner> mTuner; Loading Loading @@ -137,9 +132,7 @@ void BroadcastRadioHalTest::SetUp() { ASSERT_TRUE(onConnect.waitForCall(kConnectModuleTimeout)); ASSERT_TRUE(onConnect.waitForCall(kConnectModuleTimeout)); if (connectResult == Result::INVALID_ARGUMENTS) { if (connectResult == Result::INVALID_ARGUMENTS) { printSkipped("This device class is not supported."); GTEST_SKIP() << "This device class is not supported."; skipped = true; return; } } ASSERT_EQ(connectResult, Result::OK); ASSERT_EQ(connectResult, Result::OK); ASSERT_NE(nullptr, mRadioModule.get()); ASSERT_NE(nullptr, mRadioModule.get()); Loading Loading @@ -285,8 +278,6 @@ bool BroadcastRadioHalTest::getProgramList( * might fail. * might fail. */ */ TEST_P(BroadcastRadioHalTest, OpenTunerTwice) { TEST_P(BroadcastRadioHalTest, OpenTunerTwice) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); auto secondTuner = mTuner; auto secondTuner = mTuner; Loading @@ -306,7 +297,6 @@ TEST_P(BroadcastRadioHalTest, OpenTunerTwice) { * - getProgramInformation_1_1 returns the same selector as returned in tuneComplete_1_1 call. * - getProgramInformation_1_1 returns the same selector as returned in tuneComplete_1_1 call. */ */ TEST_P(BroadcastRadioHalTest, TuneFromProgramList) { TEST_P(BroadcastRadioHalTest, TuneFromProgramList) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); ProgramInfo firstProgram; ProgramInfo firstProgram; Loading @@ -320,8 +310,7 @@ TEST_P(BroadcastRadioHalTest, TuneFromProgramList) { } while (nextBand()); } while (nextBand()); if (HasFailure()) return; if (HasFailure()) return; if (!foundAny) { if (!foundAny) { printSkipped("Program list is empty."); GTEST_SKIP() << "Program list is empty."; return; } } ProgramInfo infoCb; ProgramInfo infoCb; Loading Loading @@ -356,7 +345,6 @@ TEST_P(BroadcastRadioHalTest, TuneFromProgramList) { * identifier for program types other than VENDORn. * identifier for program types other than VENDORn. */ */ TEST_P(BroadcastRadioHalTest, TuneFailsForPrimaryVendor) { TEST_P(BroadcastRadioHalTest, TuneFailsForPrimaryVendor) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); for (auto ptype : kStandardProgramTypes) { for (auto ptype : kStandardProgramTypes) { Loading @@ -377,7 +365,6 @@ TEST_P(BroadcastRadioHalTest, TuneFailsForPrimaryVendor) { * - tuneByProgramSelector fails with INVALID_ARGUMENT when unknown program type is passed. * - tuneByProgramSelector fails with INVALID_ARGUMENT when unknown program type is passed. */ */ TEST_P(BroadcastRadioHalTest, TuneFailsForUnknownProgram) { TEST_P(BroadcastRadioHalTest, TuneFailsForUnknownProgram) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); // Program type is 1-based, so 0 will be always invalid. // Program type is 1-based, so 0 will be always invalid. Loading @@ -393,7 +380,6 @@ TEST_P(BroadcastRadioHalTest, TuneFailsForUnknownProgram) { * - cancelAnnouncement succeeds either when there is an announcement or there is none. * - cancelAnnouncement succeeds either when there is an announcement or there is none. */ */ TEST_P(BroadcastRadioHalTest, CancelAnnouncement) { TEST_P(BroadcastRadioHalTest, CancelAnnouncement) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); auto hidlResult = mTuner->cancelAnnouncement(); auto hidlResult = mTuner->cancelAnnouncement(); Loading @@ -407,8 +393,6 @@ TEST_P(BroadcastRadioHalTest, CancelAnnouncement) { * - getImage call handles argument 0 gracefully. * - getImage call handles argument 0 gracefully. */ */ TEST_P(BroadcastRadioHalTest, GetNoImage) { TEST_P(BroadcastRadioHalTest, GetNoImage) { if (skipped) return; size_t len = 0; size_t len = 0; auto hidlResult = auto hidlResult = mRadioModule->getImage(0, [&](hidl_vec<uint8_t> rawImage) { len = rawImage.size(); }); mRadioModule->getImage(0, [&](hidl_vec<uint8_t> rawImage) { len = rawImage.size(); }); Loading @@ -425,7 +409,6 @@ TEST_P(BroadcastRadioHalTest, GetNoImage) { * - images are available for getImage call. * - images are available for getImage call. */ */ TEST_P(BroadcastRadioHalTest, OobImagesOnly) { TEST_P(BroadcastRadioHalTest, OobImagesOnly) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); std::vector<int> imageIds; std::vector<int> imageIds; Loading @@ -446,8 +429,7 @@ TEST_P(BroadcastRadioHalTest, OobImagesOnly) { } while (nextBand()); } while (nextBand()); if (imageIds.size() == 0) { if (imageIds.size() == 0) { printSkipped("No images found"); GTEST_SKIP() << "No images found"; return; } } for (auto id : imageIds) { for (auto id : imageIds) { Loading @@ -469,7 +451,6 @@ TEST_P(BroadcastRadioHalTest, OobImagesOnly) { * - setAnalogForced results either with INVALID_STATE, or isAnalogForced replying the same. * - setAnalogForced results either with INVALID_STATE, or isAnalogForced replying the same. */ */ TEST_P(BroadcastRadioHalTest, AnalogForcedSwitch) { TEST_P(BroadcastRadioHalTest, AnalogForcedSwitch) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); bool forced; bool forced; Loading Loading @@ -584,7 +565,6 @@ static void verifyIdentifier(const ProgramIdentifier& id) { * - values of ProgramIdentifier match their definitions at IdentifierType. * - values of ProgramIdentifier match their definitions at IdentifierType. */ */ TEST_P(BroadcastRadioHalTest, VerifyIdentifiersFormat) { TEST_P(BroadcastRadioHalTest, VerifyIdentifiersFormat) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); do { do { Loading Loading
broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp +4 −5 Original line number Original line Diff line number Diff line Loading @@ -54,8 +54,7 @@ using ::android::hardware::broadcastradio::V1_0::vts::RadioClassFromString; #define RETURN_IF_SKIPPED \ #define RETURN_IF_SKIPPED \ if (skipped) { \ if (skipped) { \ std::cout << "[ SKIPPED ] This device class is not supported. " << std::endl; \ GTEST_SKIP() << "This device class is not supported."; \ return; \ } } // The main test class for Broadcast Radio HIDL HAL. // The main test class for Broadcast Radio HIDL HAL. Loading
broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp +3 −23 Original line number Original line Diff line number Diff line Loading @@ -73,10 +73,6 @@ static constexpr ProgramType kStandardProgramTypes[] = { ProgramType::AM, ProgramType::FM, ProgramType::AM_HD, ProgramType::FM_HD, ProgramType::AM, ProgramType::FM, ProgramType::AM_HD, ProgramType::FM_HD, ProgramType::DAB, ProgramType::DRMO, ProgramType::SXM}; ProgramType::DAB, ProgramType::DRMO, ProgramType::SXM}; static void printSkipped(std::string msg) { std::cout << "[ SKIPPED ] " << msg << std::endl; } struct TunerCallbackMock : public ITunerCallback { struct TunerCallbackMock : public ITunerCallback { TunerCallbackMock() { EXPECT_CALL(*this, hardwareFailure()).Times(0); } TunerCallbackMock() { EXPECT_CALL(*this, hardwareFailure()).Times(0); } Loading Loading @@ -106,7 +102,6 @@ class BroadcastRadioHalTest bool getProgramList(std::function<void(const hidl_vec<ProgramInfo>& list)> cb); bool getProgramList(std::function<void(const hidl_vec<ProgramInfo>& list)> cb); Class radioClass; Class radioClass; bool skipped = false; sp<IBroadcastRadio> mRadioModule; sp<IBroadcastRadio> mRadioModule; sp<ITuner> mTuner; sp<ITuner> mTuner; Loading Loading @@ -137,9 +132,7 @@ void BroadcastRadioHalTest::SetUp() { ASSERT_TRUE(onConnect.waitForCall(kConnectModuleTimeout)); ASSERT_TRUE(onConnect.waitForCall(kConnectModuleTimeout)); if (connectResult == Result::INVALID_ARGUMENTS) { if (connectResult == Result::INVALID_ARGUMENTS) { printSkipped("This device class is not supported."); GTEST_SKIP() << "This device class is not supported."; skipped = true; return; } } ASSERT_EQ(connectResult, Result::OK); ASSERT_EQ(connectResult, Result::OK); ASSERT_NE(nullptr, mRadioModule.get()); ASSERT_NE(nullptr, mRadioModule.get()); Loading Loading @@ -285,8 +278,6 @@ bool BroadcastRadioHalTest::getProgramList( * might fail. * might fail. */ */ TEST_P(BroadcastRadioHalTest, OpenTunerTwice) { TEST_P(BroadcastRadioHalTest, OpenTunerTwice) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); auto secondTuner = mTuner; auto secondTuner = mTuner; Loading @@ -306,7 +297,6 @@ TEST_P(BroadcastRadioHalTest, OpenTunerTwice) { * - getProgramInformation_1_1 returns the same selector as returned in tuneComplete_1_1 call. * - getProgramInformation_1_1 returns the same selector as returned in tuneComplete_1_1 call. */ */ TEST_P(BroadcastRadioHalTest, TuneFromProgramList) { TEST_P(BroadcastRadioHalTest, TuneFromProgramList) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); ProgramInfo firstProgram; ProgramInfo firstProgram; Loading @@ -320,8 +310,7 @@ TEST_P(BroadcastRadioHalTest, TuneFromProgramList) { } while (nextBand()); } while (nextBand()); if (HasFailure()) return; if (HasFailure()) return; if (!foundAny) { if (!foundAny) { printSkipped("Program list is empty."); GTEST_SKIP() << "Program list is empty."; return; } } ProgramInfo infoCb; ProgramInfo infoCb; Loading Loading @@ -356,7 +345,6 @@ TEST_P(BroadcastRadioHalTest, TuneFromProgramList) { * identifier for program types other than VENDORn. * identifier for program types other than VENDORn. */ */ TEST_P(BroadcastRadioHalTest, TuneFailsForPrimaryVendor) { TEST_P(BroadcastRadioHalTest, TuneFailsForPrimaryVendor) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); for (auto ptype : kStandardProgramTypes) { for (auto ptype : kStandardProgramTypes) { Loading @@ -377,7 +365,6 @@ TEST_P(BroadcastRadioHalTest, TuneFailsForPrimaryVendor) { * - tuneByProgramSelector fails with INVALID_ARGUMENT when unknown program type is passed. * - tuneByProgramSelector fails with INVALID_ARGUMENT when unknown program type is passed. */ */ TEST_P(BroadcastRadioHalTest, TuneFailsForUnknownProgram) { TEST_P(BroadcastRadioHalTest, TuneFailsForUnknownProgram) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); // Program type is 1-based, so 0 will be always invalid. // Program type is 1-based, so 0 will be always invalid. Loading @@ -393,7 +380,6 @@ TEST_P(BroadcastRadioHalTest, TuneFailsForUnknownProgram) { * - cancelAnnouncement succeeds either when there is an announcement or there is none. * - cancelAnnouncement succeeds either when there is an announcement or there is none. */ */ TEST_P(BroadcastRadioHalTest, CancelAnnouncement) { TEST_P(BroadcastRadioHalTest, CancelAnnouncement) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); auto hidlResult = mTuner->cancelAnnouncement(); auto hidlResult = mTuner->cancelAnnouncement(); Loading @@ -407,8 +393,6 @@ TEST_P(BroadcastRadioHalTest, CancelAnnouncement) { * - getImage call handles argument 0 gracefully. * - getImage call handles argument 0 gracefully. */ */ TEST_P(BroadcastRadioHalTest, GetNoImage) { TEST_P(BroadcastRadioHalTest, GetNoImage) { if (skipped) return; size_t len = 0; size_t len = 0; auto hidlResult = auto hidlResult = mRadioModule->getImage(0, [&](hidl_vec<uint8_t> rawImage) { len = rawImage.size(); }); mRadioModule->getImage(0, [&](hidl_vec<uint8_t> rawImage) { len = rawImage.size(); }); Loading @@ -425,7 +409,6 @@ TEST_P(BroadcastRadioHalTest, GetNoImage) { * - images are available for getImage call. * - images are available for getImage call. */ */ TEST_P(BroadcastRadioHalTest, OobImagesOnly) { TEST_P(BroadcastRadioHalTest, OobImagesOnly) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); std::vector<int> imageIds; std::vector<int> imageIds; Loading @@ -446,8 +429,7 @@ TEST_P(BroadcastRadioHalTest, OobImagesOnly) { } while (nextBand()); } while (nextBand()); if (imageIds.size() == 0) { if (imageIds.size() == 0) { printSkipped("No images found"); GTEST_SKIP() << "No images found"; return; } } for (auto id : imageIds) { for (auto id : imageIds) { Loading @@ -469,7 +451,6 @@ TEST_P(BroadcastRadioHalTest, OobImagesOnly) { * - setAnalogForced results either with INVALID_STATE, or isAnalogForced replying the same. * - setAnalogForced results either with INVALID_STATE, or isAnalogForced replying the same. */ */ TEST_P(BroadcastRadioHalTest, AnalogForcedSwitch) { TEST_P(BroadcastRadioHalTest, AnalogForcedSwitch) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); bool forced; bool forced; Loading Loading @@ -584,7 +565,6 @@ static void verifyIdentifier(const ProgramIdentifier& id) { * - values of ProgramIdentifier match their definitions at IdentifierType. * - values of ProgramIdentifier match their definitions at IdentifierType. */ */ TEST_P(BroadcastRadioHalTest, VerifyIdentifiersFormat) { TEST_P(BroadcastRadioHalTest, VerifyIdentifiersFormat) { if (skipped) return; ASSERT_TRUE(openTuner()); ASSERT_TRUE(openTuner()); do { do { Loading