summaryrefslogtreecommitdiff
path: root/tools/aapt2/link/AutoVersioner_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt2/link/AutoVersioner_test.cpp')
-rw-r--r--tools/aapt2/link/AutoVersioner_test.cpp49
1 files changed, 23 insertions, 26 deletions
diff --git a/tools/aapt2/link/AutoVersioner_test.cpp b/tools/aapt2/link/AutoVersioner_test.cpp
index 9b3a87c4eed0..7764176772b6 100644
--- a/tools/aapt2/link/AutoVersioner_test.cpp
+++ b/tools/aapt2/link/AutoVersioner_test.cpp
@@ -16,10 +16,7 @@
#include "ConfigDescription.h"
#include "link/Linkers.h"
-#include "test/Builders.h"
-#include "test/Context.h"
-
-#include <gtest/gtest.h>
+#include "test/Test.h"
namespace aapt {
@@ -28,7 +25,7 @@ TEST(AutoVersionerTest, GenerateVersionedResources) {
const ConfigDescription landConfig = test::parseConfigOrDie("land");
const ConfigDescription sw600dpLandConfig = test::parseConfigOrDie("sw600dp-land");
- ResourceEntry entry(u"foo");
+ ResourceEntry entry("foo");
entry.values.push_back(util::make_unique<ResourceConfigValue>(defaultConfig, ""));
entry.values.push_back(util::make_unique<ResourceConfigValue>(landConfig, ""));
entry.values.push_back(util::make_unique<ResourceConfigValue>(sw600dpLandConfig, ""));
@@ -42,7 +39,7 @@ TEST(AutoVersionerTest, GenerateVersionedResourceWhenHigherVersionExists) {
const ConfigDescription sw600dpV13Config = test::parseConfigOrDie("sw600dp-v13");
const ConfigDescription v21Config = test::parseConfigOrDie("v21");
- ResourceEntry entry(u"foo");
+ ResourceEntry entry("foo");
entry.values.push_back(util::make_unique<ResourceConfigValue>(defaultConfig, ""));
entry.values.push_back(util::make_unique<ResourceConfigValue>(sw600dpV13Config, ""));
entry.values.push_back(util::make_unique<ResourceConfigValue>(v21Config, ""));
@@ -53,73 +50,73 @@ TEST(AutoVersionerTest, GenerateVersionedResourceWhenHigherVersionExists) {
TEST(AutoVersionerTest, VersionStylesForTable) {
std::unique_ptr<ResourceTable> table = test::ResourceTableBuilder()
- .setPackageId(u"app", 0x7f)
- .addValue(u"@app:style/Foo", ResourceId(0x7f020000), test::parseConfigOrDie("v4"),
+ .setPackageId("app", 0x7f)
+ .addValue("@app:style/Foo", test::parseConfigOrDie("v4"), ResourceId(0x7f020000),
test::StyleBuilder()
- .addItem(u"@android:attr/onClick", ResourceId(0x0101026f),
+ .addItem("@android:attr/onClick", ResourceId(0x0101026f),
util::make_unique<Id>())
- .addItem(u"@android:attr/paddingStart", ResourceId(0x010103b3),
+ .addItem("@android:attr/paddingStart", ResourceId(0x010103b3),
util::make_unique<Id>())
- .addItem(u"@android:attr/requiresSmallestWidthDp",
+ .addItem("@android:attr/requiresSmallestWidthDp",
ResourceId(0x01010364), util::make_unique<Id>())
- .addItem(u"@android:attr/colorAccent", ResourceId(0x01010435),
+ .addItem("@android:attr/colorAccent", ResourceId(0x01010435),
util::make_unique<Id>())
.build())
- .addValue(u"@app:style/Foo", ResourceId(0x7f020000), test::parseConfigOrDie("v21"),
+ .addValue("@app:style/Foo", test::parseConfigOrDie("v21"), ResourceId(0x7f020000),
test::StyleBuilder()
- .addItem(u"@android:attr/paddingEnd", ResourceId(0x010103b4),
+ .addItem("@android:attr/paddingEnd", ResourceId(0x010103b4),
util::make_unique<Id>())
.build())
.build();
std::unique_ptr<IAaptContext> context = test::ContextBuilder()
- .setCompilationPackage(u"app")
+ .setCompilationPackage("app")
.setPackageId(0x7f)
.build();
AutoVersioner versioner;
ASSERT_TRUE(versioner.consume(context.get(), table.get()));
- Style* style = test::getValueForConfig<Style>(table.get(), u"@app:style/Foo",
+ Style* style = test::getValueForConfig<Style>(table.get(), "@app:style/Foo",
test::parseConfigOrDie("v4"));
ASSERT_NE(style, nullptr);
ASSERT_EQ(style->entries.size(), 1u);
AAPT_ASSERT_TRUE(style->entries.front().key.name);
EXPECT_EQ(style->entries.front().key.name.value(),
- test::parseNameOrDie(u"@android:attr/onClick"));
+ test::parseNameOrDie("@android:attr/onClick"));
- style = test::getValueForConfig<Style>(table.get(), u"@app:style/Foo",
+ style = test::getValueForConfig<Style>(table.get(), "@app:style/Foo",
test::parseConfigOrDie("v13"));
ASSERT_NE(style, nullptr);
ASSERT_EQ(style->entries.size(), 2u);
AAPT_ASSERT_TRUE(style->entries[0].key.name);
EXPECT_EQ(style->entries[0].key.name.value(),
- test::parseNameOrDie(u"@android:attr/onClick"));
+ test::parseNameOrDie("@android:attr/onClick"));
AAPT_ASSERT_TRUE(style->entries[1].key.name);
EXPECT_EQ(style->entries[1].key.name.value(),
- test::parseNameOrDie(u"@android:attr/requiresSmallestWidthDp"));
+ test::parseNameOrDie("@android:attr/requiresSmallestWidthDp"));
- style = test::getValueForConfig<Style>(table.get(), u"@app:style/Foo",
+ style = test::getValueForConfig<Style>(table.get(), "@app:style/Foo",
test::parseConfigOrDie("v17"));
ASSERT_NE(style, nullptr);
ASSERT_EQ(style->entries.size(), 3u);
AAPT_ASSERT_TRUE(style->entries[0].key.name);
EXPECT_EQ(style->entries[0].key.name.value(),
- test::parseNameOrDie(u"@android:attr/onClick"));
+ test::parseNameOrDie("@android:attr/onClick"));
AAPT_ASSERT_TRUE(style->entries[1].key.name);
EXPECT_EQ(style->entries[1].key.name.value(),
- test::parseNameOrDie(u"@android:attr/requiresSmallestWidthDp"));
+ test::parseNameOrDie("@android:attr/requiresSmallestWidthDp"));
AAPT_ASSERT_TRUE(style->entries[2].key.name);
EXPECT_EQ(style->entries[2].key.name.value(),
- test::parseNameOrDie(u"@android:attr/paddingStart"));
+ test::parseNameOrDie("@android:attr/paddingStart"));
- style = test::getValueForConfig<Style>(table.get(), u"@app:style/Foo",
+ style = test::getValueForConfig<Style>(table.get(), "@app:style/Foo",
test::parseConfigOrDie("v21"));
ASSERT_NE(style, nullptr);
ASSERT_EQ(style->entries.size(), 1u);
AAPT_ASSERT_TRUE(style->entries.front().key.name);
EXPECT_EQ(style->entries.front().key.name.value(),
- test::parseNameOrDie(u"@android:attr/paddingEnd"));
+ test::parseNameOrDie("@android:attr/paddingEnd"));
}
} // namespace aapt