summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_xmlelement_unittest.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-07-26 19:34:26 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-26 19:34:26 +0000
commitc9171e16d9d4477501d326d8d456fdc03e0f832e (patch)
tree89a91af4803e820b2e7f8c6e9901915c3415d72c /core/fxcrt/xml/cfx_xmlelement_unittest.cpp
parentea360af9048e7083107f9e27f8967351df241f70 (diff)
downloadpdfium-c9171e16d9d4477501d326d8d456fdc03e0f832e.tar.xz
Use moar ToXMLElement() in place of static_cast<>.
Introduces checks in a few new places, but mainly just consolidates checking/casting logic. Change-Id: I634a03060d254db099972c6978249992367e146c Reviewed-on: https://pdfium-review.googlesource.com/38900 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcrt/xml/cfx_xmlelement_unittest.cpp')
-rw-r--r--core/fxcrt/xml/cfx_xmlelement_unittest.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/core/fxcrt/xml/cfx_xmlelement_unittest.cpp b/core/fxcrt/xml/cfx_xmlelement_unittest.cpp
index 1e53ef3dd7..dfc60a10c3 100644
--- a/core/fxcrt/xml/cfx_xmlelement_unittest.cpp
+++ b/core/fxcrt/xml/cfx_xmlelement_unittest.cpp
@@ -73,7 +73,6 @@ TEST(CFX_XMLElementTest, Attributes) {
TEST(CFX_XMLElementTest, Clone) {
CFX_XMLDocument doc;
-
CFX_XMLElement node(L"test:node");
node.SetAttribute(L"first", L"one");
node.SetAttribute(L"second", L"two");
@@ -87,10 +86,9 @@ TEST(CFX_XMLElementTest, Clone) {
CFX_XMLNode* clone = node.Clone(&doc);
EXPECT_TRUE(clone != nullptr);
-
ASSERT_EQ(FX_XMLNODE_Element, clone->GetType());
- CFX_XMLElement* inst = static_cast<CFX_XMLElement*>(clone);
+ CFX_XMLElement* inst = ToXMLElement(clone);
EXPECT_EQ(L"test:node", inst->GetName());
EXPECT_EQ(L"node", inst->GetLocalTagName());
EXPECT_EQ(L"test", inst->GetNamespacePrefix());