summaryrefslogtreecommitdiffstats
path: root/test/source/time.cpp
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-10-29 20:06:45 -0700
committerWilliam A. Kennington III <wak@google.com>2018-10-29 20:43:21 -0700
commitb53ef90218633a1b7c9b0e726a45d86ecb2bfaf0 (patch)
tree19fc58ece366479efa3fa5673de8c9467ade6ac6 /test/source/time.cpp
parent463d5c347819b0d750c1ccaac7aac20c32035df9 (diff)
downloadsdeventplus-b53ef90218633a1b7c9b0e726a45d86ecb2bfaf0.tar.gz
sdeventplus-b53ef90218633a1b7c9b0e726a45d86ecb2bfaf0.zip
source/*: Make updating callbacks possible
Sometimes callers want to be able to update the callback used when the source is acted upon. This is needed for updating references stored in the callback. Tested: Run through the unit test suite. Change-Id: I78bda32569287964bfc9d49501869d3a2b497f3d Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'test/source/time.cpp')
-rw-r--r--test/source/time.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/source/time.cpp b/test/source/time.cpp
index aa25da0..96a920e 100644
--- a/test/source/time.cpp
+++ b/test/source/time.cpp
@@ -90,6 +90,11 @@ TEST_F(TimeTest, ConstructSuccess)
EXPECT_EQ(Time<id>::TimePoint(std::chrono::microseconds(2000100)),
saved_time);
+ time.set_callback(std::bind([]() {}));
+ EXPECT_EQ(0, handler(nullptr, 0, userdata));
+ EXPECT_EQ(Time<id>::TimePoint(std::chrono::microseconds(2000100)),
+ saved_time);
+
expect_time_destroy(expected_event, expected_source);
}
OpenPOWER on IntegriCloud