diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-30 01:07:58 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-30 01:07:58 +0000 |
commit | 38c004eb6e124cf191eefc8ac72e797e709bbfc6 (patch) | |
tree | 295d6dc608f4c83ebc62a4a658ac92efcc4365ad /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | 0b863c7538ffe42f781d0ecbbfd2903705b35e77 (diff) | |
parent | 2fef6def9a047cd97460476ee759a69edca2f1ad (diff) |
Snap for 7325276 from 2fef6def9a047cd97460476ee759a69edca2f1ad to sc-release
Change-Id: I15050e1a15f18a931620e28707d81f93ddec999d
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 |