verifyFrontendStatus Test

Implemented some of the TODO's on the FrontendTests.cpp file.

Fixed the code formatting issue of having a long line. Some comments
were deleted.

Reverted the TODO back to its original wording.

Change-Id: I932e218498c5f61da4196b21312dfef41778fcfd
This commit is contained in:
Frankie Lizcano
2022-05-24 23:06:43 +00:00
parent 4ce7f81f67
commit f09587c7aa

View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/
#include <aidl/android/hardware/tv/tuner/Result.h>
#include "FrontendTests.h"
#include <aidl/android/hardware/tv/tuner/Result.h>
ndk::ScopedAStatus FrontendCallback::onEvent(FrontendEventType frontendEventType) {
android::Mutex::Autolock autoLock(mMsgLock);
ALOGD("[vts] frontend event received. Type: %d", frontendEventType);
@@ -323,7 +323,10 @@ void FrontendTests::verifyFrontendStatus(vector<FrontendStatusType> statusTypes,
FrontendStatusType type = statusTypes[i];
switch (type) {
case FrontendStatusType::MODULATIONS: {
// TODO: verify modulations
ASSERT_TRUE(std::equal(
realStatuses[i].get<FrontendStatus::Tag::modulations>().begin(),
realStatuses[i].get<FrontendStatus::Tag::modulations>().end(),
expectStatuses[i].get<FrontendStatus::Tag::modulations>().begin()));
break;
}
case FrontendStatusType::BERS: {
@@ -340,11 +343,13 @@ void FrontendTests::verifyFrontendStatus(vector<FrontendStatusType> statusTypes,
break;
}
case FrontendStatusType::GUARD_INTERVAL: {
// TODO: verify interval
ASSERT_TRUE(realStatuses[i].get<FrontendStatus::Tag::interval>() ==
expectStatuses[i].get<FrontendStatus::Tag::interval>());
break;
}
case FrontendStatusType::TRANSMISSION_MODE: {
// TODO: verify tranmission mode
ASSERT_TRUE(realStatuses[i].get<FrontendStatus::Tag::transmissionMode>() ==
expectStatuses[i].get<FrontendStatus::Tag::transmissionMode>());
break;
}
case FrontendStatusType::UEC: {
@@ -379,7 +384,8 @@ void FrontendTests::verifyFrontendStatus(vector<FrontendStatusType> statusTypes,
break;
}
case FrontendStatusType::ROLL_OFF: {
// TODO: verify roll off
ASSERT_TRUE(realStatuses[i].get<FrontendStatus::Tag::rollOff>() ==
expectStatuses[i].get<FrontendStatus::Tag::rollOff>());
break;
}
case FrontendStatusType::IS_MISO: {
@@ -599,9 +605,10 @@ void FrontendTests::statusReadinessTest(FrontendConfig frontendConf) {
ASSERT_TRUE(tuneFrontend(frontendConf, false /*testWithDemux*/));
// TODO: find a better way to push all frontend status types
for (int32_t i = 0; i < static_cast<int32_t>(FrontendStatusType::ATSC3_ALL_PLP_INFO); i++) {
for (int32_t i = 0; i <= static_cast<int32_t>(FrontendStatusType::ATSC3_ALL_PLP_INFO); i++) {
allTypes.push_back(static_cast<FrontendStatusType>(i));
}
ndk::ScopedAStatus status = mFrontend->getFrontendStatusReadiness(allTypes, &readiness);
ASSERT_TRUE(status.isOk());
ASSERT_TRUE(readiness.size() == allTypes.size());