summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-24 15:04:25 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-24 22:42:33 +0000
commit64ee2c3fe2a21d0471595ae486d7e55e2eadfb57 (patch)
tree8e83d144c344fe412ccaa21482c5679643ed3a54 /core
parent39b83dd0ce7d828f6a17a2e6529ceb5ffc819207 (diff)
downloadpdfium-64ee2c3fe2a21d0471595ae486d7e55e2eadfb57.tar.xz
Use a pdfium-specific unittest main rather than gtest's
We must initialize our partition allocator before calling into any test cases. We can then remove the FPDF_Test class, which did the same thing. Change-Id: I614480fa474b2032052857a02e94781f15a27a4e Reviewed-on: https://pdfium-review.googlesource.com/4473 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp4
-rw-r--r--core/fxcrt/xml/cfx_saxreader_unittest.cpp2
-rw-r--r--core/fxcrt/xml/cfx_xmlsyntaxparser_unittest.cpp34
3 files changed, 18 insertions, 22 deletions
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp
index fdf31243b7..b08dd8a852 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp
@@ -17,16 +17,14 @@
#include "testing/test_support.h"
#include "third_party/base/ptr_util.h"
-class CPDF_PageContentGeneratorTest : public pdfium::FPDF_Test {
+class CPDF_PageContentGeneratorTest : public testing::Test {
protected:
void SetUp() override {
- FPDF_Test::SetUp();
CPDF_ModuleMgr::Get()->InitPageModule();
}
void TearDown() override {
CPDF_ModuleMgr::Destroy();
- FPDF_Test::TearDown();
}
void TestProcessPath(CPDF_PageContentGenerator* pGen,
diff --git a/core/fxcrt/xml/cfx_saxreader_unittest.cpp b/core/fxcrt/xml/cfx_saxreader_unittest.cpp
index 0bb5e1a066..dca93b3a16 100644
--- a/core/fxcrt/xml/cfx_saxreader_unittest.cpp
+++ b/core/fxcrt/xml/cfx_saxreader_unittest.cpp
@@ -44,7 +44,7 @@ class MockHandler : public CFX_SAXReader::HandlerIface {
} // namespace
-class CFX_SAXReaderTest : public pdfium::FPDF_Test {
+class CFX_SAXReaderTest : public testing::Test {
public:
void SetHandler(CFX_SAXReader::HandlerIface* handler) {
reader_.SetHandler(handler);
diff --git a/core/fxcrt/xml/cfx_xmlsyntaxparser_unittest.cpp b/core/fxcrt/xml/cfx_xmlsyntaxparser_unittest.cpp
index 09d4fea2d2..c3cc3d26bf 100644
--- a/core/fxcrt/xml/cfx_xmlsyntaxparser_unittest.cpp
+++ b/core/fxcrt/xml/cfx_xmlsyntaxparser_unittest.cpp
@@ -11,9 +11,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/test_support.h"
-class CFX_XMLSyntaxParserTest : public pdfium::FPDF_Test {};
-
-TEST_F(CFX_XMLSyntaxParserTest, CData) {
+TEST(CFX_XMLSyntaxParserTest, CData) {
const char* input =
"<script contentType=\"application/x-javascript\">\n"
" <![CDATA[\n"
@@ -59,7 +57,7 @@ TEST_F(CFX_XMLSyntaxParserTest, CData) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, CDataWithInnerScript) {
+TEST(CFX_XMLSyntaxParserTest, CDataWithInnerScript) {
const char* input =
"<script contentType=\"application/x-javascript\">\n"
" <![CDATA[\n"
@@ -107,7 +105,7 @@ TEST_F(CFX_XMLSyntaxParserTest, CDataWithInnerScript) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, ArrowBangArrow) {
+TEST(CFX_XMLSyntaxParserTest, ArrowBangArrow) {
const char* input =
"<script contentType=\"application/x-javascript\">\n"
" <!>\n"
@@ -142,7 +140,7 @@ TEST_F(CFX_XMLSyntaxParserTest, ArrowBangArrow) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, ArrowBangBracketArrow) {
+TEST(CFX_XMLSyntaxParserTest, ArrowBangBracketArrow) {
const char* input =
"<script contentType=\"application/x-javascript\">\n"
" <![>\n"
@@ -172,7 +170,7 @@ TEST_F(CFX_XMLSyntaxParserTest, ArrowBangBracketArrow) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, IncompleteCData) {
+TEST(CFX_XMLSyntaxParserTest, IncompleteCData) {
const char* input =
"<script contentType=\"application/x-javascript\">\n"
" <![CDATA>\n"
@@ -202,7 +200,7 @@ TEST_F(CFX_XMLSyntaxParserTest, IncompleteCData) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, UnClosedCData) {
+TEST(CFX_XMLSyntaxParserTest, UnClosedCData) {
const char* input =
"<script contentType=\"application/x-javascript\">\n"
" <![CDATA[\n"
@@ -232,7 +230,7 @@ TEST_F(CFX_XMLSyntaxParserTest, UnClosedCData) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, EmptyCData) {
+TEST(CFX_XMLSyntaxParserTest, EmptyCData) {
const char* input =
"<script contentType=\"application/x-javascript\">\n"
" <![CDATA[]]>\n"
@@ -269,7 +267,7 @@ TEST_F(CFX_XMLSyntaxParserTest, EmptyCData) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, Comment) {
+TEST(CFX_XMLSyntaxParserTest, Comment) {
const char* input =
"<script contentType=\"application/x-javascript\">\n"
" <!-- A Comment -->\n"
@@ -303,7 +301,7 @@ TEST_F(CFX_XMLSyntaxParserTest, Comment) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, IncorrectCommentStart) {
+TEST(CFX_XMLSyntaxParserTest, IncorrectCommentStart) {
const char* input =
"<script contentType=\"application/x-javascript\">\n"
" <!- A Comment -->\n"
@@ -337,7 +335,7 @@ TEST_F(CFX_XMLSyntaxParserTest, IncorrectCommentStart) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, CommentEmpty) {
+TEST(CFX_XMLSyntaxParserTest, CommentEmpty) {
const char* input =
"<script contentType=\"application/x-javascript\">\n"
" <!---->\n"
@@ -371,7 +369,7 @@ TEST_F(CFX_XMLSyntaxParserTest, CommentEmpty) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, CommentThreeDash) {
+TEST(CFX_XMLSyntaxParserTest, CommentThreeDash) {
const char* input =
"<script contentType=\"application/x-javascript\">\n"
" <!--->\n"
@@ -399,7 +397,7 @@ TEST_F(CFX_XMLSyntaxParserTest, CommentThreeDash) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, CommentTwoDash) {
+TEST(CFX_XMLSyntaxParserTest, CommentTwoDash) {
const char* input =
"<script contentType=\"application/x-javascript\">\n"
" <!-->\n"
@@ -427,7 +425,7 @@ TEST_F(CFX_XMLSyntaxParserTest, CommentTwoDash) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, Entities) {
+TEST(CFX_XMLSyntaxParserTest, Entities) {
const char* input =
"<script contentType=\"application/x-javascript\">"
"&#66;"
@@ -462,7 +460,7 @@ TEST_F(CFX_XMLSyntaxParserTest, Entities) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, EntityOverflowHex) {
+TEST(CFX_XMLSyntaxParserTest, EntityOverflowHex) {
const char* input =
"<script contentType=\"application/x-javascript\">"
"&#xaDBDFFFFF;"
@@ -494,7 +492,7 @@ TEST_F(CFX_XMLSyntaxParserTest, EntityOverflowHex) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, EntityOverflowDecimal) {
+TEST(CFX_XMLSyntaxParserTest, EntityOverflowDecimal) {
const char* input =
"<script contentType=\"application/x-javascript\">"
"&#2914910205;"
@@ -526,7 +524,7 @@ TEST_F(CFX_XMLSyntaxParserTest, EntityOverflowDecimal) {
ASSERT_EQ(FX_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse());
}
-TEST_F(CFX_XMLSyntaxParserTest, IsXMLNameChar) {
+TEST(CFX_XMLSyntaxParserTest, IsXMLNameChar) {
EXPECT_FALSE(CFX_XMLSyntaxParser::IsXMLNameChar(L'-', true));
EXPECT_TRUE(CFX_XMLSyntaxParser::IsXMLNameChar(L'-', false));