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

Side by Side Diff: base/pickle_unittest.cc

Issue 16667013: Use a direct include of strings headers in base/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « base/pickle.h ('k') | base/prefs/json_pref_store_unittest.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/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 namespace { 13 namespace {
14 14
15 const int testint = 2093847192; 15 const int testint = 2093847192;
16 const std::string teststr("Hello world"); // note non-aligned string length 16 const std::string teststr("Hello world"); // note non-aligned string length
17 const std::wstring testwstr(L"Hello, world"); 17 const std::wstring testwstr(L"Hello, world");
18 const char testdata[] = "AAA\0BBB\0"; 18 const char testdata[] = "AAA\0BBB\0";
19 const int testdatalen = arraysize(testdata) - 1; 19 const int testdatalen = arraysize(testdata) - 1;
20 const bool testbool1 = false; 20 const bool testbool1 = false;
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 EXPECT_TRUE(pickle.WriteBytes(&data, sizeof(data))); 333 EXPECT_TRUE(pickle.WriteBytes(&data, sizeof(data)));
334 334
335 PickleIterator iter(pickle); 335 PickleIterator iter(pickle);
336 const char* outdata_char = NULL; 336 const char* outdata_char = NULL;
337 EXPECT_TRUE(pickle.ReadBytes(&iter, &outdata_char, sizeof(data))); 337 EXPECT_TRUE(pickle.ReadBytes(&iter, &outdata_char, sizeof(data)));
338 338
339 int outdata; 339 int outdata;
340 memcpy(&outdata, outdata_char, sizeof(outdata)); 340 memcpy(&outdata, outdata_char, sizeof(outdata));
341 EXPECT_EQ(data, outdata); 341 EXPECT_EQ(data, outdata);
342 } 342 }
OLDNEW
« no previous file with comments | « base/pickle.h ('k') | base/prefs/json_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698