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
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
index a1f51df..2ff0c3d 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
@@ -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 @@
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 @@
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 @@
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 @@
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());