diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2021-03-19 14:54:17 -0700 |
---|---|---|
committer | Ryan Mitchell <rtmitchell@google.com> | 2021-03-29 10:22:10 -0700 |
commit | 1d008d1d2a73a8b796add4e18924fcc99220a839 (patch) | |
tree | 7f7b52c0ede88aa53389f3f5361c6e7e43ad41db /tools/aapt2/split/TableSplitter_test.cpp | |
parent | 9634efb6f44d8d3f5edbcc7118ad9e3d8e3f9aa9 (diff) |
Refactor aapt2 tests ResourceTable changes
This changes refactors tests to use the NewResourceBuilder class
that makes it easier to construct resource entries.
Bug: 183102797
Test: aapt2_tests
Change-Id: I851f9fb99a003769f8df8c1876997eee0864822a
Diffstat (limited to 'tools/aapt2/split/TableSplitter_test.cpp')
-rw-r--r-- | tools/aapt2/split/TableSplitter_test.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/tools/aapt2/split/TableSplitter_test.cpp b/tools/aapt2/split/TableSplitter_test.cpp index cdf07386c70f..c6a2ff33979b 100644 --- a/tools/aapt2/split/TableSplitter_test.cpp +++ b/tools/aapt2/split/TableSplitter_test.cpp @@ -193,15 +193,23 @@ TEST(TableSplitterTest, SplitTableByConfigAndDensity) { ResourceTable table; const ResourceName foo = test::ParseNameOrDie("android:string/foo"); - ASSERT_TRUE(table.AddResource(foo, test::ParseConfigOrDie("land-hdpi"), {}, - util::make_unique<Id>(), - test::GetDiagnostics())); - ASSERT_TRUE(table.AddResource(foo, test::ParseConfigOrDie("land-xhdpi"), {}, - util::make_unique<Id>(), - test::GetDiagnostics())); - ASSERT_TRUE(table.AddResource(foo, test::ParseConfigOrDie("land-xxhdpi"), {}, - util::make_unique<Id>(), - test::GetDiagnostics())); + ASSERT_TRUE( + table.AddResource(NewResourceBuilder(foo) + .SetValue(util::make_unique<Id>(), test::ParseConfigOrDie("land-hdpi")) + .Build(), + test::GetDiagnostics())); + + ASSERT_TRUE( + table.AddResource(NewResourceBuilder(foo) + .SetValue(util::make_unique<Id>(), test::ParseConfigOrDie("land-xhdpi")) + .Build(), + test::GetDiagnostics())); + + ASSERT_TRUE(table.AddResource( + NewResourceBuilder(foo) + .SetValue(util::make_unique<Id>(), test::ParseConfigOrDie("land-xxhdpi")) + .Build(), + test::GetDiagnostics())); std::vector<SplitConstraints> constraints; constraints.push_back( |