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>
diff --git a/test/source/signal.cpp b/test/source/signal.cpp
index c99aa6b..d3b53a7 100644
--- a/test/source/signal.cpp
+++ b/test/source/signal.cpp
@@ -92,6 +92,10 @@
EXPECT_EQ(1, completions);
EXPECT_EQ(expected_si, return_si);
+ signal.set_callback(std::bind([]() {}));
+ EXPECT_EQ(0, handler(nullptr, expected_si, &signal));
+ EXPECT_EQ(1, completions);
+
expect_destruct();
}