From 6c1a0a6b9481a3650d691e7bdf8cfe9e7252c4ee Mon Sep 17 00:00:00 2001 From: "derek.li" Date: Mon, 9 Aug 2021 17:21:12 +0800 Subject: [PATCH] Skip test on VtsHalTvTunerV1_0TargetTest if tuner type unsupported Check tuner type before running VtsHalTvTunerV1_0TargetTest, skip testcase if test is not design for that type of tuner. Bug: 194774941 Test: run vts -m VtsHalTvTunerV1_0TargetTest Change-Id: Iacd1356e9e60e9b69ecbe38f8d1f76f42138efb0 --- tv/tuner/1.0/vts/functional/FrontendTests.cpp | 5 +++++ .../vts/functional/VtsHalTvTunerV1_0TargetTest.cpp | 14 ++++++++++++++ 2 files changed, 19 insertions(+) mode change 100644 => 100755 tv/tuner/1.0/vts/functional/FrontendTests.cpp mode change 100644 => 100755 tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp diff --git a/tv/tuner/1.0/vts/functional/FrontendTests.cpp b/tv/tuner/1.0/vts/functional/FrontendTests.cpp old mode 100644 new mode 100755 index 45951d2b20..caa2f55a4b --- a/tv/tuner/1.0/vts/functional/FrontendTests.cpp +++ b/tv/tuner/1.0/vts/functional/FrontendTests.cpp @@ -430,6 +430,9 @@ void FrontendTests::getFrontendIdByType(FrontendType feType, uint32_t& feId) { void FrontendTests::tuneTest(FrontendConfig frontendConf) { uint32_t feId; + if (frontendConf.type != FrontendType::DVBC) + GTEST_SKIP() << "Skipping this test since not DVBC."; + getFrontendIdByType(frontendConf.type, feId); ASSERT_TRUE(feId != INVALID_ID); ASSERT_TRUE(openFrontendById(feId)); @@ -442,6 +445,8 @@ void FrontendTests::tuneTest(FrontendConfig frontendConf) { void FrontendTests::scanTest(FrontendConfig frontendConf, FrontendScanType scanType) { uint32_t feId; + if (frontendConf.type != FrontendType::DVBC) + GTEST_SKIP() << "Skipping this test since not DVBC."; getFrontendIdByType(frontendConf.type, feId); ASSERT_TRUE(feId != INVALID_ID); ASSERT_TRUE(openFrontendById(feId)); diff --git a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp old mode 100644 new mode 100755 index 7c7f0f6ebc..8e62c8cd3c --- a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp +++ b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp @@ -37,6 +37,8 @@ void TunerFilterHidlTest::configSingleFilterInDemuxTest(FilterConfig filterConf, uint32_t demuxId; sp demux; uint32_t filterId; + if (frontendConf.type != FrontendType::DVBC) + GTEST_SKIP() << "Skipping this test since not DVBC."; mFrontendTests.getFrontendIdByType(frontendConf.type, feId); ASSERT_TRUE(feId != INVALID_ID); @@ -174,6 +176,9 @@ void TunerRecordHidlTest::recordSingleFilterTest(FilterConfig filterConf, uint32_t filterId; sp filter; + if (frontendConf.type != FrontendType::DVBC) + GTEST_SKIP() << "Skipping this test since not DVBC."; + mFrontendTests.getFrontendIdByType(frontendConf.type, feId); ASSERT_TRUE(feId != INVALID_ID); ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); @@ -240,6 +245,9 @@ void TunerRecordHidlTest::attachSingleFilterToRecordDvrTest(FilterConfig filterC uint32_t filterId; sp filter; + if (frontendConf.type != FrontendType::DVBC) + GTEST_SKIP() << "Skipping this test since not DVBC."; + mFrontendTests.getFrontendIdByType(frontendConf.type, feId); ASSERT_TRUE(feId != INVALID_ID); ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); @@ -390,6 +398,8 @@ TEST_P(TunerDemuxHidlTest, openDemux) { uint32_t demuxId; sp demux; mFrontendTests.getFrontendIdByType(frontendArray[defaultFrontend].type, feId); + if (frontendArray[DVBT].type != FrontendType::DVBC) + GTEST_SKIP() << "Skipping this test since not DVBC."; ASSERT_TRUE(feId != INVALID_ID); ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); ASSERT_TRUE(mFrontendTests.setFrontendCallback()); @@ -408,6 +418,8 @@ TEST_P(TunerDemuxHidlTest, getAvSyncTime) { uint32_t pcrFilterId; uint32_t avSyncHwId; sp mediaFilter; + if (frontendArray[DVBT].type != FrontendType::DVBC) + GTEST_SKIP() << "Skipping this test since not DVBC."; mFrontendTests.getFrontendIdByType(frontendArray[defaultFrontend].type, feId); ASSERT_TRUE(feId != INVALID_ID); @@ -531,6 +543,8 @@ TEST_P(TunerDescramblerHidlTest, CreateDescrambler) { uint32_t demuxId; sp demux; mFrontendTests.getFrontendIdByType(frontendArray[defaultFrontend].type, feId); + if (frontendArray[DVBT].type != FrontendType::DVBC) + GTEST_SKIP() << "Skipping this test since not DVBC."; ASSERT_TRUE(feId != INVALID_ID); ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); ASSERT_TRUE(mFrontendTests.setFrontendCallback());