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

Side by Side Diff: remoting/base/compound_buffer_unittest.cc

Issue 13642007: Rewrite scoped_array<T> to scoped_ptr<T[]> in remoting/, Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Manually rewrite Win files. Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/base/util.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium 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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 memcpy(out, in, in_size); 131 memcpy(out, in, in_size);
132 out += in_size; 132 out += in_size;
133 out_size -= in_size; 133 out_size -= in_size;
134 } 134 }
135 } 135 }
136 136
137 static void ReadString(CompoundBufferInputStream* input, 137 static void ReadString(CompoundBufferInputStream* input,
138 const std::string& str) { 138 const std::string& str) {
139 SCOPED_TRACE(str); 139 SCOPED_TRACE(str);
140 scoped_array<char> buffer(new char[str.size() + 1]); 140 scoped_ptr<char[]> buffer(new char[str.size() + 1]);
141 buffer[str.size()] = '\0'; 141 buffer[str.size()] = '\0';
142 EXPECT_EQ(ReadFromInput(input, buffer.get(), str.size()), str.size()); 142 EXPECT_EQ(ReadFromInput(input, buffer.get(), str.size()), str.size());
143 EXPECT_STREQ(str.data(), buffer.get()); 143 EXPECT_STREQ(str.data(), buffer.get());
144 } 144 }
145 145
146 // Construct and prepare data in the |buffer|. 146 // Construct and prepare data in the |buffer|.
147 static void PrepareData(scoped_ptr<CompoundBuffer>* buffer) { 147 static void PrepareData(scoped_ptr<CompoundBuffer>* buffer) {
148 static const std::string kTestData = 148 static const std::string kTestData =
149 "Hello world!" 149 "Hello world!"
150 "This is testing" 150 "This is testing"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 ReadString(&stream, "MultipleArrayInput"); 269 ReadString(&stream, "MultipleArrayInput");
270 EXPECT_TRUE(stream.Skip(6)); 270 EXPECT_TRUE(stream.Skip(6));
271 ReadString(&stream, "f"); 271 ReadString(&stream, "f");
272 ReadString(&stream, "o"); 272 ReadString(&stream, "o");
273 ReadString(&stream, "r"); 273 ReadString(&stream, "r");
274 ReadString(&stream, " "); 274 ReadString(&stream, " ");
275 ReadString(&stream, "Chromoting"); 275 ReadString(&stream, "Chromoting");
276 } 276 }
277 277
278 } // namespace remoting 278 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/base/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698