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

Unified 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 side-by-side diff with in-line comments
Download patch
« base/process/process_posix.cc ('K') | « base/values.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values_unittest.cc
diff --git a/base/values_unittest.cc b/base/values_unittest.cc
index 3bcdc16e37e61919d59ea81a8088572f24e94c43..227de4f0247822f4f89138ab953406b4b476d1cd 100644
--- a/base/values_unittest.cc
+++ b/base/values_unittest.cc
@@ -1383,4 +1383,10 @@ TEST(ValuesTest, GetWithNullOutValue) {
EXPECT_FALSE(main_list.GetList(7, NULL));
}
+TEST(ValuesTest, SelfSwap) {
+ base::Value test(1);
+ std::swap(test, test);
+ EXPECT_TRUE(test.GetInt() == 1);
+}
+
} // namespace base
« 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