Loading automotive/can/1.0/vts/functional/VtsHalCanBusV1_0TargetTest.cpp +43 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <android-base/strings.h> #include <android/hardware/automotive/can/1.0/ICanBus.h> #include <android/hardware/automotive/can/1.0/types.h> #include <can-vts-utils/bus-enumerator.h> #include <can-vts-utils/can-hal-printers.h> #include <gmock/gmock.h> #include <hidl-utils/hidl-utils.h> Loading @@ -27,6 +28,8 @@ namespace android::hardware::automotive::can::V1_0::vts { using hardware::hidl_vec; using InterfaceType = ICanController::InterfaceType; using IfId = ICanController::BusConfig::InterfaceId; struct CanMessageListener : public can::V1_0::ICanMessageListener { virtual Return<void> onReceive(const can::V1_0::CanMessage&) override { return {}; } Loading @@ -41,22 +44,62 @@ class CanBusHalTest : public ::testing::TestWithParam<std::string> { virtual void SetUp() override; virtual void TearDown() override; bool up(InterfaceType iftype, const std::string& srvname, const std::string& ifname); std::tuple<Result, sp<ICloseHandle>> listen(const hidl_vec<CanMessageFilter>& filter, const sp<ICanMessageListener>& listener); sp<ICloseHandle> listenForErrors(const sp<ICanErrorListener>& listener); sp<ICanBus> mCanBus; sp<ICanController> mCanController; }; void CanBusHalTest::SetUp() { mCanBus = ICanBus::getService(GetParam()); ASSERT_TRUE(mCanBus) << "Couldn't open CAN Bus: " << GetParam(); const auto controllers = getAllHalInstanceNames(ICanController::descriptor); ASSERT_GT(controllers.size(), 0u); // just grab the first one mCanController = ICanController::getService(controllers[0]); ASSERT_TRUE(mCanController) << "Couldn't open CAN Controller: " << controllers[0]; // this will throw an error if the bus is already up, but we have to try. up(InterfaceType::VIRTUAL, GetParam(), "vcan0"); } void CanBusHalTest::TearDown() { mCanBus.clear(); } bool CanBusHalTest::up(InterfaceType iftype, const std::string& srvname, const std::string& ifname) { ICanController::BusConfig config = {}; config.name = srvname; // TODO(b/146214370): move interfaceId constructors to a library if (iftype == InterfaceType::SOCKETCAN) { IfId::Socketcan socketcan = {}; socketcan.ifname(ifname); config.interfaceId.socketcan(socketcan); } else if (iftype == InterfaceType::SLCAN) { IfId::Slcan slcan = {}; slcan.ttyname(ifname); config.interfaceId.slcan(slcan); } else if (iftype == InterfaceType::VIRTUAL) { config.interfaceId.virtualif({ifname}); } else { ADD_FAILURE() << "Unexpected iftype: " << toString(iftype); } const auto upresult = mCanController->upInterface(config); if (upresult != ICanController::Result::OK) { // upInterface returns INVALID_STATE if the interface is already up (which is fine). EXPECT_EQ(ICanController::Result::INVALID_STATE, upresult) << ifname << " can't be brought up!"; } return true; } std::tuple<Result, sp<ICloseHandle>> CanBusHalTest::listen( const hidl_vec<CanMessageFilter>& filter, const sp<ICanMessageListener>& listener) { Result halResult; Loading current.txt +9 −1 Original line number Diff line number Diff line Loading @@ -912,4 +912,12 @@ ca62a2a95d173ed323309e5e00f653ad3cceec82a6e5e4976a249cb5aafe2515 android.hardwar fa76bced6b1b71c40fc706c508a9011284c57f57831cd0cf5f45653ed4ea463e android.hardware.neuralnetworks@1.3::types 700d9de9b47984898789f5706e59285ea6fe83aa5744dccf8491c4b881033ae7 android.hardware.camera.device@3.7::ICameraInjectionSession # There should be no more HIDL HALs - please use AIDL instead. # HALs released in Android T 75d10baa98d661fb455622a1b0c76b53f0b19a906c6fb058daadfed5db77ed3f android.hardware.audio@7.1::IDevice 3a69d224c3351bdc5651c77cd588d5a36bb65a34abd423901a9cf63ac5916f20 android.hardware.audio@7.1::IDevicesFactory 4569e703efb9ab0f4fc02bcca866a77d4352e292fbf715927cba31e6eba51ad6 android.hardware.audio@7.1::IPrimaryDevice ec11690878547a55eb1d6a286f83e227d8328c2cf1d069316b55b4e4084fd9a2 android.hardware.audio@7.1::IStreamOut 786b8619580d7cfae70f02136307e141481714fcc76c6b700e655568f1bf0733 android.hardware.audio@7.1::IStreamOutLatencyModeCallback bfbf383768881eb06f99db76ce79135e37b2b105a90d67bf7468f8df05180bf4 android.hardware.audio@7.1::types # There will be no more HIDL HALs. Use AIDL instead. graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +11 −5 Original line number Diff line number Diff line Loading @@ -109,6 +109,11 @@ class GraphicsCompositionTestBase : public ::testing::Test { int32_t getDisplayHeight() const { return getPrimaryDisplay().getDisplayHeight(); } void assertServiceSpecificError(const ScopedAStatus& status, int32_t serviceSpecificError) { ASSERT_EQ(status.getExceptionCode(), EX_SERVICE_SPECIFIC); ASSERT_EQ(status.getServiceSpecificError(), serviceSpecificError); } std::pair<bool, ::android::sp<::android::GraphicBuffer>> allocateBuffer(uint32_t usage) { const auto width = static_cast<uint32_t>(getDisplayWidth()); const auto height = static_cast<uint32_t>(getDisplayHeight()); Loading Loading @@ -222,7 +227,8 @@ class GraphicsCompositionTestBase : public ::testing::Test { mDataspace = readBackBufferAttributes.dataspace; return ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); } EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); EXPECT_NO_FATAL_FAILURE( assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); return false; } Loading Loading @@ -458,7 +464,7 @@ TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadDisplay) { mComposerClient->setReadbackBuffer(getInvalidDisplayId(), bufferHandle, fence); EXPECT_FALSE(status.isOk()); ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadParameter) { Loading @@ -475,7 +481,7 @@ TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadParameter) { mComposerClient->setReadbackBuffer(getPrimaryDisplayId(), &bufferHandle, releaseFence); EXPECT_FALSE(status.isOk()); ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER)); } TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) { Loading @@ -490,7 +496,7 @@ TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) { mComposerClient->getReadbackBufferFence(getPrimaryDisplayId()); EXPECT_FALSE(status.isOk()); EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); EXPECT_EQ(-1, releaseFence.get()); } Loading Loading @@ -1300,7 +1306,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { for (ColorMode mode : mTestColorModes) { auto status = mComposerClient->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC); if (!status.isOk() && if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC && (status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED || status.getServiceSpecificError() == IComposerClient::EX_BAD_PARAMETER)) { SUCCEED() << "ColorMode not supported, skip test"; Loading Loading
automotive/can/1.0/vts/functional/VtsHalCanBusV1_0TargetTest.cpp +43 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <android-base/strings.h> #include <android/hardware/automotive/can/1.0/ICanBus.h> #include <android/hardware/automotive/can/1.0/types.h> #include <can-vts-utils/bus-enumerator.h> #include <can-vts-utils/can-hal-printers.h> #include <gmock/gmock.h> #include <hidl-utils/hidl-utils.h> Loading @@ -27,6 +28,8 @@ namespace android::hardware::automotive::can::V1_0::vts { using hardware::hidl_vec; using InterfaceType = ICanController::InterfaceType; using IfId = ICanController::BusConfig::InterfaceId; struct CanMessageListener : public can::V1_0::ICanMessageListener { virtual Return<void> onReceive(const can::V1_0::CanMessage&) override { return {}; } Loading @@ -41,22 +44,62 @@ class CanBusHalTest : public ::testing::TestWithParam<std::string> { virtual void SetUp() override; virtual void TearDown() override; bool up(InterfaceType iftype, const std::string& srvname, const std::string& ifname); std::tuple<Result, sp<ICloseHandle>> listen(const hidl_vec<CanMessageFilter>& filter, const sp<ICanMessageListener>& listener); sp<ICloseHandle> listenForErrors(const sp<ICanErrorListener>& listener); sp<ICanBus> mCanBus; sp<ICanController> mCanController; }; void CanBusHalTest::SetUp() { mCanBus = ICanBus::getService(GetParam()); ASSERT_TRUE(mCanBus) << "Couldn't open CAN Bus: " << GetParam(); const auto controllers = getAllHalInstanceNames(ICanController::descriptor); ASSERT_GT(controllers.size(), 0u); // just grab the first one mCanController = ICanController::getService(controllers[0]); ASSERT_TRUE(mCanController) << "Couldn't open CAN Controller: " << controllers[0]; // this will throw an error if the bus is already up, but we have to try. up(InterfaceType::VIRTUAL, GetParam(), "vcan0"); } void CanBusHalTest::TearDown() { mCanBus.clear(); } bool CanBusHalTest::up(InterfaceType iftype, const std::string& srvname, const std::string& ifname) { ICanController::BusConfig config = {}; config.name = srvname; // TODO(b/146214370): move interfaceId constructors to a library if (iftype == InterfaceType::SOCKETCAN) { IfId::Socketcan socketcan = {}; socketcan.ifname(ifname); config.interfaceId.socketcan(socketcan); } else if (iftype == InterfaceType::SLCAN) { IfId::Slcan slcan = {}; slcan.ttyname(ifname); config.interfaceId.slcan(slcan); } else if (iftype == InterfaceType::VIRTUAL) { config.interfaceId.virtualif({ifname}); } else { ADD_FAILURE() << "Unexpected iftype: " << toString(iftype); } const auto upresult = mCanController->upInterface(config); if (upresult != ICanController::Result::OK) { // upInterface returns INVALID_STATE if the interface is already up (which is fine). EXPECT_EQ(ICanController::Result::INVALID_STATE, upresult) << ifname << " can't be brought up!"; } return true; } std::tuple<Result, sp<ICloseHandle>> CanBusHalTest::listen( const hidl_vec<CanMessageFilter>& filter, const sp<ICanMessageListener>& listener) { Result halResult; Loading
current.txt +9 −1 Original line number Diff line number Diff line Loading @@ -912,4 +912,12 @@ ca62a2a95d173ed323309e5e00f653ad3cceec82a6e5e4976a249cb5aafe2515 android.hardwar fa76bced6b1b71c40fc706c508a9011284c57f57831cd0cf5f45653ed4ea463e android.hardware.neuralnetworks@1.3::types 700d9de9b47984898789f5706e59285ea6fe83aa5744dccf8491c4b881033ae7 android.hardware.camera.device@3.7::ICameraInjectionSession # There should be no more HIDL HALs - please use AIDL instead. # HALs released in Android T 75d10baa98d661fb455622a1b0c76b53f0b19a906c6fb058daadfed5db77ed3f android.hardware.audio@7.1::IDevice 3a69d224c3351bdc5651c77cd588d5a36bb65a34abd423901a9cf63ac5916f20 android.hardware.audio@7.1::IDevicesFactory 4569e703efb9ab0f4fc02bcca866a77d4352e292fbf715927cba31e6eba51ad6 android.hardware.audio@7.1::IPrimaryDevice ec11690878547a55eb1d6a286f83e227d8328c2cf1d069316b55b4e4084fd9a2 android.hardware.audio@7.1::IStreamOut 786b8619580d7cfae70f02136307e141481714fcc76c6b700e655568f1bf0733 android.hardware.audio@7.1::IStreamOutLatencyModeCallback bfbf383768881eb06f99db76ce79135e37b2b105a90d67bf7468f8df05180bf4 android.hardware.audio@7.1::types # There will be no more HIDL HALs. Use AIDL instead.
graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +11 −5 Original line number Diff line number Diff line Loading @@ -109,6 +109,11 @@ class GraphicsCompositionTestBase : public ::testing::Test { int32_t getDisplayHeight() const { return getPrimaryDisplay().getDisplayHeight(); } void assertServiceSpecificError(const ScopedAStatus& status, int32_t serviceSpecificError) { ASSERT_EQ(status.getExceptionCode(), EX_SERVICE_SPECIFIC); ASSERT_EQ(status.getServiceSpecificError(), serviceSpecificError); } std::pair<bool, ::android::sp<::android::GraphicBuffer>> allocateBuffer(uint32_t usage) { const auto width = static_cast<uint32_t>(getDisplayWidth()); const auto height = static_cast<uint32_t>(getDisplayHeight()); Loading Loading @@ -222,7 +227,8 @@ class GraphicsCompositionTestBase : public ::testing::Test { mDataspace = readBackBufferAttributes.dataspace; return ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); } EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); EXPECT_NO_FATAL_FAILURE( assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); return false; } Loading Loading @@ -458,7 +464,7 @@ TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadDisplay) { mComposerClient->setReadbackBuffer(getInvalidDisplayId(), bufferHandle, fence); EXPECT_FALSE(status.isOk()); ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadParameter) { Loading @@ -475,7 +481,7 @@ TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadParameter) { mComposerClient->setReadbackBuffer(getPrimaryDisplayId(), &bufferHandle, releaseFence); EXPECT_FALSE(status.isOk()); ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER)); } TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) { Loading @@ -490,7 +496,7 @@ TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) { mComposerClient->getReadbackBufferFence(getPrimaryDisplayId()); EXPECT_FALSE(status.isOk()); EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); EXPECT_EQ(-1, releaseFence.get()); } Loading Loading @@ -1300,7 +1306,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { for (ColorMode mode : mTestColorModes) { auto status = mComposerClient->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC); if (!status.isOk() && if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC && (status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED || status.getServiceSpecificError() == IComposerClient::EX_BAD_PARAMETER)) { SUCCEED() << "ColorMode not supported, skip test"; Loading