Audio VTS: Do not constrain implementation frameCount
authorKevin Rocard <krocard@google.com>
Thu, 20 Sep 2018 21:28:46 +0000 (14:28 -0700)
committerKevin Rocard <krocard@google.com>
Tue, 2 Oct 2018 22:07:39 +0000 (22:07 +0000)
The test was assuming Stream::getFrameCount() would return the
AudioConfig::frameCount used to create the stream, similarly
to the sampleRate or the channelMask.

Nevertheless this is not the case as the AudioConfig::frameCount
field is not to used by Stream::openOutputStream (nor Input) as
the buffer size is chosen by the HAL, not the framework.

Thus the test can not assume the frameCount chosen by the HAL and
must not test for a particular value.

Test: atest VtsHalAudioV4_0TargetTest
Bug: 116169974
Change-Id: Ibbf0825f540957e01e7c512d851cb9628991f4c4
Signed-off-by: Kevin Rocard <krocard@google.com>
audio/core/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp
audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp

index bb1d26f9284e0163344ab3e3e1f5129c88f15890..a08a2d62bbf3f2e3401e758920443beefcada675 100644 (file)
@@ -661,8 +661,8 @@ static R extract(Return<R> ret) {
         code;                                          \
     }
 
-TEST_IO_STREAM(GetFrameCount, "Check that the stream frame count == the one it was opened with",
-               ASSERT_EQ(audioConfig.frameCount, extract(stream->getFrameCount())))
+TEST_IO_STREAM(GetFrameCount, "Check that getting stream frame count does not crash the HAL.",
+               ASSERT_TRUE(stream->getFrameCount().isOk()))
 
 TEST_IO_STREAM(GetSampleRate, "Check that the stream sample rate == the one it was opened with",
                ASSERT_EQ(audioConfig.sampleRateHz, extract(stream->getSampleRate())))
index 4dc01e7ed9c0b971efac649b5fd92ef93150a69d..46c228a19f726150cc3a01e66d7d8e3405cdc1d8 100644 (file)
@@ -823,8 +823,8 @@ static R extract(Return<R> ret) {
         code;                                          \
     }
 
-TEST_IO_STREAM(GetFrameCount, "Check that the stream frame count == the one it was opened with",
-               ASSERT_EQ(audioConfig.frameCount, extract(stream->getFrameCount())))
+TEST_IO_STREAM(GetFrameCount, "Check that getting stream frame count does not crash the HAL.",
+               ASSERT_TRUE(stream->getFrameCount().isOk()))
 
 TEST_IO_STREAM(GetSampleRate, "Check that the stream sample rate == the one it was opened with",
                ASSERT_EQ(audioConfig.sampleRateHz, extract(stream->getSampleRate())))