aboutsummaryrefslogtreecommitdiff
path: root/test/xml/ParserTest.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-03-05 21:45:33 +0800
committercrupest <crupest@outlook.com>2022-03-05 21:45:33 +0800
commit7697f1ca3904301e551e7500089b30034e84eb32 (patch)
tree2f9e763d96df0679ea3582721f5a109750694d9b /test/xml/ParserTest.cpp
parent221f9cd7e453f2968c12a14a46588ea50ca2119d (diff)
downloadcru-7697f1ca3904301e551e7500089b30034e84eb32.tar.gz
cru-7697f1ca3904301e551e7500089b30034e84eb32.tar.bz2
cru-7697f1ca3904301e551e7500089b30034e84eb32.zip
...
Diffstat (limited to 'test/xml/ParserTest.cpp')
-rw-r--r--test/xml/ParserTest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/xml/ParserTest.cpp b/test/xml/ParserTest.cpp
index 06536bfa..8edebeb6 100644
--- a/test/xml/ParserTest.cpp
+++ b/test/xml/ParserTest.cpp
@@ -18,8 +18,8 @@ TEST(CruXmlParserTest, SimpleWithAttribute) {
XmlParser parser(u"<root a1=\"v1\" a2=\"v2\"></root>");
auto n = parser.Parse();
ASSERT_EQ(n->GetTag(), u"root");
- ASSERT_EQ(n->GetAttribute(u"a1"), u"v1");
- ASSERT_EQ(n->GetAttribute(u"a2"), u"v2");
+ ASSERT_EQ(n->GetAttributeValue(u"a1"), u"v1");
+ ASSERT_EQ(n->GetAttributeValue(u"a2"), u"v2");
ASSERT_EQ(n->GetChildCount(), 0);
delete n;
}
@@ -28,8 +28,8 @@ TEST(CruXmlParserTest, SimpleSelfClosing) {
XmlParser parser(u"<root a1=\"v1\" a2=\"v2\"/>");
auto n = parser.Parse();
ASSERT_EQ(n->GetTag(), u"root");
- ASSERT_EQ(n->GetAttribute(u"a1"), u"v1");
- ASSERT_EQ(n->GetAttribute(u"a2"), u"v2");
+ ASSERT_EQ(n->GetAttributeValue(u"a1"), u"v1");
+ ASSERT_EQ(n->GetAttributeValue(u"a2"), u"v2");
ASSERT_EQ(n->GetChildCount(), 0);
delete n;
}
@@ -95,18 +95,18 @@ TEST(CruXmlParserTest, Complex) {
</root>
)");
auto n = parser.Parse();
- ASSERT_EQ(n->GetAttribute(u"a1"), u"v1");
+ ASSERT_EQ(n->GetAttributeValue(u"a1"), u"v1");
ASSERT_EQ(n->GetChildCount(), 3);
ASSERT_EQ(n->GetChildAt(0)->AsElement()->GetTag(), u"c1");
ASSERT_EQ(n->GetChildAt(0)->AsElement()->GetChildCount(), 1);
auto c2 = n->GetChildAt(1)->AsElement();
ASSERT_EQ(c2->GetTag(), u"c2");
- ASSERT_EQ(c2->GetAttribute(u"a2"), u"v2");
- ASSERT_EQ(c2->GetAttribute(u"a3"), u"v3");
+ ASSERT_EQ(c2->GetAttributeValue(u"a2"), u"v2");
+ ASSERT_EQ(c2->GetAttributeValue(u"a3"), u"v3");
ASSERT_EQ(c2->GetChildAt(0)->AsText()->GetText(), u"t1");
auto d2 = c2->GetChildAt(1)->AsElement();
ASSERT_EQ(d2->GetTag(), u"d2");
- ASSERT_EQ(d2->GetAttribute(u"a4"), u"v4");
+ ASSERT_EQ(d2->GetAttributeValue(u"a4"), u"v4");
ASSERT_EQ(c2->GetChildAt(2)->AsText()->GetText(), u"text test");
ASSERT_EQ(c2->GetChildAt(3)->AsElement()->GetTag(), u"d3");
ASSERT_EQ(c2->GetChildAt(4)->AsText()->GetText(), u"t2");