summaryrefslogtreecommitdiff
path: root/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
diff options
context:
space:
mode:
authorChris Palmer <palmer@chromium.org>2017-04-06 14:45:39 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-06 23:40:27 +0000
commit2b797295d6851b3189bcb38c5994074f36453865 (patch)
tree90f119d1b1bff860e265c13919e19410282b6bda /xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
parent8a24b25ee0b08128b28dfae0ee86b8348a51b40b (diff)
downloadpdfium-2b797295d6851b3189bcb38c5994074f36453865.tar.xz
Fix unit tests to initialize PartitionAlloc.
Tests need to be subclasses of FPDF_Test. BUG=pdfium:700 Change-Id: I317ec2c49567e58cb57c6222e387574226f594b3 Reviewed-on: https://pdfium-review.googlesource.com/3890 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Chris Palmer <palmer@chromium.org>
Diffstat (limited to 'xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp')
-rw-r--r--xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp b/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
index e54b2cecaf..66f4bbf928 100644
--- a/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
+++ b/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp
@@ -7,9 +7,12 @@
#include <memory>
#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/test_support.h"
#include "xfa/fgas/crt/ifgas_stream.h"
-TEST(CFDE_XMLSyntaxParser, CData) {
+class CFDE_XMLSyntaxParserTest : public pdfium::FPDF_Test {};
+
+TEST_F(CFDE_XMLSyntaxParserTest, CData) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">\n"
L" <![CDATA[\n"
@@ -54,7 +57,7 @@ TEST(CFDE_XMLSyntaxParser, CData) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, CDataWithInnerScript) {
+TEST_F(CFDE_XMLSyntaxParserTest, CDataWithInnerScript) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">\n"
L" <![CDATA[\n"
@@ -101,7 +104,7 @@ TEST(CFDE_XMLSyntaxParser, CDataWithInnerScript) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, ArrowBangArrow) {
+TEST_F(CFDE_XMLSyntaxParserTest, ArrowBangArrow) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">\n"
L" <!>\n"
@@ -135,7 +138,7 @@ TEST(CFDE_XMLSyntaxParser, ArrowBangArrow) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, ArrowBangBracketArrow) {
+TEST_F(CFDE_XMLSyntaxParserTest, ArrowBangBracketArrow) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">\n"
L" <![>\n"
@@ -164,7 +167,7 @@ TEST(CFDE_XMLSyntaxParser, ArrowBangBracketArrow) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, IncompleteCData) {
+TEST_F(CFDE_XMLSyntaxParserTest, IncompleteCData) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">\n"
L" <![CDATA>\n"
@@ -193,7 +196,7 @@ TEST(CFDE_XMLSyntaxParser, IncompleteCData) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, UnClosedCData) {
+TEST_F(CFDE_XMLSyntaxParserTest, UnClosedCData) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">\n"
L" <![CDATA[\n"
@@ -222,7 +225,7 @@ TEST(CFDE_XMLSyntaxParser, UnClosedCData) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, EmptyCData) {
+TEST_F(CFDE_XMLSyntaxParserTest, EmptyCData) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">\n"
L" <![CDATA[]]>\n"
@@ -258,7 +261,7 @@ TEST(CFDE_XMLSyntaxParser, EmptyCData) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, Comment) {
+TEST_F(CFDE_XMLSyntaxParserTest, Comment) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">\n"
L" <!-- A Comment -->\n"
@@ -291,7 +294,7 @@ TEST(CFDE_XMLSyntaxParser, Comment) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, IncorrectCommentStart) {
+TEST_F(CFDE_XMLSyntaxParserTest, IncorrectCommentStart) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">\n"
L" <!- A Comment -->\n"
@@ -324,7 +327,7 @@ TEST(CFDE_XMLSyntaxParser, IncorrectCommentStart) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, CommentEmpty) {
+TEST_F(CFDE_XMLSyntaxParserTest, CommentEmpty) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">\n"
L" <!---->\n"
@@ -357,7 +360,7 @@ TEST(CFDE_XMLSyntaxParser, CommentEmpty) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, CommentThreeDash) {
+TEST_F(CFDE_XMLSyntaxParserTest, CommentThreeDash) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">\n"
L" <!--->\n"
@@ -384,7 +387,7 @@ TEST(CFDE_XMLSyntaxParser, CommentThreeDash) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, CommentTwoDash) {
+TEST_F(CFDE_XMLSyntaxParserTest, CommentTwoDash) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">\n"
L" <!-->\n"
@@ -411,7 +414,7 @@ TEST(CFDE_XMLSyntaxParser, CommentTwoDash) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, Entities) {
+TEST_F(CFDE_XMLSyntaxParserTest, Entities) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">"
L"&#66;"
@@ -445,7 +448,7 @@ TEST(CFDE_XMLSyntaxParser, Entities) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, EntityOverflowHex) {
+TEST_F(CFDE_XMLSyntaxParserTest, EntityOverflowHex) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">"
L"&#xaDBDFFFFF;"
@@ -476,7 +479,7 @@ TEST(CFDE_XMLSyntaxParser, EntityOverflowHex) {
EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST(CFDE_XMLSyntaxParser, EntityOverflowDecimal) {
+TEST_F(CFDE_XMLSyntaxParserTest, EntityOverflowDecimal) {
const wchar_t* input =
L"<script contentType=\"application/x-javascript\">"
L"&#2914910205;"