OSDN Git Service

bug fix: during fatal fails bypass freeNode() calls
authorRam Mohan M <ram.mohan@ittiam.com>
Wed, 11 Oct 2017 10:08:25 +0000 (15:38 +0530)
committerPawin Vongmasa <pawin@google.com>
Tue, 17 Oct 2017 11:34:30 +0000 (04:34 -0700)
If test application undergoes a fatal failure bypass all the omx
api calls till the application safely returns.

Test: make vts -j99 BUILD_GOOGLE_VTS=true TARGET_PRODUCT=aosp_arm64 \
&& vts-tradefed run commandAndExit vts \
--skip-all-system-status-check --primary-abi-only \
--skip-preconditions --module VtsHalMediaOmxV1_0Host \
-l INFO

Bug: 63796949

Change-Id: If5a33672a31665db913e53c6f8ba8bea6cfd3ebd

media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp
media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp

index 9e185f2..38cdcd6 100644 (file)
@@ -230,6 +230,10 @@ class AudioDecHidlTest : public ::testing::VtsHalHidlTargetTestBase {
 
     virtual void TearDown() override {
         if (omxNode != nullptr) {
+            // If you have encountered a fatal failure, it is possible that
+            // freeNode() will not go through. Instead of hanging the app.
+            // let it pass through and report errors
+            if (::testing::Test::HasFatalFailure()) return;
             EXPECT_TRUE((omxNode->freeNode()).isOk());
             omxNode = nullptr;
         }
index d872444..953dc75 100644 (file)
@@ -216,6 +216,10 @@ class AudioEncHidlTest : public ::testing::VtsHalHidlTargetTestBase {
 
     virtual void TearDown() override {
         if (omxNode != nullptr) {
+            // If you have encountered a fatal failure, it is possible that
+            // freeNode() will not go through. Instead of hanging the app.
+            // let it pass through and report errors
+            if (::testing::Test::HasFatalFailure()) return;
             EXPECT_TRUE((omxNode->freeNode()).isOk());
             omxNode = nullptr;
         }
index 401e54a..d66136d 100644 (file)
@@ -191,6 +191,10 @@ class ComponentHidlTest : public ::testing::VtsHalHidlTargetTestBase {
 
     virtual void TearDown() override {
         if (omxNode != nullptr) {
+            // If you have encountered a fatal failure, it is possible that
+            // freeNode() will not go through. Instead of hanging the app.
+            // let it pass through and report errors
+            if (::testing::Test::HasFatalFailure()) return;
             EXPECT_TRUE((omxNode->freeNode()).isOk());
             omxNode = nullptr;
         }
index 667c2e1..9b74a33 100644 (file)
@@ -232,6 +232,10 @@ class VideoDecHidlTest : public ::testing::VtsHalHidlTargetTestBase {
 
     virtual void TearDown() override {
         if (omxNode != nullptr) {
+            // If you have encountered a fatal failure, it is possible that
+            // freeNode() will not go through. Instead of hanging the app.
+            // let it pass through and report errors
+            if (::testing::Test::HasFatalFailure()) return;
             EXPECT_TRUE((omxNode->freeNode()).isOk());
             omxNode = nullptr;
         }
index 743ff78..099658f 100644 (file)
@@ -243,6 +243,10 @@ class VideoEncHidlTest : public ::testing::VtsHalHidlTargetTestBase {
 
     virtual void TearDown() override {
         if (omxNode != nullptr) {
+            // If you have encountered a fatal failure, it is possible that
+            // freeNode() will not go through. Instead of hanging the app.
+            // let it pass through and report errors
+            if (::testing::Test::HasFatalFailure()) return;
             EXPECT_TRUE((omxNode->freeNode()).isOk());
             omxNode = nullptr;
         }