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

Side by Side Diff: base/pickle_unittest.cc

Issue 2797283002: Fixing std::swap(x, x) in base. (Closed)
Patch Set: Created 3 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
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 "base/pickle.h" 5 #include "base/pickle.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 } 658 }
659 { 659 {
660 TestingPickle pickle; 660 TestingPickle pickle;
661 base::PickleSizer sizer; 661 base::PickleSizer sizer;
662 pickle.WriteBytes(testdata, testdatalen); 662 pickle.WriteBytes(testdata, testdatalen);
663 sizer.AddBytes(testdatalen); 663 sizer.AddBytes(testdatalen);
664 EXPECT_EQ(sizer.payload_size(), pickle.payload_size()); 664 EXPECT_EQ(sizer.payload_size(), pickle.payload_size());
665 } 665 }
666 } 666 }
667 667
668 TEST(PickleTest, SelfSwap) {
669 TestingPickle pickle;
670 std::swap(pickle, pickle);
671 }
672
668 } // namespace base 673 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698