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

Unified Diff: base/values_unittest.cc

Issue 2797283002: Fixing std::swap(x, x) in base. (Closed)
Patch Set: Rebase. 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
« no previous file with comments | « 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 6c1f01709500b815ff3e08c60a28406fc77f6ac0..da2989f976e007643348a68d9dc2f25db531e825 100644
--- a/base/values_unittest.cc
+++ b/base/values_unittest.cc
@@ -1519,4 +1519,11 @@ TEST(ValuesTest, GetWithNullOutValue) {
EXPECT_FALSE(main_list.GetList(7, NULL));
}
+TEST(ValuesTest, SelfSwap) {
+ base::Value test(1);
+ using namespace std;
+ swap(test, test);
+ EXPECT_TRUE(test.GetInt() == 1);
+}
+
} // namespace base
« no previous file with comments | « base/values.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698