Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b903124b authored by Kevin Rocard's avatar Kevin Rocard
Browse files

Audio HAL VTS: Test IStream::debugDump



Test: run it on target
Bug: 34170075
Change-Id: I4af190806f79e0c03b59e1cd60b6f58a08b05322
Signed-off-by: default avatarKevin Rocard <krocard@google.com>
parent a7df7fc0
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -436,8 +436,8 @@ TEST_F(AudioPrimaryHidlTest, getParameters) {
//////////////////////////////// debugDebug //////////////////////////////////
//////////////////////////////////////////////////////////////////////////////

TEST_F(AudioPrimaryHidlTest, debugDump) {
    doc::test("Check that the hal can dump its state without error");
template <class DebugDump>
static void testDebugDump(DebugDump debugDump) {
    FILE* file = tmpfile();
    ASSERT_NE(nullptr, file) << errno;

@@ -450,7 +450,7 @@ TEST_F(AudioPrimaryHidlTest, debugDump) {

    // TODO: debugDump does not return a Result.
    // This mean that the hal can not report that it not implementing the function.
    ASSERT_OK(device->debugDump(handle));
    ASSERT_OK(debugDump(handle));

    rewind(file); // can not fail

@@ -460,6 +460,11 @@ TEST_F(AudioPrimaryHidlTest, debugDump) {
    EXPECT_EQ(0, fclose(file)) << errno;
}

TEST_F(AudioPrimaryHidlTest, debugDump) {
    doc::test("Check that the hal can dump its state without error");
    testDebugDump([this](const auto& handle){ return device->debugDump(handle); });
}

//////////////////////////////////////////////////////////////////////////////
////////////////////////// open{Output,Input}Stream //////////////////////////
//////////////////////////////////////////////////////////////////////////////
@@ -686,6 +691,10 @@ TEST_IO_STREAM(GetAudioProperties,
               "Check that the stream audio properties == the ones it was opened with",
               testGetAudioProperties(stream.get(), audioConfig))

TEST_IO_STREAM(DebugDump,
               "Check that a stream can dump its state without error",
               testDebugDump([this](const auto& handle){ return stream->debugDump(handle); }))

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////// AudioPatches ////////////////////////////////
//////////////////////////////////////////////////////////////////////////////