diff options
author | Adam Lesinski <adamlesinski@google.com> | 2016-07-08 15:00:32 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2016-07-13 17:45:28 -0700 |
commit | d0f116b619feede0cfdb647157ce5ab4d50a1c46 (patch) | |
tree | 5b2a8663602ba2b267890ff85d3cf5618ac922b5 /tools/aapt2/xml/XmlUtil_test.cpp | |
parent | aaac91f4a00a9968ef107ea143e6f2f669f762f1 (diff) |
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
Diffstat (limited to 'tools/aapt2/xml/XmlUtil_test.cpp')
-rw-r--r-- | tools/aapt2/xml/XmlUtil_test.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/tools/aapt2/xml/XmlUtil_test.cpp b/tools/aapt2/xml/XmlUtil_test.cpp index 319e7707d874..cbeb8bcda9e0 100644 --- a/tools/aapt2/xml/XmlUtil_test.cpp +++ b/tools/aapt2/xml/XmlUtil_test.cpp @@ -14,40 +14,37 @@ * limitations under the License. */ -#include "test/Common.h" +#include "test/Test.h" #include "xml/XmlUtil.h" -#include <gtest/gtest.h> - namespace aapt { TEST(XmlUtilTest, ExtractPackageFromNamespace) { - AAPT_ASSERT_FALSE(xml::extractPackageFromNamespace(u"com.android")); - AAPT_ASSERT_FALSE(xml::extractPackageFromNamespace(u"http://schemas.android.com/apk")); - AAPT_ASSERT_FALSE(xml::extractPackageFromNamespace(u"http://schemas.android.com/apk/res")); - AAPT_ASSERT_FALSE(xml::extractPackageFromNamespace(u"http://schemas.android.com/apk/res/")); - AAPT_ASSERT_FALSE(xml::extractPackageFromNamespace( - u"http://schemas.android.com/apk/prv/res/")); + AAPT_ASSERT_FALSE(xml::extractPackageFromNamespace("com.android")); + AAPT_ASSERT_FALSE(xml::extractPackageFromNamespace("http://schemas.android.com/apk")); + AAPT_ASSERT_FALSE(xml::extractPackageFromNamespace("http://schemas.android.com/apk/res")); + AAPT_ASSERT_FALSE(xml::extractPackageFromNamespace("http://schemas.android.com/apk/res/")); + AAPT_ASSERT_FALSE(xml::extractPackageFromNamespace("http://schemas.android.com/apk/prv/res/")); Maybe<xml::ExtractedPackage> p = - xml::extractPackageFromNamespace(u"http://schemas.android.com/apk/res/a"); + xml::extractPackageFromNamespace("http://schemas.android.com/apk/res/a"); AAPT_ASSERT_TRUE(p); - EXPECT_EQ(std::u16string(u"a"), p.value().package); + EXPECT_EQ(std::string("a"), p.value().package); EXPECT_FALSE(p.value().privateNamespace); - p = xml::extractPackageFromNamespace(u"http://schemas.android.com/apk/prv/res/android"); + p = xml::extractPackageFromNamespace("http://schemas.android.com/apk/prv/res/android"); AAPT_ASSERT_TRUE(p); - EXPECT_EQ(std::u16string(u"android"), p.value().package); + EXPECT_EQ(std::string("android"), p.value().package); EXPECT_TRUE(p.value().privateNamespace); - p = xml::extractPackageFromNamespace(u"http://schemas.android.com/apk/prv/res/com.test"); + p = xml::extractPackageFromNamespace("http://schemas.android.com/apk/prv/res/com.test"); AAPT_ASSERT_TRUE(p); - EXPECT_EQ(std::u16string(u"com.test"), p.value().package); + EXPECT_EQ(std::string("com.test"), p.value().package); EXPECT_TRUE(p.value().privateNamespace); - p = xml::extractPackageFromNamespace(u"http://schemas.android.com/apk/res-auto"); + p = xml::extractPackageFromNamespace("http://schemas.android.com/apk/res-auto"); AAPT_ASSERT_TRUE(p); - EXPECT_EQ(std::u16string(), p.value().package); + EXPECT_EQ(std::string(), p.value().package); EXPECT_TRUE(p.value().privateNamespace); } |