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

Commit c02a7100 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Improve failure logging in AudioHealthTest" am: 7e7b547d

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1580727

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I174f72ea61337860e541907eaa16702305d4ea0d
parents ffd6a7e7 7e7b547d
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <gtest/gtest.h>

#include <media/AudioSystem.h>
#include <media/TypeConverter.h>
#include <system/audio.h>
#include <utils/Log.h>

@@ -68,9 +69,18 @@ TEST(AudioHealthTest, AttachedDeviceFound) {
    ASSERT_NE("AudioPolicyConfig::setDefault", manager.getConfig().getSource());

    for (auto desc : manager.getConfig().getInputDevices()) {
        ASSERT_NE(attachedDevices.end(), attachedDevices.find(desc->type()));
        if (attachedDevices.find(desc->type()) == attachedDevices.end()) {
            std::string deviceType;
            (void)DeviceConverter::toString(desc->type(), deviceType);
            ADD_FAILURE() << "Input device \"" << deviceType << "\" not found";
        }
    }
    for (auto desc : manager.getConfig().getOutputDevices()) {
        ASSERT_NE(attachedDevices.end(), attachedDevices.find(desc->type()));
        if (attachedDevices.find(desc->type()) == attachedDevices.end()) {
            std::string deviceType;
            (void)DeviceConverter::toString(desc->type(), deviceType);
            ADD_FAILURE() << "Output device \"" << deviceType << "\" not found";
        }
    }
}