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

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

Merge "Change g.*Converter to fromXml." am: 9c359a24 am: c3612155 am: 4446d109 am: 51c7b1d3

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1677314

Change-Id: Ia9143851850313ab1cfbdf23ef28ed8995ba7454
parents d67deada 51c7b1d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -417,7 +417,7 @@ void ListCommand::dumpVintf(const NullableOStream<std::ostream>& out) const {
        }
        }
    }
    }
    out << "-->" << std::endl;
    out << "-->" << std::endl;
    out << vintf::gHalManifestConverter(manifest, vintf::SerializeFlags::HALS_ONLY);
    out << vintf::toXml(manifest, vintf::SerializeFlags::HALS_ONLY);
}
}


std::string ListCommand::INIT_VINTF_NOTES{
std::string ListCommand::INIT_VINTF_NOTES{
+6 −8
Original line number Original line Diff line number Diff line
@@ -47,8 +47,6 @@ using ::android::hardware::hidl_vec;
using ::android::hardware::Void;
using ::android::hardware::Void;
using android::vintf::Arch;
using android::vintf::Arch;
using android::vintf::CompatibilityMatrix;
using android::vintf::CompatibilityMatrix;
using android::vintf::gCompatibilityMatrixConverter;
using android::vintf::gHalManifestConverter;
using android::vintf::HalManifest;
using android::vintf::HalManifest;
using android::vintf::Transport;
using android::vintf::Transport;
using android::vintf::VintfObject;
using android::vintf::VintfObject;
@@ -510,7 +508,7 @@ TEST_F(ListTest, DumpVintf) {


    std::string error;
    std::string error;
    vintf::HalManifest m;
    vintf::HalManifest m;
    EXPECT_EQ(true, vintf::gHalManifestConverter(&m, out.str(), &error))
    EXPECT_EQ(true, vintf::fromXml(&m, out.str(), &error))
        << "--init-vintf does not emit valid HAL manifest: " << error;
        << "--init-vintf does not emit valid HAL manifest: " << error;
}
}


@@ -775,10 +773,10 @@ TEST_F(ListTest, Vintf) {
    auto deviceMatrix = std::make_shared<CompatibilityMatrix>();
    auto deviceMatrix = std::make_shared<CompatibilityMatrix>();
    auto frameworkMatrix = std::make_shared<CompatibilityMatrix>();
    auto frameworkMatrix = std::make_shared<CompatibilityMatrix>();


    ASSERT_TRUE(gHalManifestConverter(deviceManifest.get(), deviceManifestXml));
    ASSERT_TRUE(fromXml(deviceManifest.get(), deviceManifestXml));
    ASSERT_TRUE(gHalManifestConverter(frameworkManifest.get(), frameworkManifestXml));
    ASSERT_TRUE(fromXml(frameworkManifest.get(), frameworkManifestXml));
    ASSERT_TRUE(gCompatibilityMatrixConverter(deviceMatrix.get(), deviceMatrixXml));
    ASSERT_TRUE(fromXml(deviceMatrix.get(), deviceMatrixXml));
    ASSERT_TRUE(gCompatibilityMatrixConverter(frameworkMatrix.get(), frameworkMatrixXml));
    ASSERT_TRUE(fromXml(frameworkMatrix.get(), frameworkMatrixXml));


    ON_CALL(*mockList, getDeviceManifest()).WillByDefault(Return(deviceManifest));
    ON_CALL(*mockList, getDeviceManifest()).WillByDefault(Return(deviceManifest));
    ON_CALL(*mockList, getDeviceMatrix()).WillByDefault(Return(deviceMatrix));
    ON_CALL(*mockList, getDeviceMatrix()).WillByDefault(Return(deviceMatrix));
@@ -964,7 +962,7 @@ public:
                "    </hal>\n"
                "    </hal>\n"
                "</manifest>";
                "</manifest>";
        auto manifest = std::make_shared<HalManifest>();
        auto manifest = std::make_shared<HalManifest>();
        EXPECT_TRUE(gHalManifestConverter(manifest.get(), mockManifestXml));
        EXPECT_TRUE(fromXml(manifest.get(), mockManifestXml));
        EXPECT_CALL(*mockList, getDeviceManifest())
        EXPECT_CALL(*mockList, getDeviceManifest())
            .Times(AnyNumber())
            .Times(AnyNumber())
            .WillRepeatedly(Return(manifest));
            .WillRepeatedly(Return(manifest));