diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-02-13 20:05:26 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-13 20:05:26 +0000 |
commit | d0a6f75ffd6a760c70771cc237b843b1ac2a94ee (patch) | |
tree | 87958707fb5e7657cfd1a1e6c0c217eb0ee1f7a3 /xfa/fxfa/parser/cxfa_node_unittest.cpp | |
parent | 1e364c42c16d1688eef4c1faa9d0929564cea04f (diff) | |
download | pdfium-d0a6f75ffd6a760c70771cc237b843b1ac2a94ee.tar.xz |
Convert ASSERT to PDFIUM_IMMEDIATE_CRASH
This CL changes the ASSERTs used in CXFA_Node::InsertChild and
RemoveChild to PDFIUM_IMMEDIATE_CRASH. The ASSERTs are compiled out in
Release mode, we want to make sure we don't accidentally build invalid
node trees in Release.
Change-Id: Ic96c8ab457631d1f32d36d7d12bd5888f1cf4b0a
Reviewed-on: https://pdfium-review.googlesource.com/26431
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node_unittest.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_node_unittest.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/xfa/fxfa/parser/cxfa_node_unittest.cpp b/xfa/fxfa/parser/cxfa_node_unittest.cpp index 9afc0f254f..7c35e5d989 100644 --- a/xfa/fxfa/parser/cxfa_node_unittest.cpp +++ b/xfa/fxfa/parser/cxfa_node_unittest.cpp @@ -360,7 +360,6 @@ TEST_F(CXFANodeTest, RemoveChild) { EXPECT_EQ(nullptr, child1->GetPrevSibling()); } -#ifndef NDEBUG TEST_F(CXFANodeTest, InsertChildWithParent) { CXFA_Node* child0 = GetDoc()->CreateNode(XFA_PacketType::Form, XFA_Element::Ui); @@ -368,15 +367,15 @@ TEST_F(CXFANodeTest, InsertChildWithParent) { GetDoc()->CreateNode(XFA_PacketType::Form, XFA_Element::Ui); child0->InsertChild(-1, child1); - EXPECT_DEATH(GetNode()->InsertChild(0, child1), ""); + EXPECT_DEATH_IF_SUPPORTED(GetNode()->InsertChild(0, child1), ""); } TEST_F(CXFANodeTest, InsertNullChild) { - EXPECT_DEATH(GetNode()->InsertChild(0, nullptr), ""); + EXPECT_DEATH_IF_SUPPORTED(GetNode()->InsertChild(0, nullptr), ""); } TEST_F(CXFANodeTest, InsertBeforeWithNullChild) { - EXPECT_DEATH(GetNode()->InsertChild(nullptr, nullptr), ""); + EXPECT_DEATH_IF_SUPPORTED(GetNode()->InsertChild(nullptr, nullptr), ""); } TEST_F(CXFANodeTest, InsertBeforeWithBeforeInAnotherParent) { @@ -390,7 +389,7 @@ TEST_F(CXFANodeTest, InsertBeforeWithBeforeInAnotherParent) { CXFA_Node* child = GetDoc()->CreateNode(XFA_PacketType::Form, XFA_Element::Ui); - EXPECT_DEATH(GetNode()->InsertChild(child, child1), ""); + EXPECT_DEATH_IF_SUPPORTED(GetNode()->InsertChild(child, child1), ""); } TEST_F(CXFANodeTest, InsertBeforeWithNodeInAnotherParent) { @@ -402,11 +401,11 @@ TEST_F(CXFANodeTest, InsertBeforeWithNodeInAnotherParent) { GetDoc()->CreateNode(XFA_PacketType::Form, XFA_Element::Ui); child0->InsertChild(-1, child1); - EXPECT_DEATH(GetNode()->InsertChild(child1, nullptr), ""); + EXPECT_DEATH_IF_SUPPORTED(GetNode()->InsertChild(child1, nullptr), ""); } TEST_F(CXFANodeTest, RemoveChildNullptr) { - EXPECT_DEATH(GetNode()->RemoveChild(nullptr, false), ""); + EXPECT_DEATH_IF_SUPPORTED(GetNode()->RemoveChild(nullptr, false), ""); } TEST_F(CXFANodeTest, RemoveChildAnotherParent) { @@ -418,6 +417,5 @@ TEST_F(CXFANodeTest, RemoveChildAnotherParent) { GetDoc()->CreateNode(XFA_PacketType::Form, XFA_Element::Ui); child0->InsertChild(-1, child1); - EXPECT_DEATH(GetNode()->RemoveChild(child1, false), ""); + EXPECT_DEATH_IF_SUPPORTED(GetNode()->RemoveChild(child1, false), ""); } -#endif // NDEBUG |