summaryrefslogtreecommitdiffstats
path: root/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
diff options
context:
space:
mode:
authorKevin Rocard <krocard@google.com>2018-04-21 00:32:06 -0700
committerKevin Rocard <krocard@google.com>2018-04-21 01:32:34 -0700
commitdea4c3803fb07822a08c382dc26af32804c32772 (patch)
tree3b76c73c261dacf01f7432b101478ab9e86b4ad9 /audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
parent92dcce09245a48fa04caaec4cfbf31859615fd4c (diff)
downloadandroid_hardware_interfaces-dea4c3803fb07822a08c382dc26af32804c32772.tar.gz
android_hardware_interfaces-dea4c3803fb07822a08c382dc26af32804c32772.tar.bz2
android_hardware_interfaces-dea4c3803fb07822a08c382dc26af32804c32772.zip
Audio V4: setMode VTS incorrectly assume 0 was invalid
Thus the test was always incorrectly failing. Also improve the test error messages. Bug: 77307068 Test: VtsHalAudioV4_0TargetTest Change-Id: I95db94ed99f7ca32af35422e36a95084e72279d8 Signed-off-by: Kevin Rocard <krocard@google.com>
Diffstat (limited to 'audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp')
-rw-r--r--audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp b/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
index 5ce2cdc0b..c8593e9ef 100644
--- a/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
+++ b/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
@@ -1272,19 +1272,16 @@ TEST_F(AudioPrimaryHidlTest, setVoiceVolume) {
}
TEST_F(AudioPrimaryHidlTest, setMode) {
- doc::test(
- "Make sure setMode always succeeds if mode is valid "
- "and fails otherwise");
+ doc::test("Make sure setMode always succeeds if mode is valid and fails otherwise");
// Test Invalid values
- for (int mode : {-1, 0, int(AudioMode::IN_COMMUNICATION) + 1}) {
- SCOPED_TRACE("mode=" + to_string(mode));
- ASSERT_RESULT(Result::INVALID_ARGUMENTS, device->setMode(AudioMode(mode)));
+ for (int mode : {-2, -1, int(AudioMode::IN_COMMUNICATION) + 1}) {
+ ASSERT_RESULT(Result::INVALID_ARGUMENTS, device->setMode(AudioMode(mode)))
+ << "mode=" << mode;
}
// Test valid values
for (AudioMode mode : {AudioMode::IN_CALL, AudioMode::IN_COMMUNICATION, AudioMode::RINGTONE,
AudioMode::NORMAL /* Make sure to leave the test in normal mode */}) {
- SCOPED_TRACE("mode=" + toString(mode));
- ASSERT_OK(device->setMode(mode));
+ ASSERT_OK(device->setMode(mode)) << "mode=" << toString(mode);
}
}