diff options
author | Chris Palmer <palmer@chromium.org> | 2017-04-06 14:45:39 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-06 23:40:27 +0000 |
commit | 2b797295d6851b3189bcb38c5994074f36453865 (patch) | |
tree | 90f119d1b1bff860e265c13919e19410282b6bda /xfa/fxfa | |
parent | 8a24b25ee0b08128b28dfae0ee86b8348a51b40b (diff) | |
download | pdfium-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/fxfa')
-rw-r--r-- | xfa/fxfa/cxfa_ffapp_unittest.cpp (renamed from xfa/fxfa/cxfa_ffapp_unitest.cpp) | 9 | ||||
-rw-r--r-- | xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp | 5 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_utils_unittest.cpp | 7 |
3 files changed, 15 insertions, 6 deletions
diff --git a/xfa/fxfa/cxfa_ffapp_unitest.cpp b/xfa/fxfa/cxfa_ffapp_unittest.cpp index e8accdfeb2..4d65ccbb2f 100644 --- a/xfa/fxfa/cxfa_ffapp_unitest.cpp +++ b/xfa/fxfa/cxfa_ffapp_unittest.cpp @@ -11,9 +11,12 @@ #include "core/fpdfapi/parser/cpdf_stream.h" #include "core/fxcrt/fx_memory.h" #include "testing/gtest/include/gtest/gtest.h" +#include "testing/test_support.h" #include "third_party/base/ptr_util.h" -TEST(CXFAFileRead, NoStreams) { +class CXFAFileReadTest : public pdfium::FPDF_Test {}; + +TEST_F(CXFAFileReadTest, NoStreams) { std::vector<CPDF_Stream*> streams; CFX_RetainPtr<IFX_SeekableReadStream> fileread = MakeSeekableReadStream(streams); @@ -24,7 +27,7 @@ TEST(CXFAFileRead, NoStreams) { EXPECT_EQ(0xbd, output_buffer[0]); } -TEST(CXFAFileRead, EmptyStreams) { +TEST_F(CXFAFileReadTest, EmptyStreams) { std::vector<CPDF_Stream*> streams; auto stream1 = pdfium::MakeUnique<CPDF_Stream>(); streams.push_back(stream1.get()); @@ -37,7 +40,7 @@ TEST(CXFAFileRead, EmptyStreams) { EXPECT_EQ(0xbd, output_buffer[0]); } -TEST(CXFAFileRead, NormalStreams) { +TEST_F(CXFAFileReadTest, NormalStreams) { std::vector<CPDF_Stream*> streams; auto stream1 = pdfium::MakeUnique<CPDF_Stream>(); auto stream2 = pdfium::MakeUnique<CPDF_Stream>(); diff --git a/xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp b/xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp index 7826d9b53c..a2c7f1b878 100644 --- a/xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp +++ b/xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp @@ -8,10 +8,13 @@ #include <utility> #include "testing/gtest/include/gtest/gtest.h" +#include "testing/test_support.h" #include "third_party/base/ptr_util.h" #include "xfa/fxfa/fm2js/xfa_lexer.h" -TEST(FMCallExpression, more_than_32_arguments) { +class FMCallExpressionTest : public pdfium::FPDF_Test {}; + +TEST_F(FMCallExpressionTest, more_than_32_arguments) { // Use sign as it has 3 object parameters at positions 0, 5, and 6. auto exp = pdfium::MakeUnique<CXFA_FMIdentifierExpression>(0, L"sign"); diff --git a/xfa/fxfa/parser/xfa_utils_unittest.cpp b/xfa/fxfa/parser/xfa_utils_unittest.cpp index c39ed69306..e4dd09419e 100644 --- a/xfa/fxfa/parser/xfa_utils_unittest.cpp +++ b/xfa/fxfa/parser/xfa_utils_unittest.cpp @@ -8,9 +8,12 @@ #include <vector> #include "testing/gtest/include/gtest/gtest.h" +#include "testing/test_support.h" #include "third_party/base/ptr_util.h" -TEST(XfaUtilsImp, XFA_MapRotation) { +class XfaUtilsImpTest : public pdfium::FPDF_Test {}; + +TEST_F(XfaUtilsImpTest, XFA_MapRotation) { struct TestCase { int input; int expected_output; @@ -26,7 +29,7 @@ TEST(XfaUtilsImp, XFA_MapRotation) { } } -class XFANodeIteratorTest : public testing::Test { +class XFANodeIteratorTest : public pdfium::FPDF_Test { public: class Node { public: |