summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Android.bp6
-rw-r--r--test/LibVintfTest.cpp27
2 files changed, 25 insertions, 8 deletions
diff --git a/test/Android.bp b/test/Android.bp
index d2121c6..6777ca3 100644
--- a/test/Android.bp
+++ b/test/Android.bp
@@ -39,9 +39,9 @@ cc_test {
39 "-Wno-deprecated-declarations", 39 "-Wno-deprecated-declarations",
40 ], 40 ],
41 target: { 41 target: {
42 host: { 42 android: {
43 cflags: ["-DLIBVINTF_HOST"], 43 cflags: ["-DLIBVINTF_TARGET"],
44 } 44 },
45 } 45 }
46} 46}
47 47
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
1646TEST_F(LibVintfTest, NetutilsWrapperManifest) { 1646TEST_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
1693TEST_F(LibVintfTest, KernelConfigConditionTest) { 1693TEST_F(LibVintfTest, KernelConfigConditionTest) {
@@ -2410,6 +2410,23 @@ TEST_F(LibVintfTest, MissingVendorNdkInMatrix) {
2410 } 2410 }
2411} 2411}
2412 2412
2413TEST_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
2413TEST_F(LibVintfTest, ManifestHalOverride) { 2430TEST_F(LibVintfTest, ManifestHalOverride) {
2414 HalManifest manifest; 2431 HalManifest manifest;
2415 std::string xml = 2432 std::string xml =