From 4a9941d7a688bd35d936f10860f1024f4c82b9f9 Mon Sep 17 00:00:00 2001 From: junchao yuan Date: Tue, 1 Mar 2022 16:08:37 +0800 Subject: [PATCH] vts: fix some tunerhal vts fail without frontend device PD#OTT-27646 bug:222020221 Problem: some tunerhal vts fail without frontend device Solution: fix some logic errors without frontend device verify: ohm Change-Id: I611a81400eb21bb52d59281f2266f3a95e015de9 Signed-off-by: junchao yuan --- tv/tuner/1.0/vts/functional/FrontendTests.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tv/tuner/1.0/vts/functional/FrontendTests.cpp b/tv/tuner/1.0/vts/functional/FrontendTests.cpp index 5265f2d790..22a4bf97a3 100644 --- a/tv/tuner/1.0/vts/functional/FrontendTests.cpp +++ b/tv/tuner/1.0/vts/functional/FrontendTests.cpp @@ -418,16 +418,18 @@ AssertionResult FrontendTests::closeFrontend() { void FrontendTests::getFrontendIdByType(FrontendType feType, uint32_t& feId) { ASSERT_TRUE(getFrontendIds()); - ASSERT_TRUE(mFeIds.size() > 0); - for (size_t i = 0; i < mFeIds.size(); i++) { - ASSERT_TRUE(getFrontendInfo(mFeIds[i])); - if (mFrontendInfo.type != feType) { - continue; + if (mFeIds.size() > 0) { + for (size_t i = 0; i < mFeIds.size(); i++) { + ASSERT_TRUE(getFrontendInfo(mFeIds[i])); + if (mFrontendInfo.type != feType) { + continue; + } + feId = mFeIds[i]; + return; } - feId = mFeIds[i]; - return; + } else { + feId = INVALID_ID; } - feId = INVALID_ID; } void FrontendTests::tuneTest(FrontendConfig frontendConf) {