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
diff --git a/tools/aapt2/split/TableSplitter_test.cpp b/tools/aapt2/split/TableSplitter_test.cpp
index cdf0738..c6a2ff3 100644
--- a/tools/aapt2/split/TableSplitter_test.cpp
+++ b/tools/aapt2/split/TableSplitter_test.cpp
@@ -193,15 +193,23 @@
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(