diff options
author | dan sinclair <dsinclair@chromium.org> | 2017-05-17 22:17:34 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-18 15:27:37 +0000 |
commit | 2034b941dfa07d30c286bfcceffd6904740ac446 (patch) | |
tree | 1bc3c9be4d3108b53ced4db9837187dddf6df88d /xfa/fxfa/fm2js/cxfa_fmparse_unittest.cpp | |
parent | cfd56852b6375d2b4eea473399231caf7dcdbf36 (diff) | |
download | pdfium-2034b941dfa07d30c286bfcceffd6904740ac446.tar.xz |
Remove CXFA_FMErrorInfo
This Cl removes the CXFA_FMErrorInfo class. The message was never output, just
used as a flag to determine if there was an error. The class has been replaced
with a boolean.
Change-Id: I1cde99ce6957f5f8c6be0755a198d80ec8378b3a
Reviewed-on: https://pdfium-review.googlesource.com/5653
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmparse_unittest.cpp')
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmparse_unittest.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmparse_unittest.cpp b/xfa/fxfa/fm2js/cxfa_fmparse_unittest.cpp index c98cd227ce..9e6972b356 100644 --- a/xfa/fxfa/fm2js/cxfa_fmparse_unittest.cpp +++ b/xfa/fxfa/fm2js/cxfa_fmparse_unittest.cpp @@ -11,11 +11,10 @@ #include "third_party/base/ptr_util.h" TEST(CXFA_FMParseTest, Empty) { - CXFA_FMErrorInfo errorInfo; - auto parser = pdfium::MakeUnique<CXFA_FMParse>(L"", &errorInfo); + auto parser = pdfium::MakeUnique<CXFA_FMParse>(L""); std::unique_ptr<CXFA_FMFunctionDefinition> ast = parser->Parse(); ASSERT(ast != nullptr); - EXPECT_TRUE(errorInfo.message.IsEmpty()); + EXPECT_FALSE(parser->HasError()); CFX_WideTextBuf buf; EXPECT_TRUE(ast->ToJavaScript(buf)); @@ -24,13 +23,12 @@ TEST(CXFA_FMParseTest, Empty) { } TEST(CXFA_FMParseTest, CommentOnlyIsError) { - CXFA_FMErrorInfo errorInfo; - auto parser = pdfium::MakeUnique<CXFA_FMParse>(L"; Just comment", &errorInfo); + auto parser = pdfium::MakeUnique<CXFA_FMParse>(L"; Just comment"); std::unique_ptr<CXFA_FMFunctionDefinition> ast = parser->Parse(); ASSERT(ast != nullptr); // TODO(dsinclair): This isn't allowed per the spec. - EXPECT_TRUE(errorInfo.message.IsEmpty()); - // EXPECT_FALSE(errorInfo.message.IsEmpty()); + EXPECT_FALSE(parser->HasError()); + // EXPECT_TRUE(parser->HasError()); CFX_WideTextBuf buf; EXPECT_TRUE(ast->ToJavaScript(buf)); @@ -45,12 +43,10 @@ TEST(CXFA_FMParseTest, CommentThenValue) { L"return pfm_rt.get_val(pfm_ret);\n" L"}\n).call(this);\n"; - CXFA_FMErrorInfo errorInfo; - auto parser = - pdfium::MakeUnique<CXFA_FMParse>(L"; Just comment\n12", &errorInfo); + auto parser = pdfium::MakeUnique<CXFA_FMParse>(L"; Just comment\n12"); std::unique_ptr<CXFA_FMFunctionDefinition> ast = parser->Parse(); ASSERT(ast != nullptr); - EXPECT_TRUE(errorInfo.message.IsEmpty()); + EXPECT_FALSE(parser->HasError()); CFX_WideTextBuf buf; EXPECT_TRUE(ast->ToJavaScript(buf)); @@ -101,11 +97,10 @@ TEST(CXFA_FMParseTest, Parse) { L"return pfm_rt.get_val(pfm_ret);\n" L"}\n).call(this);\n"; - CXFA_FMErrorInfo errorInfo; - auto parser = pdfium::MakeUnique<CXFA_FMParse>(input, &errorInfo); + auto parser = pdfium::MakeUnique<CXFA_FMParse>(input); std::unique_ptr<CXFA_FMFunctionDefinition> ast = parser->Parse(); ASSERT(ast != nullptr); - EXPECT_TRUE(errorInfo.message.IsEmpty()); + EXPECT_FALSE(parser->HasError()); CFX_WideTextBuf buf; EXPECT_TRUE(ast->ToJavaScript(buf)); |