diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-05-16 15:28:15 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-16 15:28:15 +0000 |
commit | adbf41e6bfdf05ed514c561ea7926f45ae02b06c (patch) | |
tree | 7b6cf65121d133594bb833adcf9e599ad27cc8fe /xfa/fxfa/fm2js/cxfa_fmsimpleexpression_unittest.cpp | |
parent | 99a046acd2d1ce1f093937642b6a9165f8f41986 (diff) | |
download | pdfium-adbf41e6bfdf05ed514c561ea7926f45ae02b06c.tar.xz |
Convert Formcalc ToJavascript to a pointer WideTextBuf
This CL converts the WidetextBuf reference to a pointer in the formcalc
ToJavaScript methods.
Change-Id: Ia05c7255a99a2eaa3d9a57f77580969896ad90a0
Reviewed-on: https://pdfium-review.googlesource.com/32612
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmsimpleexpression_unittest.cpp')
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmsimpleexpression_unittest.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmsimpleexpression_unittest.cpp b/xfa/fxfa/fm2js/cxfa_fmsimpleexpression_unittest.cpp index 3ff2b411f9..e5f78aaa56 100644 --- a/xfa/fxfa/fm2js/cxfa_fmsimpleexpression_unittest.cpp +++ b/xfa/fxfa/fm2js/cxfa_fmsimpleexpression_unittest.cpp @@ -27,7 +27,7 @@ TEST(FMCallExpressionTest, more_than_32_arguments) { CXFA_FMCallExpression callExp(std::move(exp), std::move(args), true); CFX_WideTextBuf js; - callExp.ToJavaScript(js, ReturnType::kInfered); + callExp.ToJavaScript(&js, ReturnType::kInfered); // Generate the result javascript string. WideString result = L"sign("; @@ -50,21 +50,22 @@ TEST(FMCallExpressionTest, more_than_32_arguments) { TEST(FMStringExpressionTest, Empty) { CXFA_FMToJavaScriptDepth::Reset(); CFX_WideTextBuf accumulator; - CXFA_FMStringExpression(L"").ToJavaScript(accumulator, ReturnType::kInfered); + CXFA_FMStringExpression(L"").ToJavaScript(&accumulator, ReturnType::kInfered); EXPECT_EQ(L"", accumulator.AsStringView()); } TEST(FMStringExpressionTest, Short) { CXFA_FMToJavaScriptDepth::Reset(); CFX_WideTextBuf accumulator; - CXFA_FMStringExpression(L"a").ToJavaScript(accumulator, ReturnType::kInfered); + CXFA_FMStringExpression(L"a").ToJavaScript(&accumulator, + ReturnType::kInfered); EXPECT_EQ(L"a", accumulator.AsStringView()); } TEST(FMStringExpressionTest, Medium) { CXFA_FMToJavaScriptDepth::Reset(); CFX_WideTextBuf accumulator; - CXFA_FMStringExpression(L".abcd.").ToJavaScript(accumulator, + CXFA_FMStringExpression(L".abcd.").ToJavaScript(&accumulator, ReturnType::kInfered); EXPECT_EQ(L"\"abcd\"", accumulator.AsStringView()); } @@ -74,7 +75,7 @@ TEST(FMStringExpressionTest, Long) { CFX_WideTextBuf accumulator; std::vector<WideStringView::UnsignedType> vec(140000, L'A'); CXFA_FMStringExpression(WideStringView(vec)) - .ToJavaScript(accumulator, ReturnType::kInfered); + .ToJavaScript(&accumulator, ReturnType::kInfered); EXPECT_EQ(140000u, accumulator.GetLength()); } @@ -82,6 +83,6 @@ TEST(FMStringExpressionTest, Quoted) { CXFA_FMToJavaScriptDepth::Reset(); CFX_WideTextBuf accumulator; CXFA_FMStringExpression(L".Simon says \"\"run\"\".") - .ToJavaScript(accumulator, ReturnType::kInfered); + .ToJavaScript(&accumulator, ReturnType::kInfered); EXPECT_EQ(L"\"Simon says \\\"run\\\"\"", accumulator.AsStringView()); } |