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

Side by Side Diff: base/values_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
« base/process/process_posix.cc ('K') | « base/values.cc ('k') | no next file » | 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 "base/values.h" 5 #include "base/values.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <memory> 10 #include <memory>
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 EXPECT_FALSE(main_list.GetList(0, NULL)); 1376 EXPECT_FALSE(main_list.GetList(0, NULL));
1377 EXPECT_FALSE(main_list.GetList(1, NULL)); 1377 EXPECT_FALSE(main_list.GetList(1, NULL));
1378 EXPECT_FALSE(main_list.GetList(2, NULL)); 1378 EXPECT_FALSE(main_list.GetList(2, NULL));
1379 EXPECT_FALSE(main_list.GetList(3, NULL)); 1379 EXPECT_FALSE(main_list.GetList(3, NULL));
1380 EXPECT_FALSE(main_list.GetList(4, NULL)); 1380 EXPECT_FALSE(main_list.GetList(4, NULL));
1381 EXPECT_FALSE(main_list.GetList(5, NULL)); 1381 EXPECT_FALSE(main_list.GetList(5, NULL));
1382 EXPECT_TRUE(main_list.GetList(6, NULL)); 1382 EXPECT_TRUE(main_list.GetList(6, NULL));
1383 EXPECT_FALSE(main_list.GetList(7, NULL)); 1383 EXPECT_FALSE(main_list.GetList(7, NULL));
1384 } 1384 }
1385 1385
1386 TEST(ValuesTest, SelfSwap) {
1387 base::Value test(1);
1388 std::swap(test, test);
1389 EXPECT_TRUE(test.GetInt() == 1);
1390 }
1391
1386 } // namespace base 1392 } // namespace base
OLDNEW
« base/process/process_posix.cc ('K') | « base/values.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698