From afe90852d4a9216e4468f7c5917047b43b44a877 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Fri, 24 Feb 2023 09:57:16 -0800 Subject: [PATCH] audio: Remove InputStreamTest#getCapturePosition test The test was created based on assumptions and the current HAL behavior. There is no actual requirement in the HIDL interface for a stream to have a zero capture position prior to start. In fact, some streams may be created by the HAL "pre-loaded" with data if audio has already been captured by the DSP and needs to be passed to the framework. Bug: 270478574 Test: atest VtsHalAudioV7_1TargetTest Change-Id: Ied6a71b73bff403365dd85fe6a212cfa4a5b284d --- .../vts/functional/AudioPrimaryHidlHalTest.h | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h index 98e49a214f..478482d412 100644 --- a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h +++ b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h @@ -1698,26 +1698,6 @@ TEST_P(InputStreamTest, GetInputFramesLost) { ASSERT_EQ(0U, framesLost); } -TEST_P(InputStreamTest, getCapturePosition) { - doc::test( - "The capture position of a non prepared stream should not be " - "retrievable or 0"); - uint64_t frames; - uint64_t time; - ASSERT_OK(stream->getCapturePosition(returnIn(res, frames, time))); - // Although 'getCapturePosition' is mandatory in V7, legacy implementations - // may return -ENOSYS (which is translated to NOT_SUPPORTED) in cases when - // the capture position can't be retrieved, e.g. when the stream isn't - // running. Because of this, we don't fail when getting NOT_SUPPORTED - // in this test. Behavior of 'getCapturePosition' for running streams is - // tested in 'PcmOnlyConfigInputStreamTest' for V7. - ASSERT_RESULT(okOrInvalidStateOrNotSupported, res); - if (res == Result::OK) { - ASSERT_EQ(0U, frames); - ASSERT_LE(0U, time); - } -} - ////////////////////////////////////////////////////////////////////////////// ///////////////////////////////// StreamOut ////////////////////////////////// //////////////////////////////////////////////////////////////////////////////