Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp

Issue 2530933002: Use unique pointers in CXFA_FMParse (Closed)
Patch Set: Address comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/fm2js/xfa_simpleexpression.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp
diff --git a/xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp b/xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp
index 534fc18a6fe17551c5c29dc335d5d179418dae91..d54921f99a75df04f399abae2add50f019cf0f5b 100644
--- a/xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp
+++ b/xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp
@@ -5,21 +5,21 @@
#include "xfa/fxfa/fm2js/xfa_simpleexpression.h"
#include <memory>
+#include <utility>
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/base/ptr_util.h"
#include "xfa/fxfa/fm2js/xfa_lexer.h"
TEST(FMCallExpression, more_than_32_arguments) {
// Use sign as it has 3 object parameters at positions 0, 5, and 6.
- std::unique_ptr<CXFA_FMIdentifierExpression> exp(
- new CXFA_FMIdentifierExpression(0, CFX_WideStringC(L"sign")));
+ auto exp = pdfium::MakeUnique<CXFA_FMIdentifierExpression>(0, L"sign");
- std::unique_ptr<CFX_ArrayTemplate<CXFA_FMSimpleExpression*>> args(
- new CFX_ArrayTemplate<CXFA_FMSimpleExpression*>());
+ std::vector<std::unique_ptr<CXFA_FMSimpleExpression>> args;
for (size_t i = 0; i < 50; i++)
- args->Add(new CXFA_FMSimpleExpression(0, TOKnan));
+ args.push_back(pdfium::MakeUnique<CXFA_FMSimpleExpression>(0, TOKnan));
- CXFA_FMCallExpression callExp(0, exp.release(), args.release(), true);
+ CXFA_FMCallExpression callExp(0, exp.release(), std::move(args), true);
CFX_WideTextBuf js;
callExp.ToJavaScript(js);
« no previous file with comments | « xfa/fxfa/fm2js/xfa_simpleexpression.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698