summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYifan Hong2017-05-22 16:35:19 -0500
committerYifan Hong2017-05-22 17:31:08 -0500
commit79dcc1fcecf4b9b6ff775914f19e6bd7de1d331c (patch)
treedc93781ef94215df172cddc100d74cdc3778a1d2 /parse_xml.cpp
parent08e984cdca85894b0f223314a5ae7ecbdfaf23ed (diff)
downloadplatform-system-libvintf-79dcc1fcecf4b9b6ff775914f19e6bd7de1d331c.tar.gz
platform-system-libvintf-79dcc1fcecf4b9b6ff775914f19e6bd7de1d331c.tar.xz
platform-system-libvintf-79dcc1fcecf4b9b6ff775914f19e6bd7de1d331c.zip
Do not allow duplicated major version across <hal> in manifests
<hal> entries has to be grouped by versions. Otherwise, if <transport> is different in two <hal> entries with the same <name> and <version>, getTransport always return the first match. As a side effect, fixes an incorrect behavior in HalManifest::isCompatible that test for <instance> tags across two <hal>'s with the same name and version (because it shouldn't occur at all). This incorrect behavior is hidden under an EXPECT_FALSE in libvintf_test. Now that this is never allowed, the test is changed to EXPECT_TRUE. Test: libvintf_test Change-Id: I10d4619f3828bf695485938c315c73a924ba6340 Merged-In: I10d4619f3828bf695485938c315c73a924ba6340 Fixes: 38502835
Diffstat (limited to 'parse_xml.cpp')
-rw-r--r--parse_xml.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse_xml.cpp b/parse_xml.cpp
index f2f3096..0ac87cb 100644
--- a/parse_xml.cpp
+++ b/parse_xml.cpp
@@ -651,8 +651,9 @@ struct HalManifestConverter : public XmlNodeConverter<HalManifest> {
651 } 651 }
652 } 652 }
653 for (auto &&hal : hals) { 653 for (auto &&hal : hals) {
654 std::string description{hal.name};
654 if (!object->add(std::move(hal))) { 655 if (!object->add(std::move(hal))) {
655 this->mLastError = "Duplicated manifest.hal entry"; 656 this->mLastError = "Duplicated manifest.hal entry " + description;
656 return false; 657 return false;
657 } 658 }
658 } 659 }