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

Side by Side Diff: base/pickle_unittest.cc

Issue 100303003: Move more uses of string16 to specify base:: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « base/pickle.cc ('k') | base/strings/string16.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 // Remove when this file is in the base namespace.
14 using base::string16;
15
13 namespace { 16 namespace {
14 17
15 const int testint = 2093847192; 18 const int testint = 2093847192;
16 const std::string teststr("Hello world"); // note non-aligned string length 19 const std::string teststr("Hello world"); // note non-aligned string length
17 const std::wstring testwstr(L"Hello, world"); 20 const std::wstring testwstr(L"Hello, world");
18 const char testdata[] = "AAA\0BBB\0"; 21 const char testdata[] = "AAA\0BBB\0";
19 const int testdatalen = arraysize(testdata) - 1; 22 const int testdatalen = arraysize(testdata) - 1;
20 const bool testbool1 = false; 23 const bool testbool1 = false;
21 const bool testbool2 = true; 24 const bool testbool2 = true;
22 const uint16 testuint16 = 32123; 25 const uint16 testuint16 = 32123;
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 EXPECT_TRUE(pickle.WriteBytes(&data, sizeof(data))); 355 EXPECT_TRUE(pickle.WriteBytes(&data, sizeof(data)));
353 356
354 PickleIterator iter(pickle); 357 PickleIterator iter(pickle);
355 const char* outdata_char = NULL; 358 const char* outdata_char = NULL;
356 EXPECT_TRUE(pickle.ReadBytes(&iter, &outdata_char, sizeof(data))); 359 EXPECT_TRUE(pickle.ReadBytes(&iter, &outdata_char, sizeof(data)));
357 360
358 int outdata; 361 int outdata;
359 memcpy(&outdata, outdata_char, sizeof(outdata)); 362 memcpy(&outdata, outdata_char, sizeof(outdata));
360 EXPECT_EQ(data, outdata); 363 EXPECT_EQ(data, outdata);
361 } 364 }
OLDNEW
« no previous file with comments | « base/pickle.cc ('k') | base/strings/string16.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698