diff options
author | Brian Orr <brianorr@google.com> | 2021-05-14 18:52:34 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-05-14 18:52:34 +0000 |
commit | 5cc0425e7e8c39fd412a45a6cec0e64fa3269657 (patch) | |
tree | b4f41ed6b8ead81fb4d040075eda1973fa6eb1be /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | 2ab32d50b54010c8d66903674ee3b2138f9e8d0e (diff) | |
parent | 3cc63724673b4829450b4e2f6db88154df98f33e (diff) |
Merge changes from topic "SP1A.210510.001" into s-keystone-qcom-dev
* changes:
Add AttributionSource parameter where needed
Merge SP1A.210510.001
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
-rw-r--r-- | tools/aapt2/java/JavaClassGenerator_test.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/aapt2/java/JavaClassGenerator_test.cpp b/tools/aapt2/java/JavaClassGenerator_test.cpp index d08b61e5ff66..40395ed64fe3 100644 --- a/tools/aapt2/java/JavaClassGenerator_test.cpp +++ b/tools/aapt2/java/JavaClassGenerator_test.cpp @@ -570,4 +570,25 @@ TEST(JavaClassGeneratorTest, SortsDynamicAttributesAfterFrameworkAttributes) { EXPECT_THAT(output, HasSubstr("public static final int MyStyleable_dynamic_attr=1;")); } +TEST(JavaClassGeneratorTest, SkipMacros) { + std::unique_ptr<ResourceTable> table = + test::ResourceTableBuilder() + .AddValue("android:macro/bar", ResourceId(0x01010000), test::AttributeBuilder().Build()) + .Build(); + + std::unique_ptr<IAaptContext> context = + test::ContextBuilder() + .AddSymbolSource(util::make_unique<ResourceTableSymbolSource>(table.get())) + .SetNameManglerPolicy(NameManglerPolicy{"android"}) + .Build(); + JavaClassGenerator generator(context.get(), table.get(), {}); + + std::string output; + StringOutputStream out(&output); + EXPECT_TRUE(generator.Generate("android", &out)); + out.Flush(); + + EXPECT_THAT(output, Not(HasSubstr("bar"))); +} + } // namespace aapt |