From 01ead7c96b67f230425e8c131258d5ff9b8aa3ff Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Thu, 28 Jun 2018 17:34:11 -0700 Subject: [PATCH] Audio VTS: run tear-down hooks in LIFO instead of FIFO The audio tests use a static cache of some HAL objects for performance reasons (speed up by 10x on Pixel). Those object are destroy during the test environment tear-down. This tear-down was destroying the objects in a FIFO instead of LIFO order. Thus the DeficesFactory was destroyed before the Device it created. Bug: 79889318 Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target check that the device destructor is called before the devicesFactory one. Change-Id: I1b4345158139ba14a8779a9508f7ebdc41129d1d Merged-In: I1b4345158139ba14a8779a9508f7ebdc41129d1d Signed-off-by: Kevin Rocard --- audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp b/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp index a5b37af49a..428484fd9b 100644 --- a/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp +++ b/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp @@ -124,7 +124,7 @@ class Environment : public ::testing::Environment { public: using TearDownFunc = std::function; void registerTearDown(TearDownFunc&& tearDown) { - tearDowns.push_back(std::move(tearDown)); + tearDowns.push_front(std::move(tearDown)); } private: