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

Commit 9d114dbf authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow getCapturePosition to return 0 frames for unprepared streams" into pi-dev

parents e4722f92 6c9c6e62
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -106,7 +106,10 @@ using namespace ::android::hardware::audio::common::test::utility;
static auto okOrNotSupported = {Result::OK, Result::NOT_SUPPORTED};
static auto okOrNotSupportedOrInvalidArgs = {Result::OK, Result::NOT_SUPPORTED,
                                             Result::INVALID_ARGUMENTS};
static auto okOrInvalidStateOrNotSupported = {Result::OK, Result::INVALID_STATE,
                                              Result::NOT_SUPPORTED};
static auto invalidArgsOrNotSupported = {Result::INVALID_ARGUMENTS, Result::NOT_SUPPORTED};
static auto invalidStateOrNotSupported = {Result::INVALID_STATE, Result::NOT_SUPPORTED};

class AudioHidlTestEnvironment : public ::Environment {
   public:
@@ -949,8 +952,6 @@ TEST_IO_STREAM(RemoveNonExistingEffect, "Removing a non existing effect should f
TEST_IO_STREAM(standby, "Make sure the stream can be put in stanby",
               ASSERT_OK(stream->standby()))  // can not fail

static constexpr auto invalidStateOrNotSupported = {Result::INVALID_STATE, Result::NOT_SUPPORTED};

TEST_IO_STREAM(startNoMmap, "Starting a mmaped stream before mapping it should fail",
               ASSERT_RESULT(invalidStateOrNotSupported, stream->start()))

@@ -1070,11 +1071,15 @@ TEST_P(InputStreamTest, GetInputFramesLost) {
TEST_P(InputStreamTest, getCapturePosition) {
    doc::test(
        "The capture position of a non prepared stream should not be "
        "retrievable");
        "retrievable or 0");
    uint64_t frames;
    uint64_t time;
    ASSERT_OK(stream->getCapturePosition(returnIn(res, frames, time)));
    ASSERT_RESULT(invalidStateOrNotSupported, res);
    ASSERT_RESULT(okOrInvalidStateOrNotSupported, res);
    if (res == Result::OK) {
        ASSERT_EQ(0U, frames);
        ASSERT_LE(0U, time);
    }
}

TEST_P(InputStreamTest, updateSinkMetadata) {