diff options
Diffstat (limited to 'audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp')
-rw-r--r-- | audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp b/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp index 10215698b8..4b00f35c37 100644 --- a/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp +++ b/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp @@ -171,6 +171,7 @@ public: sp<IDevice> baseDevice; ASSERT_OK(devicesFactory->openDevice(IDevicesFactory::Device::PRIMARY, returnIn(result, baseDevice))); + ASSERT_OK(result); ASSERT_TRUE(baseDevice != nullptr); environment->registerTearDown([]{ device.clear(); }); @@ -990,10 +991,12 @@ struct Capability { }; TEST_P(OutputStreamTest, SupportsPauseAndResumeAndDrain) { + doc::test("Implementation must expose pause, resume and drain capabilities"); Capability(stream.get()); } TEST_P(OutputStreamTest, GetRenderPosition) { + doc::test("The render position should be 0 on a not started"); uint32_t dspFrames; ASSERT_OK(stream->getRenderPosition(returnIn(res, dspFrames))); if (res == Result::NOT_SUPPORTED) { @@ -1005,6 +1008,7 @@ TEST_P(OutputStreamTest, GetRenderPosition) { } TEST_P(OutputStreamTest, GetNextWriteTimestamp) { + doc::test("The render position of a stream just created should be 0"); uint64_t timestampUs; ASSERT_OK(stream->getNextWriteTimestamp(returnIn(res, timestampUs))); if (res == Result::NOT_SUPPORTED) { @@ -1030,6 +1034,7 @@ static bool isAsyncModeSupported(IStreamOut *stream) { } TEST_P(OutputStreamTest, SetCallback) { + doc::test("If supported, registering callback for async operation should never fail"); if (!isAsyncModeSupported(stream.get())) { doc::partialTest("The stream does not support async operations"); return; @@ -1039,6 +1044,7 @@ TEST_P(OutputStreamTest, SetCallback) { } TEST_P(OutputStreamTest, clearCallback) { + doc::test("If supported, clearing a callback to go back to sync operation should not fail"); if (!isAsyncModeSupported(stream.get())) { doc::partialTest("The stream does not support async operations"); return; @@ -1049,6 +1055,7 @@ TEST_P(OutputStreamTest, clearCallback) { } TEST_P(OutputStreamTest, Resume) { + doc::test("If supported, a stream should fail to resume if not previously paused"); if (!Capability(stream.get()).resume) { doc::partialTest("The output stream does not support resume"); return; @@ -1057,6 +1064,7 @@ TEST_P(OutputStreamTest, Resume) { } TEST_P(OutputStreamTest, Pause) { + doc::test("If supported, a stream should fail to pause if not previously started"); if (!Capability(stream.get()).pause) { doc::partialTest("The output stream does not support pause"); return; @@ -1066,21 +1074,24 @@ TEST_P(OutputStreamTest, Pause) { static void testDrain(IStreamOut *stream, AudioDrain type) { if (!Capability(stream).drain) { - doc::partialTest("The output stream does not support pause"); + doc::partialTest("The output stream does not support drain"); return; } ASSERT_RESULT(Result::OK, stream->drain(type)); } TEST_P(OutputStreamTest, DrainAll) { + doc::test("If supported, a stream should always succeed to drain"); testDrain(stream.get(), AudioDrain::ALL); } TEST_P(OutputStreamTest, DrainEarlyNotify) { + doc::test("If supported, a stream should always succeed to drain"); testDrain(stream.get(), AudioDrain::EARLY_NOTIFY); } TEST_P(OutputStreamTest, FlushStop) { + doc::test("If supported, a stream should always succeed to flush"); auto ret = stream->flush(); ASSERT_TRUE(ret.isOk()); if (ret == Result::NOT_SUPPORTED) { @@ -1091,6 +1102,7 @@ TEST_P(OutputStreamTest, FlushStop) { } TEST_P(OutputStreamTest, GetPresentationPositionStop) { + doc::test("If supported, a stream should always succeed to retrieve the presentation position"); uint64_t frames; TimeSpec mesureTS; ASSERT_OK(stream->getPresentationPosition(returnIn(res, frames, mesureTS))); |