Loading audio/aidl/vts/TestUtils.h +27 −0 Original line number Diff line number Diff line Loading @@ -124,3 +124,30 @@ inline ::testing::AssertionResult assertResultOrUnknownTransaction( EXPECT_PRED_FORMAT2( \ ::android::hardware::audio::common::testing::detail::assertResultOrUnknownTransaction, \ expected, ret) namespace android::hardware::audio::common::testing::detail { template <typename> struct mf_traits {}; template <class T, class U> struct mf_traits<U T::*> { using member_type = U; }; } // namespace android::hardware::audio::common::testing::detail namespace aidl::android::media::audio::common { template <typename P> std::enable_if_t<std::is_function_v<typename ::android::hardware::audio::common::testing::detail:: mf_traits<decltype(&P::toString)>::member_type>, std::ostream&> operator<<(std::ostream& os, const P& p) { return os << p.toString(); } template <typename E> std::enable_if_t<std::is_enum_v<E>, std::ostream&> operator<<(std::ostream& os, const E& e) { return os << toString(e); } } // namespace aidl::android::media::audio::common audio/aidl/vts/VtsHalAudioCoreConfigTargetTest.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -341,7 +341,7 @@ class AudioCoreConfig : public testing::TestWithParam<std::string> { auto values = criterionV2.values; auto valueIt = find_if(values.begin(), values.end(), [&](const auto& typedValue) { return typedValue == value; }); EXPECT_NE(valueIt, values.end()); EXPECT_NE(valueIt, values.end()) << "Not found: \"" << value << "\""; } /** Loading Loading
audio/aidl/vts/TestUtils.h +27 −0 Original line number Diff line number Diff line Loading @@ -124,3 +124,30 @@ inline ::testing::AssertionResult assertResultOrUnknownTransaction( EXPECT_PRED_FORMAT2( \ ::android::hardware::audio::common::testing::detail::assertResultOrUnknownTransaction, \ expected, ret) namespace android::hardware::audio::common::testing::detail { template <typename> struct mf_traits {}; template <class T, class U> struct mf_traits<U T::*> { using member_type = U; }; } // namespace android::hardware::audio::common::testing::detail namespace aidl::android::media::audio::common { template <typename P> std::enable_if_t<std::is_function_v<typename ::android::hardware::audio::common::testing::detail:: mf_traits<decltype(&P::toString)>::member_type>, std::ostream&> operator<<(std::ostream& os, const P& p) { return os << p.toString(); } template <typename E> std::enable_if_t<std::is_enum_v<E>, std::ostream&> operator<<(std::ostream& os, const E& e) { return os << toString(e); } } // namespace aidl::android::media::audio::common
audio/aidl/vts/VtsHalAudioCoreConfigTargetTest.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -341,7 +341,7 @@ class AudioCoreConfig : public testing::TestWithParam<std::string> { auto values = criterionV2.values; auto valueIt = find_if(values.begin(), values.end(), [&](const auto& typedValue) { return typedValue == value; }); EXPECT_NE(valueIt, values.end()); EXPECT_NE(valueIt, values.end()) << "Not found: \"" << value << "\""; } /** Loading