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

Commit 16d65479 authored by Kevin Rocard's avatar Kevin Rocard
Browse files

Audio V4: Improve VTS error messages



This does not change the test logic or constraints.
It only improves the error messages.

Bug: 77307068
Test: atest VtsHalAudioV4_0TargetTest
Change-Id: I6c79ddd014d4ab8aba4f1d0b918888f83dfb63ad
Signed-off-by: default avatarKevin Rocard <krocard@google.com>
parent fba21730
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ namespace common {
namespace AUDIO_HAL_VERSION {
DEFINE_GTEST_PRINT_TO(AudioConfig)
DEFINE_GTEST_PRINT_TO(AudioDevice)
DEFINE_GTEST_PRINT_TO(AudioFormat)
DEFINE_GTEST_PRINT_TO(AudioChannelMask)
}  // namespace AUDIO_HAL_VERSION
}  // namespace common
+5 −4
Original line number Diff line number Diff line
@@ -727,11 +727,12 @@ static void testCapabilityGetter(const string& name, IStream* stream,
    ASSERT_OK(ret);

    if (currentMustBeSupported) {
        ASSERT_NE(0U, capabilities.size()) << name << " must not return an empty list";
        Property currentValue = extract((stream->*getter)());
        EXPECT_NE(std::find(capabilities.begin(), capabilities.end(), currentValue),
        EXPECT_TRUE(std::find(capabilities.begin(), capabilities.end(), currentValue) !=
                    capabilities.end())
            << "current " << name << " is not in the list of the supported ones "
            << toString(capabilities);
            << "value returned by " << name << "() = " << testing::PrintToString(currentValue)
            << " is not in the list of the supported ones " << toString(capabilities);
    }

    // Check that all declared supported values are indeed supported