AAPT2: Remove usage of u16string
For legacy reasons, we kept around the use of UTF-16 internally
in AAPT2. We don't need this and this CL removes all instances of
std::u16string and StringPiece16. The only places still needed
are when interacting with the ResTable APIs that only operate in
UTF16.
Change-Id: I492475b84bb9014fa13bf992cff447ee7a5fe588
diff --git a/tools/aapt2/ResourceParser_test.cpp b/tools/aapt2/ResourceParser_test.cpp
index 3450de9..b456c04 100644
--- a/tools/aapt2/ResourceParser_test.cpp
+++ b/tools/aapt2/ResourceParser_test.cpp
@@ -18,10 +18,9 @@
#include "ResourceTable.h"
#include "ResourceUtils.h"
#include "ResourceValues.h"
-#include "test/Context.h"
+#include "test/Test.h"
#include "xml/XmlPullParser.h"
-#include <gtest/gtest.h>
#include <sstream>
#include <string>
@@ -69,18 +68,18 @@
std::string input = "<string name=\"foo\"> \" hey there \" </string>";
ASSERT_TRUE(testParse(input));
- String* str = test::getValue<String>(&mTable, u"@string/foo");
+ String* str = test::getValue<String>(&mTable, "@string/foo");
ASSERT_NE(nullptr, str);
- EXPECT_EQ(std::u16string(u" hey there "), *str->value);
+ EXPECT_EQ(std::string(" hey there "), *str->value);
}
TEST_F(ResourceParserTest, ParseEscapedString) {
std::string input = "<string name=\"foo\">\\?123</string>";
ASSERT_TRUE(testParse(input));
- String* str = test::getValue<String>(&mTable, u"@string/foo");
+ String* str = test::getValue<String>(&mTable, "@string/foo");
ASSERT_NE(nullptr, str);
- EXPECT_EQ(std::u16string(u"?123"), *str->value);
+ EXPECT_EQ(std::string("?123"), *str->value);
}
TEST_F(ResourceParserTest, ParseFormattedString) {
@@ -97,9 +96,9 @@
" There are <xliff:g id=\"count\">%1$d</xliff:g> apples</string>";
ASSERT_TRUE(testParse(input));
- String* str = test::getValue<String>(&mTable, u"@string/foo");
+ String* str = test::getValue<String>(&mTable, "@string/foo");
ASSERT_NE(nullptr, str);
- EXPECT_EQ(StringPiece16(u"There are %1$d apples"), StringPiece16(*str->value));
+ EXPECT_EQ(StringPiece("There are %1$d apples"), StringPiece(*str->value));
}
TEST_F(ResourceParserTest, ParseNull) {
@@ -110,7 +109,7 @@
// a non-existing value, and this causes problems in styles when trying to resolve
// an attribute. Null values must be encoded as android::Res_value::TYPE_REFERENCE
// with a data value of 0.
- BinaryPrimitive* integer = test::getValue<BinaryPrimitive>(&mTable, u"@integer/foo");
+ BinaryPrimitive* integer = test::getValue<BinaryPrimitive>(&mTable, "@integer/foo");
ASSERT_NE(nullptr, integer);
EXPECT_EQ(uint16_t(android::Res_value::TYPE_REFERENCE), integer->value.dataType);
EXPECT_EQ(0u, integer->value.data);
@@ -120,7 +119,7 @@
std::string input = "<integer name=\"foo\">@empty</integer>";
ASSERT_TRUE(testParse(input));
- BinaryPrimitive* integer = test::getValue<BinaryPrimitive>(&mTable, u"@integer/foo");
+ BinaryPrimitive* integer = test::getValue<BinaryPrimitive>(&mTable, "@integer/foo");
ASSERT_NE(nullptr, integer);
EXPECT_EQ(uint16_t(android::Res_value::TYPE_NULL), integer->value.dataType);
EXPECT_EQ(uint32_t(android::Res_value::DATA_NULL_EMPTY), integer->value.data);
@@ -131,11 +130,11 @@
"<attr name=\"bar\"/>";
ASSERT_TRUE(testParse(input));
- Attribute* attr = test::getValue<Attribute>(&mTable, u"@attr/foo");
+ Attribute* attr = test::getValue<Attribute>(&mTable, "@attr/foo");
ASSERT_NE(nullptr, attr);
EXPECT_EQ(uint32_t(android::ResTable_map::TYPE_STRING), attr->typeMask);
- attr = test::getValue<Attribute>(&mTable, u"@attr/bar");
+ attr = test::getValue<Attribute>(&mTable, "@attr/bar");
ASSERT_NE(nullptr, attr);
EXPECT_EQ(uint32_t(android::ResTable_map::TYPE_ANY), attr->typeMask);
}
@@ -151,20 +150,20 @@
</declare-styleable>)EOF";
ASSERT_TRUE(testParse(input, watchConfig));
- EXPECT_EQ(nullptr, test::getValueForConfig<Attribute>(&mTable, u"@attr/foo", watchConfig));
- EXPECT_EQ(nullptr, test::getValueForConfig<Attribute>(&mTable, u"@attr/baz", watchConfig));
- EXPECT_EQ(nullptr, test::getValueForConfig<Styleable>(&mTable, u"@styleable/bar", watchConfig));
+ EXPECT_EQ(nullptr, test::getValueForConfig<Attribute>(&mTable, "@attr/foo", watchConfig));
+ EXPECT_EQ(nullptr, test::getValueForConfig<Attribute>(&mTable, "@attr/baz", watchConfig));
+ EXPECT_EQ(nullptr, test::getValueForConfig<Styleable>(&mTable, "@styleable/bar", watchConfig));
- EXPECT_NE(nullptr, test::getValue<Attribute>(&mTable, u"@attr/foo"));
- EXPECT_NE(nullptr, test::getValue<Attribute>(&mTable, u"@attr/baz"));
- EXPECT_NE(nullptr, test::getValue<Styleable>(&mTable, u"@styleable/bar"));
+ EXPECT_NE(nullptr, test::getValue<Attribute>(&mTable, "@attr/foo"));
+ EXPECT_NE(nullptr, test::getValue<Attribute>(&mTable, "@attr/baz"));
+ EXPECT_NE(nullptr, test::getValue<Styleable>(&mTable, "@styleable/bar"));
}
TEST_F(ResourceParserTest, ParseAttrWithMinMax) {
std::string input = "<attr name=\"foo\" min=\"10\" max=\"23\" format=\"integer\"/>";
ASSERT_TRUE(testParse(input));
- Attribute* attr = test::getValue<Attribute>(&mTable, u"@attr/foo");
+ Attribute* attr = test::getValue<Attribute>(&mTable, "@attr/foo");
ASSERT_NE(nullptr, attr);
EXPECT_EQ(uint32_t(android::ResTable_map::TYPE_INTEGER), attr->typeMask);
EXPECT_EQ(10, attr->minInt);
@@ -183,7 +182,7 @@
"<attr name=\"foo\" format=\"string\"/>";
ASSERT_TRUE(testParse(input));
- Attribute* attr = test::getValue<Attribute>(&mTable, u"@attr/foo");
+ Attribute* attr = test::getValue<Attribute>(&mTable, "@attr/foo");
ASSERT_NE(nullptr, attr);
EXPECT_EQ(uint32_t(android::ResTable_map::TYPE_STRING), attr->typeMask);
}
@@ -197,7 +196,7 @@
"</declare-styleable>";
ASSERT_TRUE(testParse(input));
- Attribute* attr = test::getValue<Attribute>(&mTable, u"@attr/foo");
+ Attribute* attr = test::getValue<Attribute>(&mTable, "@attr/foo");
ASSERT_NE(nullptr, attr);
EXPECT_EQ(uint32_t(android::ResTable_map::TYPE_BOOLEAN), attr->typeMask);
}
@@ -210,21 +209,21 @@
"</attr>";
ASSERT_TRUE(testParse(input));
- Attribute* enumAttr = test::getValue<Attribute>(&mTable, u"@attr/foo");
+ Attribute* enumAttr = test::getValue<Attribute>(&mTable, "@attr/foo");
ASSERT_NE(enumAttr, nullptr);
EXPECT_EQ(enumAttr->typeMask, android::ResTable_map::TYPE_ENUM);
ASSERT_EQ(enumAttr->symbols.size(), 3u);
AAPT_ASSERT_TRUE(enumAttr->symbols[0].symbol.name);
- EXPECT_EQ(enumAttr->symbols[0].symbol.name.value().entry, u"bar");
+ EXPECT_EQ(enumAttr->symbols[0].symbol.name.value().entry, "bar");
EXPECT_EQ(enumAttr->symbols[0].value, 0u);
AAPT_ASSERT_TRUE(enumAttr->symbols[1].symbol.name);
- EXPECT_EQ(enumAttr->symbols[1].symbol.name.value().entry, u"bat");
+ EXPECT_EQ(enumAttr->symbols[1].symbol.name.value().entry, "bat");
EXPECT_EQ(enumAttr->symbols[1].value, 1u);
AAPT_ASSERT_TRUE(enumAttr->symbols[2].symbol.name);
- EXPECT_EQ(enumAttr->symbols[2].symbol.name.value().entry, u"baz");
+ EXPECT_EQ(enumAttr->symbols[2].symbol.name.value().entry, "baz");
EXPECT_EQ(enumAttr->symbols[2].value, 2u);
}
@@ -236,25 +235,25 @@
"</attr>";
ASSERT_TRUE(testParse(input));
- Attribute* flagAttr = test::getValue<Attribute>(&mTable, u"@attr/foo");
+ Attribute* flagAttr = test::getValue<Attribute>(&mTable, "@attr/foo");
ASSERT_NE(nullptr, flagAttr);
EXPECT_EQ(flagAttr->typeMask, android::ResTable_map::TYPE_FLAGS);
ASSERT_EQ(flagAttr->symbols.size(), 3u);
AAPT_ASSERT_TRUE(flagAttr->symbols[0].symbol.name);
- EXPECT_EQ(flagAttr->symbols[0].symbol.name.value().entry, u"bar");
+ EXPECT_EQ(flagAttr->symbols[0].symbol.name.value().entry, "bar");
EXPECT_EQ(flagAttr->symbols[0].value, 0u);
AAPT_ASSERT_TRUE(flagAttr->symbols[1].symbol.name);
- EXPECT_EQ(flagAttr->symbols[1].symbol.name.value().entry, u"bat");
+ EXPECT_EQ(flagAttr->symbols[1].symbol.name.value().entry, "bat");
EXPECT_EQ(flagAttr->symbols[1].value, 1u);
AAPT_ASSERT_TRUE(flagAttr->symbols[2].symbol.name);
- EXPECT_EQ(flagAttr->symbols[2].symbol.name.value().entry, u"baz");
+ EXPECT_EQ(flagAttr->symbols[2].symbol.name.value().entry, "baz");
EXPECT_EQ(flagAttr->symbols[2].value, 2u);
std::unique_ptr<BinaryPrimitive> flagValue = ResourceUtils::tryParseFlagSymbol(flagAttr,
- u"baz|bat");
+ "baz|bat");
ASSERT_NE(nullptr, flagValue);
EXPECT_EQ(flagValue->value.data, 1u | 2u);
}
@@ -276,32 +275,32 @@
"</style>";
ASSERT_TRUE(testParse(input));
- Style* style = test::getValue<Style>(&mTable, u"@style/foo");
+ Style* style = test::getValue<Style>(&mTable, "@style/foo");
ASSERT_NE(nullptr, style);
AAPT_ASSERT_TRUE(style->parent);
AAPT_ASSERT_TRUE(style->parent.value().name);
- EXPECT_EQ(test::parseNameOrDie(u"@style/fu"), style->parent.value().name.value());
+ EXPECT_EQ(test::parseNameOrDie("@style/fu"), style->parent.value().name.value());
ASSERT_EQ(3u, style->entries.size());
AAPT_ASSERT_TRUE(style->entries[0].key.name);
- EXPECT_EQ(test::parseNameOrDie(u"@attr/bar"), style->entries[0].key.name.value());
+ EXPECT_EQ(test::parseNameOrDie("@attr/bar"), style->entries[0].key.name.value());
AAPT_ASSERT_TRUE(style->entries[1].key.name);
- EXPECT_EQ(test::parseNameOrDie(u"@attr/bat"), style->entries[1].key.name.value());
+ EXPECT_EQ(test::parseNameOrDie("@attr/bat"), style->entries[1].key.name.value());
AAPT_ASSERT_TRUE(style->entries[2].key.name);
- EXPECT_EQ(test::parseNameOrDie(u"@attr/baz"), style->entries[2].key.name.value());
+ EXPECT_EQ(test::parseNameOrDie("@attr/baz"), style->entries[2].key.name.value());
}
TEST_F(ResourceParserTest, ParseStyleWithShorthandParent) {
std::string input = "<style name=\"foo\" parent=\"com.app:Theme\"/>";
ASSERT_TRUE(testParse(input));
- Style* style = test::getValue<Style>(&mTable, u"@style/foo");
+ Style* style = test::getValue<Style>(&mTable, "@style/foo");
ASSERT_NE(nullptr, style);
AAPT_ASSERT_TRUE(style->parent);
AAPT_ASSERT_TRUE(style->parent.value().name);
- EXPECT_EQ(test::parseNameOrDie(u"@com.app:style/Theme"), style->parent.value().name.value());
+ EXPECT_EQ(test::parseNameOrDie("@com.app:style/Theme"), style->parent.value().name.value());
}
TEST_F(ResourceParserTest, ParseStyleWithPackageAliasedParent) {
@@ -309,11 +308,11 @@
" name=\"foo\" parent=\"app:Theme\"/>";
ASSERT_TRUE(testParse(input));
- Style* style = test::getValue<Style>(&mTable, u"@style/foo");
+ Style* style = test::getValue<Style>(&mTable, "@style/foo");
ASSERT_NE(nullptr, style);
AAPT_ASSERT_TRUE(style->parent);
AAPT_ASSERT_TRUE(style->parent.value().name);
- EXPECT_EQ(test::parseNameOrDie(u"@android:style/Theme"), style->parent.value().name.value());
+ EXPECT_EQ(test::parseNameOrDie("@android:style/Theme"), style->parent.value().name.value());
}
TEST_F(ResourceParserTest, ParseStyleWithPackageAliasedItems) {
@@ -323,21 +322,21 @@
"</style>";
ASSERT_TRUE(testParse(input));
- Style* style = test::getValue<Style>(&mTable, u"@style/foo");
+ Style* style = test::getValue<Style>(&mTable, "@style/foo");
ASSERT_NE(nullptr, style);
ASSERT_EQ(1u, style->entries.size());
- EXPECT_EQ(test::parseNameOrDie(u"@android:attr/bar"), style->entries[0].key.name.value());
+ EXPECT_EQ(test::parseNameOrDie("@android:attr/bar"), style->entries[0].key.name.value());
}
TEST_F(ResourceParserTest, ParseStyleWithInferredParent) {
std::string input = "<style name=\"foo.bar\"/>";
ASSERT_TRUE(testParse(input));
- Style* style = test::getValue<Style>(&mTable, u"@style/foo.bar");
+ Style* style = test::getValue<Style>(&mTable, "@style/foo.bar");
ASSERT_NE(nullptr, style);
AAPT_ASSERT_TRUE(style->parent);
AAPT_ASSERT_TRUE(style->parent.value().name);
- EXPECT_EQ(style->parent.value().name.value(), test::parseNameOrDie(u"@style/foo"));
+ EXPECT_EQ(style->parent.value().name.value(), test::parseNameOrDie("@style/foo"));
EXPECT_TRUE(style->parentInferred);
}
@@ -345,7 +344,7 @@
std::string input = "<style name=\"foo.bar\" parent=\"\"/>";
ASSERT_TRUE(testParse(input));
- Style* style = test::getValue<Style>(&mTable, u"@style/foo.bar");
+ Style* style = test::getValue<Style>(&mTable, "@style/foo.bar");
ASSERT_NE(nullptr, style);
AAPT_EXPECT_FALSE(style->parent);
EXPECT_FALSE(style->parentInferred);
@@ -355,7 +354,7 @@
std::string input = R"EOF(<style name="foo" parent="*android:style/bar" />)EOF";
ASSERT_TRUE(testParse(input));
- Style* style = test::getValue<Style>(&mTable, u"@style/foo");
+ Style* style = test::getValue<Style>(&mTable, "@style/foo");
ASSERT_NE(nullptr, style);
AAPT_ASSERT_TRUE(style->parent);
EXPECT_TRUE(style->parent.value().privateReference);
@@ -365,7 +364,7 @@
std::string input = "<string name=\"foo\">@+id/bar</string>";
ASSERT_TRUE(testParse(input));
- Id* id = test::getValue<Id>(&mTable, u"@id/bar");
+ Id* id = test::getValue<Id>(&mTable, "@id/bar");
ASSERT_NE(id, nullptr);
}
@@ -380,31 +379,31 @@
ASSERT_TRUE(testParse(input));
Maybe<ResourceTable::SearchResult> result =
- mTable.findResource(test::parseNameOrDie(u"@styleable/foo"));
+ mTable.findResource(test::parseNameOrDie("@styleable/foo"));
AAPT_ASSERT_TRUE(result);
EXPECT_EQ(SymbolState::kPublic, result.value().entry->symbolStatus.state);
- Attribute* attr = test::getValue<Attribute>(&mTable, u"@attr/bar");
+ Attribute* attr = test::getValue<Attribute>(&mTable, "@attr/bar");
ASSERT_NE(attr, nullptr);
EXPECT_TRUE(attr->isWeak());
- attr = test::getValue<Attribute>(&mTable, u"@attr/bat");
+ attr = test::getValue<Attribute>(&mTable, "@attr/bat");
ASSERT_NE(attr, nullptr);
EXPECT_TRUE(attr->isWeak());
- attr = test::getValue<Attribute>(&mTable, u"@attr/baz");
+ attr = test::getValue<Attribute>(&mTable, "@attr/baz");
ASSERT_NE(attr, nullptr);
EXPECT_TRUE(attr->isWeak());
EXPECT_EQ(1u, attr->symbols.size());
- EXPECT_NE(nullptr, test::getValue<Id>(&mTable, u"@id/foo"));
+ EXPECT_NE(nullptr, test::getValue<Id>(&mTable, "@id/foo"));
- Styleable* styleable = test::getValue<Styleable>(&mTable, u"@styleable/foo");
+ Styleable* styleable = test::getValue<Styleable>(&mTable, "@styleable/foo");
ASSERT_NE(styleable, nullptr);
ASSERT_EQ(3u, styleable->entries.size());
- EXPECT_EQ(test::parseNameOrDie(u"@attr/bar"), styleable->entries[0].name.value());
- EXPECT_EQ(test::parseNameOrDie(u"@attr/bat"), styleable->entries[1].name.value());
+ EXPECT_EQ(test::parseNameOrDie("@attr/bar"), styleable->entries[0].name.value());
+ EXPECT_EQ(test::parseNameOrDie("@attr/bat"), styleable->entries[1].name.value());
}
TEST_F(ResourceParserTest, ParsePrivateAttributesDeclareStyleable) {
@@ -413,17 +412,17 @@
" <attr name=\"privAndroid:bat\" />\n"
"</declare-styleable>";
ASSERT_TRUE(testParse(input));
- Styleable* styleable = test::getValue<Styleable>(&mTable, u"@styleable/foo");
+ Styleable* styleable = test::getValue<Styleable>(&mTable, "@styleable/foo");
ASSERT_NE(nullptr, styleable);
ASSERT_EQ(2u, styleable->entries.size());
EXPECT_TRUE(styleable->entries[0].privateReference);
AAPT_ASSERT_TRUE(styleable->entries[0].name);
- EXPECT_EQ(std::u16string(u"android"), styleable->entries[0].name.value().package);
+ EXPECT_EQ(std::string("android"), styleable->entries[0].name.value().package);
EXPECT_TRUE(styleable->entries[1].privateReference);
AAPT_ASSERT_TRUE(styleable->entries[1].name);
- EXPECT_EQ(std::u16string(u"android"), styleable->entries[1].name.value().package);
+ EXPECT_EQ(std::string("android"), styleable->entries[1].name.value().package);
}
TEST_F(ResourceParserTest, ParseArray) {
@@ -434,7 +433,7 @@
"</array>";
ASSERT_TRUE(testParse(input));
- Array* array = test::getValue<Array>(&mTable, u"@array/foo");
+ Array* array = test::getValue<Array>(&mTable, "@array/foo");
ASSERT_NE(array, nullptr);
ASSERT_EQ(3u, array->items.size());
@@ -448,7 +447,7 @@
" <item>\"Werk\"</item>\n"
"</string-array>\n";
ASSERT_TRUE(testParse(input));
- EXPECT_NE(nullptr, test::getValue<Array>(&mTable, u"@array/foo"));
+ EXPECT_NE(nullptr, test::getValue<Array>(&mTable, "@array/foo"));
}
TEST_F(ResourceParserTest, ParsePlural) {
@@ -464,9 +463,9 @@
"<string name=\"foo\">Hi</string>";
ASSERT_TRUE(testParse(input));
- String* value = test::getValue<String>(&mTable, u"@string/foo");
+ String* value = test::getValue<String>(&mTable, "@string/foo");
ASSERT_NE(nullptr, value);
- EXPECT_EQ(value->getComment(), u"This is a comment");
+ EXPECT_EQ(value->getComment(), "This is a comment");
}
TEST_F(ResourceParserTest, DoNotCombineMultipleComments) {
@@ -476,9 +475,9 @@
ASSERT_TRUE(testParse(input));
- String* value = test::getValue<String>(&mTable, u"@string/foo");
+ String* value = test::getValue<String>(&mTable, "@string/foo");
ASSERT_NE(nullptr, value);
- EXPECT_EQ(value->getComment(), u"Two");
+ EXPECT_EQ(value->getComment(), "Two");
}
TEST_F(ResourceParserTest, IgnoreCommentBeforeEndTag) {
@@ -490,9 +489,9 @@
ASSERT_TRUE(testParse(input));
- String* value = test::getValue<String>(&mTable, u"@string/foo");
+ String* value = test::getValue<String>(&mTable, "@string/foo");
ASSERT_NE(nullptr, value);
- EXPECT_EQ(value->getComment(), u"One");
+ EXPECT_EQ(value->getComment(), "One");
}
TEST_F(ResourceParserTest, ParseNestedComments) {
@@ -510,17 +509,17 @@
</attr>)EOF";
ASSERT_TRUE(testParse(input));
- Styleable* styleable = test::getValue<Styleable>(&mTable, u"@styleable/foo");
+ Styleable* styleable = test::getValue<Styleable>(&mTable, "@styleable/foo");
ASSERT_NE(nullptr, styleable);
ASSERT_EQ(1u, styleable->entries.size());
- EXPECT_EQ(StringPiece16(u"The name of the bar"), styleable->entries.front().getComment());
+ EXPECT_EQ(StringPiece("The name of the bar"), styleable->entries.front().getComment());
- Attribute* attr = test::getValue<Attribute>(&mTable, u"@attr/foo");
+ Attribute* attr = test::getValue<Attribute>(&mTable, "@attr/foo");
ASSERT_NE(nullptr, attr);
ASSERT_EQ(1u, attr->symbols.size());
- EXPECT_EQ(StringPiece16(u"The very first"), attr->symbols.front().symbol.getComment());
+ EXPECT_EQ(StringPiece("The very first"), attr->symbols.front().symbol.getComment());
}
/*
@@ -531,7 +530,7 @@
std::string input = "<public type=\"id\" name=\"foo\"/>";
ASSERT_TRUE(testParse(input));
- Id* id = test::getValue<Id>(&mTable, u"@id/foo");
+ Id* id = test::getValue<Id>(&mTable, "@id/foo");
ASSERT_NE(nullptr, id);
}
@@ -546,22 +545,22 @@
)EOF";
ASSERT_TRUE(testParse(input));
- EXPECT_NE(nullptr, test::getValueForConfigAndProduct<String>(&mTable, u"@string/foo",
+ EXPECT_NE(nullptr, test::getValueForConfigAndProduct<String>(&mTable, "@string/foo",
ConfigDescription::defaultConfig(),
"phone"));
- EXPECT_NE(nullptr, test::getValueForConfigAndProduct<String>(&mTable, u"@string/foo",
+ EXPECT_NE(nullptr, test::getValueForConfigAndProduct<String>(&mTable, "@string/foo",
ConfigDescription::defaultConfig(),
"no-sdcard"));
- EXPECT_NE(nullptr, test::getValueForConfigAndProduct<String>(&mTable, u"@string/bar",
+ EXPECT_NE(nullptr, test::getValueForConfigAndProduct<String>(&mTable, "@string/bar",
ConfigDescription::defaultConfig(),
""));
- EXPECT_NE(nullptr, test::getValueForConfigAndProduct<String>(&mTable, u"@string/baz",
+ EXPECT_NE(nullptr, test::getValueForConfigAndProduct<String>(&mTable, "@string/baz",
ConfigDescription::defaultConfig(),
""));
- EXPECT_NE(nullptr, test::getValueForConfigAndProduct<String>(&mTable, u"@string/bit",
+ EXPECT_NE(nullptr, test::getValueForConfigAndProduct<String>(&mTable, "@string/bit",
ConfigDescription::defaultConfig(),
"phablet"));
- EXPECT_NE(nullptr, test::getValueForConfigAndProduct<String>(&mTable, u"@string/bot",
+ EXPECT_NE(nullptr, test::getValueForConfigAndProduct<String>(&mTable, "@string/bot",
ConfigDescription::defaultConfig(),
"default"));
}
@@ -575,7 +574,7 @@
ASSERT_TRUE(testParse(input));
Maybe<ResourceTable::SearchResult> result = mTable.findResource(
- test::parseNameOrDie(u"@attr/foo"));
+ test::parseNameOrDie("@attr/foo"));
AAPT_ASSERT_TRUE(result);
AAPT_ASSERT_TRUE(result.value().package->id);
@@ -586,7 +585,7 @@
result.value().entry->id.value());
EXPECT_EQ(ResourceId(0x01010040), actualId);
- result = mTable.findResource(test::parseNameOrDie(u"@attr/bar"));
+ result = mTable.findResource(test::parseNameOrDie("@attr/bar"));
AAPT_ASSERT_TRUE(result);
AAPT_ASSERT_TRUE(result.value().package->id);
@@ -611,7 +610,7 @@
ASSERT_TRUE(testParse(input));
Maybe<ResourceTable::SearchResult> result = mTable.findResource(
- test::parseNameOrDie(u"@string/bar"));
+ test::parseNameOrDie("@string/bar"));
AAPT_ASSERT_TRUE(result);
const ResourceEntry* entry = result.value().entry;
ASSERT_NE(nullptr, entry);
@@ -622,7 +621,7 @@
std::string input = R"EOF(<item name="foo" type="integer" format="float">0.3</item>)EOF";
ASSERT_TRUE(testParse(input));
- BinaryPrimitive* val = test::getValue<BinaryPrimitive>(&mTable, u"@integer/foo");
+ BinaryPrimitive* val = test::getValue<BinaryPrimitive>(&mTable, "@integer/foo");
ASSERT_NE(nullptr, val);
EXPECT_EQ(uint32_t(android::Res_value::TYPE_FLOAT), val->value.dataType);