mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "Audio VTS: Look for Audio policy config in all supported folders" into oc-dev am: 4f3c28ad7a
am: b06f544d22
Change-Id: Ia2dda3abb97742f7fcb6a98568c2e095944c38a6
This commit is contained in:
@@ -14,9 +14,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "utility/ValidateXml.h"
|
||||
|
||||
TEST(CheckConfig, audioPolicyConfigurationValidation) {
|
||||
ASSERT_VALID_XML("/vendor/etc/audio_policy_configuration.xml",
|
||||
"/data/local/tmp/audio_policy_configuration.xsd");
|
||||
const char* configName = "audio_policy_configuration.xml";
|
||||
const char* possibleConfigLocations[] = {"/odm/etc", "/vendor/etc", "/system/etc"};
|
||||
const char* configSchemaPath = "/data/local/tmp/audio_policy_configuration.xsd";
|
||||
|
||||
bool found = false;
|
||||
for (std::string folder : possibleConfigLocations) {
|
||||
const auto configPath = folder + '/' + configName;
|
||||
if (access(configPath.c_str(), R_OK) == 0) {
|
||||
ASSERT_FALSE(found) << "Multiple " << configName << " found in "
|
||||
<< ::testing::PrintToString(possibleConfigLocations);
|
||||
found = true;
|
||||
ASSERT_VALID_XML(configPath.c_str(), configSchemaPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user