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

Side by Side Diff: base/pickle_unittest.cc

Issue 11568033: Small fixes to allow unit tests to compile with gcc 4.7.x (tested with gcc 4.7.2) (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 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 | « AUTHORS ('k') | base/string_number_conversions_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/string16.h"
(...skipping 22 matching lines...) Expand all
33 std::string outstr; 33 std::string outstr;
34 EXPECT_TRUE(pickle.ReadString(&iter, &outstr)); 34 EXPECT_TRUE(pickle.ReadString(&iter, &outstr));
35 EXPECT_EQ(teststr, outstr); 35 EXPECT_EQ(teststr, outstr);
36 36
37 std::wstring outwstr; 37 std::wstring outwstr;
38 EXPECT_TRUE(pickle.ReadWString(&iter, &outwstr)); 38 EXPECT_TRUE(pickle.ReadWString(&iter, &outwstr));
39 EXPECT_EQ(testwstr, outwstr); 39 EXPECT_EQ(testwstr, outwstr);
40 40
41 bool outbool; 41 bool outbool;
42 EXPECT_TRUE(pickle.ReadBool(&iter, &outbool)); 42 EXPECT_TRUE(pickle.ReadBool(&iter, &outbool));
43 EXPECT_EQ(testbool1, outbool); 43 EXPECT_FALSE(outbool);
44 EXPECT_TRUE(pickle.ReadBool(&iter, &outbool)); 44 EXPECT_TRUE(pickle.ReadBool(&iter, &outbool));
45 EXPECT_EQ(testbool2, outbool); 45 EXPECT_TRUE(outbool);
46 46
47 uint16 outuint16; 47 uint16 outuint16;
48 EXPECT_TRUE(pickle.ReadUInt16(&iter, &outuint16)); 48 EXPECT_TRUE(pickle.ReadUInt16(&iter, &outuint16));
49 EXPECT_EQ(testuint16, outuint16); 49 EXPECT_EQ(testuint16, outuint16);
50 50
51 float outfloat; 51 float outfloat;
52 EXPECT_TRUE(pickle.ReadFloat(&iter, &outfloat)); 52 EXPECT_TRUE(pickle.ReadFloat(&iter, &outfloat));
53 EXPECT_EQ(testfloat, outfloat); 53 EXPECT_EQ(testfloat, outfloat);
54 54
55 const char* outdata; 55 const char* outdata;
(...skipping 277 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 | « AUTHORS ('k') | base/string_number_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698