TEST(linkerconfig_configuration_fulltest, baseconfig_test) {
MockGenericVariables();
- Context ctx;
+ Context ctx = GenerateContextWithVndk();
auto base_config = CreateBaseConfiguration(ctx);
ConfigWriter config_writer;
baseconfig_vndk_using_core_variant_test) {
MockGenericVariables();
MockVndkUsingCoreVariant();
- Context ctx;
+ Context ctx = GenerateContextWithVndk();
auto base_config = CreateBaseConfiguration(ctx);
ConfigWriter config_writer;
TEST(linkerconfig_configuration_fulltest, baseconfig_vndk_27_test) {
MockGenericVariables();
MockVndkVersion("27");
- Context ctx;
+ Context ctx = GenerateContextWithVndk();
auto base_config = CreateBaseConfiguration(ctx);
ConfigWriter config_writer;
TEST(linkerconfig_configuration_fulltest, vndklite_test) {
MockGenericVariables();
MockVnkdLite();
- Context ctx;
+ Context ctx = GenerateContextWithVndk();
auto vndklite_config = CreateBaseConfiguration(ctx);
ConfigWriter config_writer;
static std::regex dir_regex(kDirRegex);
std::smatch match;
- ASSERT_TRUE(std::regex_match(line, match, dir_regex));
- ASSERT_EQ(3u, match.size());
+ ASSERT_TRUE(std::regex_match(line, match, dir_regex)) << line;
+ ASSERT_EQ(3u, match.size()) << line;
std::string section_name = match[1];
std::string dir_path = match[2];
std::stringstream namespaces(match[1]);
for (std::string namespace_name;
std::getline(namespaces, namespace_name, ',');) {
- EXPECT_FALSE(MapContainsKey(current_section.namespaces, namespace_name));
+ EXPECT_FALSE(MapContainsKey(current_section.namespaces, namespace_name))
+ << "Namespace " << namespace_name << " already exists";
Namespace new_namespace;
new_namespace.name = namespace_name;
current_section.namespaces[namespace_name] = new_namespace;
target_path = ¤t_namespace.asan_permitted_path;
}
- ASSERT_NE(nullptr, target_path);
+ ASSERT_NE(nullptr, target_path) << line;
EXPECT_EQ(is_additional, target_path->size() != 0)
<< "Path should be marked as = if and only if it is mentioned first : "
<< line;
const std::string& line) {
// namespace.from.link.to.shared_libs = a.so
// namespace.from.link.to.allow_all_shared_libs = true
- ASSERT_EQ(3u, property_descs.size());
+ ASSERT_EQ(3u, property_descs.size()) << line;
ASSERT_TRUE(property_descs[2] == "shared_libs" ||
- property_descs[2] == "allow_all_shared_libs");
+ property_descs[2] == "allow_all_shared_libs")
+ << line;
std::string namespace_to = property_descs[1];
ASSERT_TRUE(MapContainsKey(current_section.namespaces, namespace_to))
current_namespace.links[namespace_to].shared_libs.push_back(value);
} else {
- EXPECT_EQ("true", value);
+ EXPECT_EQ("true", value) << line;
current_namespace.links[namespace_to].allow_all_shared = true;
}
}
if (property_descs[0].compare("isolated") == 0) {
// namespace.test.isolated = true
- EXPECT_EQ(1u, property_descs.size());
- EXPECT_TRUE(value == "true" || value == "false");
+ EXPECT_EQ(1u, property_descs.size()) << line;
+ EXPECT_TRUE(value == "true" || value == "false") << line;
current_namespace.is_isolated = value == "true";
} else if (property_descs[0].compare("visible") == 0) {
// namespace.test.visible = true
- EXPECT_EQ(1u, property_descs.size());
- EXPECT_TRUE(value == "true" || value == "false");
+ EXPECT_EQ(1u, property_descs.size()) << line;
+ EXPECT_TRUE(value == "true" || value == "false") << line;
current_namespace.is_visible = value == "true";
} else if (property_descs[property_descs.size() - 1] == "paths") {
// namespace.test.search.path += /system/lib
current_section,
line);
} else if (property_descs[0] == "whitelisted") {
- EXPECT_EQ(1u, property_descs.size());
+ EXPECT_EQ(1u, property_descs.size()) << line;
current_namespace.whitelisted.push_back(value);
} else {
EXPECT_TRUE(false) << "Failed to parse line : " << line;
if (std::regex_match(line, match, section_name_regex)) {
// [section_name]
- ASSERT_EQ(2u, match.size());
+ ASSERT_EQ(2u, match.size()) << line;
std::string section_name = match[1];
- ASSERT_TRUE(MapContainsKey(conf.sections, section_name));
+ ASSERT_TRUE(MapContainsKey(conf.sections, section_name)) << line;
current_section = &conf.sections[section_name];
continue;
if (std::regex_match(line, match, additional_namespaces_regex)) {
ParseAdditionalNamespaces(match, *current_section);
} else {
- EXPECT_TRUE(std::regex_match(line, match, namespace_base_regex));
- ASSERT_EQ(5u, match.size());
+ EXPECT_TRUE(std::regex_match(line, match, namespace_base_regex)) << line;
+ ASSERT_EQ(5u, match.size()) << line;
std::string namespace_name = match[1];
std::string property_desc = match[2];
bool is_additional_property = match[3] == "+=";