diff options
Diffstat (limited to 'test/LibVintfTest.cpp')
-rw-r--r-- | test/LibVintfTest.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/test/LibVintfTest.cpp b/test/LibVintfTest.cpp index e7a609a..ef19a4c 100644 --- a/test/LibVintfTest.cpp +++ b/test/LibVintfTest.cpp | |||
@@ -44,7 +44,7 @@ static bool In(const std::string& sub, const std::string& str) { | |||
44 | } | 44 | } |
45 | #define EXPECT_IN(sub, str) EXPECT_TRUE(In((sub), (str))) << (str); | 45 | #define EXPECT_IN(sub, str) EXPECT_TRUE(In((sub), (str))) << (str); |
46 | 46 | ||
47 | #ifdef LIBVINTF_HOST | 47 | #ifndef LIBVINTF_TARGET |
48 | #define EXPECT_CONTAINS(str, sub) EXPECT_IN(sub, str); | 48 | #define EXPECT_CONTAINS(str, sub) EXPECT_IN(sub, str); |
49 | #endif | 49 | #endif |
50 | 50 | ||
@@ -1598,7 +1598,7 @@ TEST_F(LibVintfTest, NetutilsWrapperMatrix) { | |||
1598 | << gCompatibilityMatrixConverter.lastError(); | 1598 | << gCompatibilityMatrixConverter.lastError(); |
1599 | 1599 | ||
1600 | // only host libvintf hardcodes netutils-wrapper version requirements | 1600 | // only host libvintf hardcodes netutils-wrapper version requirements |
1601 | #ifdef LIBVINTF_HOST | 1601 | #ifndef LIBVINTF_TARGET |
1602 | 1602 | ||
1603 | matrixXml = | 1603 | matrixXml = |
1604 | "<compatibility-matrix version=\"1.0\" type=\"device\">" | 1604 | "<compatibility-matrix version=\"1.0\" type=\"device\">" |
@@ -1640,7 +1640,7 @@ TEST_F(LibVintfTest, NetutilsWrapperMatrix) { | |||
1640 | "netutils-wrapper HAL must specify exactly one version x.0, but multiple <version> element " | 1640 | "netutils-wrapper HAL must specify exactly one version x.0, but multiple <version> element " |
1641 | "is specified."); | 1641 | "is specified."); |
1642 | 1642 | ||
1643 | #endif // LIBVINTF_HOST | 1643 | #endif // LIBVINTF_TARGET |
1644 | } | 1644 | } |
1645 | 1645 | ||
1646 | TEST_F(LibVintfTest, NetutilsWrapperManifest) { | 1646 | TEST_F(LibVintfTest, NetutilsWrapperManifest) { |
@@ -1658,7 +1658,7 @@ TEST_F(LibVintfTest, NetutilsWrapperManifest) { | |||
1658 | EXPECT_TRUE(gHalManifestConverter(&manifest, manifestXml)) << gHalManifestConverter.lastError(); | 1658 | EXPECT_TRUE(gHalManifestConverter(&manifest, manifestXml)) << gHalManifestConverter.lastError(); |
1659 | 1659 | ||
1660 | // only host libvintf hardcodes netutils-wrapper version requirements | 1660 | // only host libvintf hardcodes netutils-wrapper version requirements |
1661 | #ifdef LIBVINTF_HOST | 1661 | #ifndef LIBVINTF_TARGET |
1662 | 1662 | ||
1663 | manifestXml = | 1663 | manifestXml = |
1664 | "<manifest version=\"1.0\" type=\"framework\">" | 1664 | "<manifest version=\"1.0\" type=\"framework\">" |
@@ -1687,7 +1687,7 @@ TEST_F(LibVintfTest, NetutilsWrapperManifest) { | |||
1687 | "netutils-wrapper HAL must specify exactly one version x.0, but multiple <version> element " | 1687 | "netutils-wrapper HAL must specify exactly one version x.0, but multiple <version> element " |
1688 | "is specified."); | 1688 | "is specified."); |
1689 | 1689 | ||
1690 | #endif // LIBVINTF_HOST | 1690 | #endif // LIBVINTF_TARGET |
1691 | } | 1691 | } |
1692 | 1692 | ||
1693 | TEST_F(LibVintfTest, KernelConfigConditionTest) { | 1693 | TEST_F(LibVintfTest, KernelConfigConditionTest) { |
@@ -2410,6 +2410,23 @@ TEST_F(LibVintfTest, MissingVendorNdkInMatrix) { | |||
2410 | } | 2410 | } |
2411 | } | 2411 | } |
2412 | 2412 | ||
2413 | TEST_F(LibVintfTest, DuplicatedVendorNdkVersion) { | ||
2414 | std::string error; | ||
2415 | HalManifest manifest; | ||
2416 | std::string xml = | ||
2417 | "<manifest version=\"1.0\" type=\"framework\">\n" | ||
2418 | " <vendor-ndk>\n" | ||
2419 | " <version>27</version>\n" | ||
2420 | " </vendor-ndk>\n" | ||
2421 | " <vendor-ndk>\n" | ||
2422 | " <version>27</version>\n" | ||
2423 | " </vendor-ndk>\n" | ||
2424 | "</manifest>\n"; | ||
2425 | |||
2426 | EXPECT_FALSE(gHalManifestConverter(&manifest, xml)); | ||
2427 | EXPECT_EQ("Duplicated manifest.vendor-ndk.version 27", gHalManifestConverter.lastError()); | ||
2428 | } | ||
2429 | |||
2413 | TEST_F(LibVintfTest, ManifestHalOverride) { | 2430 | TEST_F(LibVintfTest, ManifestHalOverride) { |
2414 | HalManifest manifest; | 2431 | HalManifest manifest; |
2415 | std::string xml = | 2432 | std::string xml = |