From a0698429dd47e2f029866765c6980bc8720a7acb Mon Sep 17 00:00:00 2001 From: Ram Mohan M Date: Wed, 11 Oct 2017 15:38:25 +0530 Subject: [PATCH] bug fix: during fatal fails bypass freeNode() calls 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 --- .../functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp | 4 ++++ .../functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp | 4 ++++ .../component/VtsHalMediaOmxV1_0TargetComponentTest.cpp | 4 ++++ .../functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp | 4 ++++ .../functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp index 9e185f2799..38cdcd6508 100644 --- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp +++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp @@ -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; } diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp index d872444933..953dc7507b 100644 --- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp +++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp @@ -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; } diff --git a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp index 401e54ab9f..d66136d212 100644 --- a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp +++ b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp @@ -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; } diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp index 667c2e1248..9b74a339c0 100644 --- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp +++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp @@ -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; } diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp index 743ff787a2..099658f8ae 100644 --- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp +++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp @@ -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; }