summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTreehugger Robot2018-01-22 21:14:55 -0600
committerGerrit Code Review2018-01-22 21:14:55 -0600
commitcbc3823cc32aa07dd06b8320c24c92664929a788 (patch)
tree7ac190957493e7dae76be5548c5bd8f8031bac7e /test
parent8b8492bcc42b79d1a95b02808dfbb654e2e31690 (diff)
parentdd135ec0606dad9fe2a546561989ae894fb502d6 (diff)
downloadplatform-system-libvintf-cbc3823cc32aa07dd06b8320c24c92664929a788.tar.gz
platform-system-libvintf-cbc3823cc32aa07dd06b8320c24c92664929a788.tar.xz
platform-system-libvintf-cbc3823cc32aa07dd06b8320c24c92664929a788.zip
Merge "Test to add new tags to manifests."
Diffstat (limited to 'test')
-rw-r--r--test/LibVintfTest.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/LibVintfTest.cpp b/test/LibVintfTest.cpp
index e934360..d705243 100644
--- a/test/LibVintfTest.cpp
+++ b/test/LibVintfTest.cpp
@@ -232,6 +232,33 @@ TEST_F(LibVintfTest, GetTransport) {
232 {2, 0}, "ICamera", "default")); 232 {2, 0}, "ICamera", "default"));
233} 233}
234 234
235TEST_F(LibVintfTest, FutureManifestCompatible) {
236 HalManifest expectedManifest;
237 expectedManifest.add(ManifestHal{.format = HalFormat::HIDL,
238 .name = "android.hardware.foo",
239 .versions = {Version(1, 0)},
240 .transportArch = {Transport::HWBINDER, Arch::ARCH_EMPTY},
241 .interfaces = {
242 {"IFoo", {"IFoo", {"default"}}},
243 }});
244 std::string manifestXml =
245 "<manifest version=\"1.0\" type=\"device\" might_add=\"true\">\n"
246 " <hal format=\"hidl\" attribuet_might_be_added=\"value\">\n"
247 " <name>android.hardware.foo</name>\n"
248 " <transport>hwbinder</transport>\n"
249 " <version>1.0</version>\n"
250 " <interface>\n"
251 " <name>IFoo</name>\n"
252 " <instance>default</instance>\n"
253 " </interface>\n"
254 " </hal>\n"
255 " <tag_might_be_added/>\n"
256 "</manifest>\n";
257 HalManifest manifest;
258 EXPECT_TRUE(gHalManifestConverter(&manifest, manifestXml));
259 EXPECT_EQ(expectedManifest, manifest);
260}
261
235TEST_F(LibVintfTest, HalManifestConverter) { 262TEST_F(LibVintfTest, HalManifestConverter) {
236 HalManifest vm = testDeviceManifest(); 263 HalManifest vm = testDeviceManifest();
237 std::string xml = gHalManifestConverter(vm); 264 std::string xml = gHalManifestConverter(vm);