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

Unified Diff: webrtc/base/optional_unittest.cc

Issue 2681283002: Add ability to return moved value from FunctorMessageHandler, Optional. (Closed)
Patch Set: Rename to MoveValue as suggested. Created 3 years, 10 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 | « webrtc/base/optional.h ('k') | webrtc/base/thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/optional_unittest.cc
diff --git a/webrtc/base/optional_unittest.cc b/webrtc/base/optional_unittest.cc
index c1ae9c00d42fc4bc626595f7c8245e6801137585..65070fabb03f2ed0383d64a3aa70f279188e5c14 100644
--- a/webrtc/base/optional_unittest.cc
+++ b/webrtc/base/optional_unittest.cc
@@ -725,4 +725,19 @@ TEST(OptionalTest, TestSwap) {
*log);
}
+TEST(OptionalTest, TestMoveValue) {
+ auto log = Logger::Setup();
+ {
+ Optional<Logger> x(Logger(42));
+ log->push_back("---");
+ Logger moved = x.MoveValue();
+ log->push_back("---");
+ }
+ EXPECT_EQ(
+ V("0:42. explicit constructor", "1:42. move constructor (from 0:42)",
+ "0:42. destructor", "---", "2:42. move constructor (from 1:42)", "---",
+ "2:42. destructor", "1:42. destructor"),
+ *log);
+}
+
} // namespace rtc
« no previous file with comments | « webrtc/base/optional.h ('k') | webrtc/base/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698