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

Side by Side Diff: test/cctest/compiler/test-operator.cc

Issue 2173403002: Replace SmartArrayPointer<T> with unique_ptr<T[]> (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 5 months 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 unified diff | Download patch
« no previous file with comments | « src/wasm/wasm-result.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <memory>
5 #include <sstream> 6 #include <sstream>
6 7
7 #include "src/compiler/operator.h" 8 #include "src/compiler/operator.h"
8 #include "test/cctest/cctest.h" 9 #include "test/cctest/cctest.h"
9 10
10 namespace v8 { 11 namespace v8 {
11 namespace internal { 12 namespace internal {
12 namespace compiler { 13 namespace compiler {
13 14
14 #define NONE Operator::kNoProperties 15 #define NONE Operator::kNoProperties
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 CHECK(!op1a.Equals(&op2b)); 61 CHECK(!op1a.Equals(&op2b));
61 CHECK(!op1b.Equals(&op2a)); 62 CHECK(!op1b.Equals(&op2a));
62 CHECK(!op1b.Equals(&op2b)); 63 CHECK(!op1b.Equals(&op2b));
63 64
64 CHECK(!op2a.Equals(&op1a)); 65 CHECK(!op2a.Equals(&op1a));
65 CHECK(!op2a.Equals(&op1b)); 66 CHECK(!op2a.Equals(&op1b));
66 CHECK(!op2b.Equals(&op1a)); 67 CHECK(!op2b.Equals(&op1a));
67 CHECK(!op2b.Equals(&op1b)); 68 CHECK(!op2b.Equals(&op1b));
68 } 69 }
69 70
70 71 static std::unique_ptr<char[]> OperatorToString(Operator* op) {
71 static v8::base::SmartArrayPointer<const char> OperatorToString(Operator* op) {
72 std::ostringstream os; 72 std::ostringstream os;
73 os << *op; 73 os << *op;
74 return v8::base::SmartArrayPointer<const char>(StrDup(os.str().c_str())); 74 return std::unique_ptr<char[]>(StrDup(os.str().c_str()));
75 } 75 }
76 76
77 77
78 TEST(TestOperator_Print) { 78 TEST(TestOperator_Print) {
79 Operator op1a(19, NONE, "Another1", 0, 0, 0, 0, 0, 0); 79 Operator op1a(19, NONE, "Another1", 0, 0, 0, 0, 0, 0);
80 Operator op1b(19, FOLD, "Another2", 2, 0, 0, 2, 0, 0); 80 Operator op1b(19, FOLD, "Another2", 2, 0, 0, 2, 0, 0);
81 81
82 CHECK_EQ(0, strcmp("Another1", OperatorToString(&op1a).get())); 82 CHECK_EQ(0, strcmp("Another1", OperatorToString(&op1a).get()));
83 CHECK_EQ(0, strcmp("Another2", OperatorToString(&op1b).get())); 83 CHECK_EQ(0, strcmp("Another2", OperatorToString(&op1b).get()));
84 84
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 CHECK_EQ(33, op.ControlInputCount()); 277 CHECK_EQ(33, op.ControlInputCount());
278 278
279 CHECK_EQ(44, op.ValueOutputCount()); 279 CHECK_EQ(44, op.ValueOutputCount());
280 CHECK_EQ(55, op.EffectOutputCount()); 280 CHECK_EQ(55, op.EffectOutputCount());
281 CHECK_EQ(66, op.ControlOutputCount()); 281 CHECK_EQ(66, op.ControlOutputCount());
282 } 282 }
283 283
284 } // namespace compiler 284 } // namespace compiler
285 } // namespace internal 285 } // namespace internal
286 } // namespace v8 286 } // namespace v8
OLDNEW
« no previous file with comments | « src/wasm/wasm-result.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698