1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <unistd.h>
18 #include <string>
19 
20 #include <android-base/properties.h>
21 #include "utility/ValidateXml.h"
22 
TEST(CheckConfig,compatibilityMatrixValidation)23 TEST(CheckConfig, compatibilityMatrixValidation) {
24     if (android::base::GetIntProperty("ro.product.first_api_level", 0) <= 28) {
25         GTEST_SKIP();
26     }
27 
28     RecordProperty("description",
29                    "Verify that the compatibility matrix file "
30                    "is valid according to the schema");
31 
32     std::vector<const char*> locations = {"/vendor/etc/vintf"};
33     EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS("compatibility_matrix.xml", locations,
34                                             "/data/local/tmp/compatibility_matrix.xsd");
35 }
36