Lines Matching refs:cm

61     bool add(CompatibilityMatrix &cm, MatrixHal &&hal) {  in add()
62 return cm.add(std::move(hal)); in add()
64 bool add(CompatibilityMatrix &cm, MatrixKernel &&kernel) { in add()
66 bool success = cm.addKernel(std::move(kernel), &error); in add()
73 void addXmlFile(CompatibilityMatrix& cm, std::string name, VersionRange range) { in addXmlFile()
79 cm.addXmlFile(std::move(f)); in addXmlFile()
81 void set(CompatibilityMatrix &cm, Sepolicy &&sepolicy) { in set()
82 cm.framework.mSepolicy = sepolicy; in set()
84 void set(CompatibilityMatrix &cm, SchemaType type) { in set()
85 cm.mType = type; in set()
87 void set(CompatibilityMatrix &cm, VndkVersionRange &&range, std::set<std::string> &&libs) { in set()
88 cm.device.mVndk.mVersionRange = range; in set()
89 cm.device.mVndk.mLibraries = libs; in set()
95 void setAvb(CompatibilityMatrix &cm, Version &&avbVersion) { in setAvb()
96 cm.framework.mAvbMetaVersion = avbVersion; in setAvb()
98 Version getAvb(CompatibilityMatrix &cm) { in getAvb()
99 return cm.framework.mAvbMetaVersion; in getAvb()
104 MatrixHal *getAnyHal(CompatibilityMatrix &cm, const std::string &name) { in getAnyHal()
105 return cm.getAnyHal(name); in getAnyHal()
113 std::vector<const MatrixHal*> getHals(const CompatibilityMatrix& cm, const std::string& name) { in getHals()
114 return cm.getHals(name); in getHals()
119 std::vector<MatrixKernel>& getKernels(CompatibilityMatrix& cm) { return cm.framework.mKernels; } in getKernels()
127 std::set<std::string> checkUnusedHals(const HalManifest& m, const CompatibilityMatrix& cm) { in checkUnusedHals()
128 return m.checkUnusedHals(cm, {}); in checkUnusedHals()
593 CompatibilityMatrix cm; in TEST_F() local
594 EXPECT_TRUE(add(cm, MatrixHal{HalFormat::NATIVE, "android.hardware.camera", in TEST_F()
597 EXPECT_TRUE(add(cm, MatrixHal{HalFormat::NATIVE, "android.hardware.nfc", in TEST_F()
600 EXPECT_TRUE(add(cm, MatrixKernel{KernelVersion(3, 18, 22), in TEST_F()
602 EXPECT_TRUE(add(cm, MatrixKernel{KernelVersion(4, 4, 1), in TEST_F()
604 set(cm, Sepolicy(30, {{25, 0}, {26, 0, 3}})); in TEST_F()
605 setAvb(cm, Version{2, 1}); in TEST_F()
606 std::string xml = gCompatibilityMatrixConverter(cm); in TEST_F()
658 EXPECT_EQ(cm, cm2); in TEST_F()
662 CompatibilityMatrix cm; in TEST_F() local
663 EXPECT_TRUE(add(cm, MatrixHal{HalFormat::NATIVE, "android.hidl.manager", in TEST_F()
666 set(cm, SchemaType::DEVICE); in TEST_F()
667 set(cm, VndkVersionRange{25,0,1,5}, {"libjpeg.so", "libbase.so"}); in TEST_F()
668 std::string xml = gCompatibilityMatrixConverter(cm); in TEST_F()
687 EXPECT_EQ(cm, cm2); in TEST_F()
770 CompatibilityMatrix cm; in TEST_F() local
771 EXPECT_TRUE(add(cm, MatrixHal{HalFormat::NATIVE, in TEST_F()
776 EXPECT_TRUE(add(cm, MatrixHal{HalFormat::NATIVE, in TEST_F()
794 auto cameraHals = getHals(cm, "android.hardware.camera"); in TEST_F()
797 auto nfcHals = getHals(cm, "android.hardware.nfc"); in TEST_F()
815 CompatibilityMatrix cm; in TEST_F() local
816 add(cm, std::move(kernel)); in TEST_F()
817 set(cm, {30, {{25, 0}}}); in TEST_F()
818 setAvb(cm, {2, 1}); in TEST_F()
819 return cm; in TEST_F()
826 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
827 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Kernel version shouldn't match"; in TEST_F()
832 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
833 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Kernel version shouldn't match"; in TEST_F()
838 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
839 EXPECT_TRUE(ki.checkCompatibility(cm, &error)) << error; in TEST_F()
844 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
845 set(cm, Sepolicy{22, {{25, 0}}}); in TEST_F()
846 EXPECT_TRUE(ki.checkCompatibility(cm, &error)) << error; in TEST_F()
847 set(cm, Sepolicy{40, {{25, 0}}}); in TEST_F()
848 EXPECT_FALSE(ki.checkCompatibility(cm, &error)) in TEST_F()
857 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
858 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Value shouldn't match for tristate"; in TEST_F()
865 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
866 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Type shouldn't match"; in TEST_F()
873 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
874 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Value shouldn't match for string"; in TEST_F()
881 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
882 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Type shouldn't match"; in TEST_F()
889 CompatibilityMatrix cm = testMatrix(std::move(kernel)); in TEST_F() local
890 EXPECT_FALSE(ki.checkCompatibility(cm)) << "Value shouldn't match for integer"; in TEST_F()
894 CompatibilityMatrix cm = testMatrix(MatrixKernel(KernelVersion{3, 18, 31}, {})); in TEST_F() local
897 EXPECT_FALSE(badAvb.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS)); in TEST_F()
902 EXPECT_FALSE(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()
910 EXPECT_TRUE(badAvb.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS)); in TEST_F()
923 CompatibilityMatrix cm; in TEST_F() local
924 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)); in TEST_F()
925 EXPECT_EQ(getAvb(cm), Version(0, 0)); in TEST_F()
940 CompatibilityMatrix cm; in TEST_F() local
941 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)); in TEST_F()
944 EXPECT_FALSE(ki.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS)); in TEST_F()
946 EXPECT_TRUE(ki.checkCompatibility(cm, &error, CheckFlags::DISABLE_AVB_CHECK)) << error; in TEST_F()
1339 CompatibilityMatrix cm; in TEST_F() local
1340 addXmlFile(cm, "media_profile", {1, 0}); in TEST_F()
1341 std::string xml = gCompatibilityMatrixConverter(cm, SerializeFlags::XMLFILES_ONLY); in TEST_F()
1351 EXPECT_EQ(cm, cm2); in TEST_F()
1362 CompatibilityMatrix cm; in TEST_F() local
1363 EXPECT_FALSE(gCompatibilityMatrixConverter(&cm, xml)); in TEST_F()
1701 CompatibilityMatrix cm; in TEST_F() local
1702 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1704 const auto& kernels = getKernels(cm); in TEST_F()
1714 EXPECT_EQ(xml, gCompatibilityMatrixConverter(cm)); in TEST_F()
1731 CompatibilityMatrix cm; in TEST_F() local
1732 EXPECT_FALSE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1744 CompatibilityMatrix cm; in TEST_F() local
1767 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1769 EXPECT_TRUE(runtime.checkCompatibility(cm, &error)) << error; in TEST_F()
1792 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1794 EXPECT_FALSE(runtime.checkCompatibility(cm, &error)) in TEST_F()
1818 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1820 EXPECT_TRUE(runtime.checkCompatibility(cm, &error)) << error; in TEST_F()
1846 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1848 EXPECT_TRUE(runtime.checkCompatibility(cm, &error)); in TEST_F()
1875 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1877 EXPECT_FALSE(runtime.checkCompatibility(cm, &error)) in TEST_F()
1905 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1907 EXPECT_TRUE(runtime.checkCompatibility(cm, &error)) << error; in TEST_F()
1947 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1949 EXPECT_TRUE(runtime.checkCompatibility(cm, &error)) << error; in TEST_F()
1989 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
1991 EXPECT_FALSE(runtime.checkCompatibility(cm, &error)) << "all fragments should be used."; in TEST_F()
2031 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2033 EXPECT_FALSE(runtime.checkCompatibility(cm, &error)) << "all fragments should be used"; in TEST_F()
2063 CompatibilityMatrix cm; in TEST_F() local
2067 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2069 EXPECT_EQ(Level::UNSPECIFIED, cm.level()); in TEST_F()
2072 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2074 EXPECT_EQ(Level::LEGACY, cm.level()); in TEST_F()
2077 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2079 EXPECT_EQ(1u, cm.level()); in TEST_F()
2538 CompatibilityMatrix cm; in TEST_F() local
2550 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2552 EXPECT_EQ(xml, gCompatibilityMatrixConverter(cm)); in TEST_F()
2554 EXPECT_EQ("P", cm.getVendorNdkVersion()); in TEST_F()
2575 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
2591 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()
2607 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()
2614 CompatibilityMatrix cm; in TEST_F() local
2619 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2627 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
2641 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
2910 CompatibilityMatrix cm; in TEST_F() local
2916 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2922 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
2926 CompatibilityMatrix cm; in TEST_F() local
2937 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml)) in TEST_F()
2939 EXPECT_EQ(xml, gCompatibilityMatrixConverter(cm, SerializeFlags::SSDK_ONLY)); in TEST_F()
2953 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
2967 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)); in TEST_F()
2979 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()
3031 CompatibilityMatrix cm; in TEST_F() local
3049 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml, &error)) << error; in TEST_F()
3050 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()
3063 CompatibilityMatrix cm; in TEST_F() local
3076 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml, &error)) << error; in TEST_F()
3077 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()
3087 CompatibilityMatrix cm; in TEST_F() local
3099 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml, &error)) << error; in TEST_F()
3100 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()
3147 CompatibilityMatrix cm; in TEST_F() local
3167 EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml, &error)) << error; in TEST_F()
3186 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
3204 EXPECT_TRUE(manifest.checkCompatibility(cm, &error)) << error; in TEST_F()
3223 EXPECT_FALSE(manifest.checkCompatibility(cm, &error)); in TEST_F()