summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceTable_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt2/ResourceTable_test.cpp')
-rw-r--r--tools/aapt2/ResourceTable_test.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/aapt2/ResourceTable_test.cpp b/tools/aapt2/ResourceTable_test.cpp
index cb3699a00f75..e2b37be994ff 100644
--- a/tools/aapt2/ResourceTable_test.cpp
+++ b/tools/aapt2/ResourceTable_test.cpp
@@ -40,6 +40,14 @@ TEST(ResourceTableTest, FailToAddResourceWithBadName) {
test::GetDiagnostics()));
}
+TEST(ResourceTableTest, AddResourceWithWeirdNameWhenAddingMangledResources) {
+ ResourceTable table;
+
+ EXPECT_TRUE(table.AddResourceAllowMangled(
+ test::ParseNameOrDie("android:id/heythere "), ConfigDescription{}, "",
+ test::ValueBuilder<Id>().SetSource("test.xml", 21u).Build(), test::GetDiagnostics()));
+}
+
TEST(ResourceTableTest, AddOneResource) {
ResourceTable table;
@@ -130,7 +138,7 @@ TEST(ResourceTableTest, ProductVaryingValues) {
table.FindResource(test::ParseNameOrDie("android:string/foo"));
AAPT_ASSERT_TRUE(sr);
std::vector<ResourceConfigValue*> values =
- sr.value().entry->findAllValues(test::ParseConfigOrDie("land"));
+ sr.value().entry->FindAllValues(test::ParseConfigOrDie("land"));
ASSERT_EQ(2u, values.size());
EXPECT_EQ(std::string("phone"), values[0]->product);
EXPECT_EQ(std::string("tablet"), values[1]->product);