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

Commit 28c51279 authored by Andy Hung's avatar Andy Hung
Browse files

VtsHalLoudnessEnhancerTargetTest: Reset signal history during gain test

The Loudness Enhancer carries signal state that should
be preserved during gain changes to prevent clicking.

Flag: EXEMPT bugfix
Test: atest VtsHalLoudnessEnhancerTargetTest
Bug: 399924660
Bug: 400512386
Change-Id: I3aa763cfe15386a05279fa0ee5b9f253e8917d1e
parent 39bb3cb7
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -95,6 +95,8 @@ class LoudnessEnhancerEffectHelper : public EffectHelper {
        EXPECT_STATUS(expected, mEffect->setParameter(param)) << param.toString();
    }

    void reset() { EXPECT_STATUS(EX_NONE, mEffect->command(CommandId::RESET)); }

    void validateParameters(int gain) {
        // get parameter
        LoudnessEnhancer::Id leId;
@@ -218,6 +220,8 @@ class LoudnessEnhancerDataTest : public ::testing::TestWithParam<LoudnessEnhance
        binder_exception_t expected;
        expected = isGainValid(kZeroGain);
        ASSERT_EQ(expected, EX_NONE);
        // reset state to prevent prior signal history from affecting trial run.
        ASSERT_NO_FATAL_FAILURE(reset());
        setParameters(kZeroGain, expected);
        ASSERT_NO_FATAL_FAILURE(processAndWriteToOutput());
        baseOutput = mOutputBuffer;
@@ -229,6 +233,8 @@ class LoudnessEnhancerDataTest : public ::testing::TestWithParam<LoudnessEnhance
            if (expected != EX_NONE) {
                GTEST_SKIP() << "Gains not supported.";
            }
            // reset state to prevent prior signal history from affecting trial run.
            ASSERT_NO_FATAL_FAILURE(reset());
            setParameters(gain, expected);
            ASSERT_NO_FATAL_FAILURE(processAndWriteToOutput());