diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-03-05 21:04:51 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-03-05 21:04:51 +0000 |
commit | 406b23d9350777514e499cefdc080212de596e8d (patch) | |
tree | 9d9e1c7e7719f29e400bbd72fb83306ad9f1b58f /xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp | |
parent | 31e08d1d6db10d22c1ba9f3f68773f8a88f05e3b (diff) | |
download | pdfium-406b23d9350777514e499cefdc080212de596e8d.tar.xz |
[formcalc] Cleanup m_error handling
This CL cleans up the setting of m_error. In most cases we don't need to
set m_error it will be set when we bubble up the nullptr return from the
various parse methods.
The m_error was set inconsitently previously and was confusing on if it
needed to be set or not.
Change-Id: I8648b6296ef15239bd2663e6543a960b88177721
Reviewed-on: https://pdfium-review.googlesource.com/27910
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp')
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp b/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp index a7f7006fcc..d1e5919324 100644 --- a/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp +++ b/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp @@ -15,7 +15,7 @@ TEST(CXFA_FMParserTest, Empty) { auto parser = pdfium::MakeUnique<CXFA_FMParser>(L""); std::unique_ptr<CXFA_FMAST> ast = parser->Parse(); - ASSERT(ast != nullptr); + ASSERT_TRUE(ast); EXPECT_FALSE(parser->HasError()); CXFA_FMToJavaScriptDepth::Reset(); @@ -28,7 +28,7 @@ TEST(CXFA_FMParserTest, Empty) { TEST(CXFA_FMParserTest, CommentOnlyIsError) { auto parser = pdfium::MakeUnique<CXFA_FMParser>(L"; Just comment"); std::unique_ptr<CXFA_FMAST> ast = parser->Parse(); - ASSERT(ast != nullptr); + ASSERT_TRUE(ast); // TODO(dsinclair): This isn't allowed per the spec. EXPECT_FALSE(parser->HasError()); // EXPECT_TRUE(parser->HasError()); @@ -49,7 +49,7 @@ TEST(CXFA_FMParserTest, CommentThenValue) { auto parser = pdfium::MakeUnique<CXFA_FMParser>(L"; Just comment\n12"); std::unique_ptr<CXFA_FMAST> ast = parser->Parse(); - ASSERT(ast != nullptr); + ASSERT_TRUE(ast); EXPECT_FALSE(parser->HasError()); CXFA_FMToJavaScriptDepth::Reset(); @@ -118,7 +118,7 @@ TEST(CXFA_FMParserTest, Parse) { auto parser = pdfium::MakeUnique<CXFA_FMParser>(input); std::unique_ptr<CXFA_FMAST> ast = parser->Parse(); - ASSERT(ast != nullptr); + ASSERT_TRUE(ast); EXPECT_FALSE(parser->HasError()); CXFA_FMToJavaScriptDepth::Reset(); @@ -147,7 +147,7 @@ TEST(CXFA_FMParserTest, MultipleAssignmentIsNotAllowed) { auto parser = pdfium::MakeUnique<CXFA_FMParser>(L"(a=(b=t))=u"); std::unique_ptr<CXFA_FMAST> ast = parser->Parse(); - ASSERT(ast == nullptr); + ASSERT_TRUE(!ast); EXPECT_TRUE(parser->HasError()); } @@ -170,7 +170,7 @@ TEST(CXFA_FMParserTest, ParseFuncWithParams) { auto parser = pdfium::MakeUnique<CXFA_FMParser>(input); std::unique_ptr<CXFA_FMAST> ast = parser->Parse(); - ASSERT(ast != nullptr); + ASSERT_TRUE(ast); EXPECT_FALSE(parser->HasError()); CXFA_FMToJavaScriptDepth::Reset(); @@ -198,7 +198,7 @@ TEST(CXFA_FMParserTest, ParseFuncWithoutParams) { auto parser = pdfium::MakeUnique<CXFA_FMParser>(input); std::unique_ptr<CXFA_FMAST> ast = parser->Parse(); - ASSERT(ast != nullptr); + ASSERT_TRUE(ast); EXPECT_FALSE(parser->HasError()); CXFA_FMToJavaScriptDepth::Reset(); |