Lines Matching refs:cm
59 bool add(CompatibilityMatrix &cm, MatrixHal &&hal) { in add()
60 return cm.add(std::move(hal)); in add()
62 bool add(CompatibilityMatrix &cm, MatrixKernel &&kernel) { in add()
64 bool success = cm.addKernel(std::move(kernel), &error); in add()
71 void addXmlFile(CompatibilityMatrix& cm, std::string name, VersionRange range) { in addXmlFile()
77 cm.addXmlFile(std::move(f)); in addXmlFile()
79 void set(CompatibilityMatrix &cm, Sepolicy &&sepolicy) { in set()
80 cm.framework.mSepolicy = sepolicy; in set()
82 void set(CompatibilityMatrix &cm, SchemaType type) { in set()
83 cm.mType = type; in set()
85 void set(CompatibilityMatrix &cm, VndkVersionRange &&range, std::set<std::string> &&libs) { in set()
86 cm.device.mVndk.mVersionRange = range; in set()
87 cm.device.mVndk.mLibraries = libs; in set()
93 void setAvb(CompatibilityMatrix &cm, Version &&avbVersion) { in setAvb()
94 cm.framework.mAvbMetaVersion = avbVersion; in setAvb()
96 Version getAvb(CompatibilityMatrix &cm) { in getAvb()
97 return cm.framework.mAvbMetaVersion; in getAvb()
102 MatrixHal *getAnyHal(CompatibilityMatrix &cm, const std::string &name) { in getAnyHal()
103 return cm.getAnyHal(name); in getAnyHal()
111 std::vector<const MatrixHal*> getHals(const CompatibilityMatrix& cm, const std::string& name) { in getHals()
112 return cm.getHals(name); in getHals()
117 std::vector<MatrixKernel>& getKernels(CompatibilityMatrix& cm) { return cm.framework.mKernels; } in getKernels()
125 std::set<std::string> checkUnusedHals(const HalManifest& m, const CompatibilityMatrix& cm) { in checkUnusedHals()
126 return m.checkUnusedHals(cm); in checkUnusedHals()
589 CompatibilityMatrix cm; in TEST_F() local
590 EXPECT_TRUE(add(cm, MatrixHal{HalFormat::NATIVE, "android.hardware.camera", in TEST_F()
593 EXPECT_TRUE(add(cm, MatrixHal{HalFormat::NATIVE, "android.hardware.nfc", in TEST_F()
596 EXPECT_TRUE(add(cm, MatrixKernel{KernelVersion(3, 18, 22), in TEST_F()
598 EXPECT_TRUE(add(cm, MatrixKernel{KernelVersion(4, 4, 1), in TEST_F()
600 set(cm, Sepolicy(30, {{25, 0}, {26, 0, 3}})); in TEST_F()
601 setAvb(cm, Version{2, 1}); in TEST_F()
602 std::string xml = gCompatibilityMatrixConverter(cm); in TEST_F()
654 EXPECT_EQ(cm, cm2); in TEST_F()
658 CompatibilityMatrix cm; in TEST_F() local
659 EXPECT_TRUE(add(cm, MatrixHal{HalFormat::NATIVE, "android.hidl.manager", in TEST_F()
662 set(cm, SchemaType::DEVICE); in TEST_F()
663 set(cm, VndkVersionRange{25,0,1,5}, {"libjpeg.so", "libbase.so"}); in TEST_F()
664 std::string xml = gCompatibilityMatrixConverter(cm); in TEST_F()
683 EXPECT_EQ(cm, cm2); in TEST_F()
766 CompatibilityMatrix cm; in TEST_F() local
767 EXPECT_TRUE(add(cm, MatrixHal{HalFormat::NATIVE, in TEST_F()
772 EXPECT_TRUE(add(cm, MatrixHal{HalFormat::NATIVE, in TEST_F()
790 auto cameraHals = getHals(cm, "android.hardware.camera"); in TEST_F()
793 auto nfcHals = getHals(cm, "android.hardware.nfc"); in TEST_F()
811 CompatibilityMatrix cm; in TEST_F() local
812 add(cm, std::move(kernel)); in TEST_F()
813 set(cm, {30, {{25, 0}}}); in TEST_F()
814 setAvb(cm, {2, 1}); in TEST_F()
815 return cm; in TEST_F()
822 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
823 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Kernel version shouldn't match"; in TEST_F()
828 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
829 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Kernel version shouldn't match"; in TEST_F()
834 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
835 EXPECT_TRUE(ki.checkCompatibility(cm, &error)) << error; in TEST_F()
840 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
841 set(cm, Sepolicy{22, {{25, 0}}}); in TEST_F()
842 EXPECT_TRUE(ki.checkCompatibility(cm, &error)) << error; in TEST_F()
843 set(cm, Sepolicy{40, {{25, 0}}}); in TEST_F()
844 EXPECT_FALSE(ki.checkCompatibility(cm, &error)) in TEST_F()
853 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
854 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Value shouldn't match for tristate"; in TEST_F()
861 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
862 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Type shouldn't match"; in TEST_F()
869 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
870 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Value shouldn't match for string"; in TEST_F()
877 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
878 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Type shouldn't match"; in TEST_F()
885 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
886 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Value shouldn't match for integer"; in TEST_F()
890 CompatibilityMatrix cm = testMatrix(MatrixKernel(KernelVersion{3, 18, 31}, {})); in TEST_F() local
893 EXPECT_FALSE(badAvb.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS)); in TEST_F()
898 EXPECT_FALSE(badAvb.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS)); in TEST_F()
902 EXPECT_TRUE(badAvb.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS)); in TEST_F()
906 EXPECT_TRUE(badAvb.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS)); in TEST_F()
919 CompatibilityMatrix cm; in TEST_F() local
920 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)); in TEST_F()
921 EXPECT_EQ(getAvb(cm), Version(0, 0)); in TEST_F()
936 CompatibilityMatrix cm; in TEST_F() local
937 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)); in TEST_F()
940 EXPECT_FALSE(ki.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS)); in TEST_F()
942 EXPECT_TRUE(ki.checkCompatibility(cm, &error, CheckFlags::DISABLE_AVB_CHECK)) << error; in TEST_F()
1335 CompatibilityMatrix cm; in TEST_F() local
1336 addXmlFile(cm, "media_profile", {1, 0}); in TEST_F()
1337 std::string xml = gCompatibilityMatrixConverter(cm, SerializeFlags::XMLFILES_ONLY); in TEST_F()
1347 EXPECT_EQ(cm, cm2); in TEST_F()
1358 CompatibilityMatrix cm; in TEST_F() local
1359 EXPECT_FALSE(gCompatibilityMatrixConverter(&cm, xml)); in TEST_F()
1697 CompatibilityMatrix cm; in TEST_F() local
1698 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1700 const auto& kernels = getKernels(cm); in TEST_F()
1710 EXPECT_EQ(xml, gCompatibilityMatrixConverter(cm)); in TEST_F()
1727 CompatibilityMatrix cm; in TEST_F() local
1728 EXPECT_FALSE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1740 CompatibilityMatrix cm; in TEST_F() local
1763 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1765 EXPECT_TRUE(runtime.checkCompatibility(cm, &error)) << error; in TEST_F()
1788 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1790 EXPECT_FALSE(runtime.checkCompatibility(cm, &error)) in TEST_F()
1814 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1816 EXPECT_TRUE(runtime.checkCompatibility(cm, &error)) << error; in TEST_F()
1842 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1844 EXPECT_TRUE(runtime.checkCompatibility(cm, &error)); in TEST_F()
1871 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1873 EXPECT_FALSE(runtime.checkCompatibility(cm, &error)) in TEST_F()
1901 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1903 EXPECT_TRUE(runtime.checkCompatibility(cm, &error)) << error; in TEST_F()
1943 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1945 EXPECT_TRUE(runtime.checkCompatibility(cm, &error)) << error; in TEST_F()
1985 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1987 EXPECT_FALSE(runtime.checkCompatibility(cm, &error)) << "all fragments should be used."; in TEST_F()
2027 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2029 EXPECT_FALSE(runtime.checkCompatibility(cm, &error)) << "all fragments should be used"; in TEST_F()
2059 CompatibilityMatrix cm; in TEST_F() local
2063 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2065 EXPECT_EQ(Level::UNSPECIFIED, cm.level()); in TEST_F()
2068 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2070 EXPECT_EQ(Level::LEGACY, cm.level()); in TEST_F()
2073 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2075 EXPECT_EQ(1u, cm.level()); in TEST_F()
2534 CompatibilityMatrix cm; in TEST_F() local
2546 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2548 EXPECT_EQ(xml, gCompatibilityMatrixConverter(cm)); in TEST_F()
2550 EXPECT_EQ("P", cm.getVendorNdkVersion()); in TEST_F()
2571 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
2587 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()
2603 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()
2610 CompatibilityMatrix cm; in TEST_F() local
2615 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2623 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
2637 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
2906 CompatibilityMatrix cm; in TEST_F() local
2912 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2918 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
2922 CompatibilityMatrix cm; in TEST_F() local
2933 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2935 EXPECT_EQ(xml, gCompatibilityMatrixConverter(cm, SerializeFlags::SSDK_ONLY)); in TEST_F()
2949 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
2963 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)); in TEST_F()
2975 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()
3027 CompatibilityMatrix cm; in TEST_F() local
3045 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml, &error)) << error; in TEST_F()
3046 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()
3059 CompatibilityMatrix cm; in TEST_F() local
3072 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml, &error)) << error; in TEST_F()
3073 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()
3083 CompatibilityMatrix cm; in TEST_F() local
3095 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml, &error)) << error; in TEST_F()
3096 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()
3143 CompatibilityMatrix cm; in TEST_F() local
3163 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml, &error)) << error; in TEST_F()
3182 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
3200 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
3219 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()