util: disallow destruction of Signal from handler
refs #2313
Change-Id: Ifec8dcfe66873f88b8a39726be68f090b8c18fb3
diff --git a/tests/unit-tests/util/signal.t.cpp b/tests/unit-tests/util/signal.t.cpp
index e975cc2..41750c2 100644
--- a/tests/unit-tests/util/signal.t.cpp
+++ b/tests/unit-tests/util/signal.t.cpp
@@ -193,7 +193,7 @@
BOOST_CHECK_EQUAL(hit, 1); // handler called
BOOST_CHECK_EQUAL(connection.isConnected(), true);
- so.reset(); // destruct EventEmitter
+ so.reset(); // destruct Signal
BOOST_CHECK_EQUAL(connection.isConnected(), false);
BOOST_CHECK_NO_THROW(connection.disconnect());
}
@@ -422,21 +422,6 @@
BOOST_CHECK_EQUAL(hit, 2); // handler called
}
-BOOST_AUTO_TEST_CASE(DestructInHandler)
-{
- unique_ptr<SignalOwner0> so(new SignalOwner0());
-
- int hit = 0;
- so->sig.connect([&] {
- ++hit;
- so.reset();
- });
-
- BOOST_CHECK_NO_THROW(so->emitSignal(sig));
- BOOST_CHECK_EQUAL(hit, 1); // handler called
- BOOST_CHECK(so == nullptr);
-}
-
BOOST_AUTO_TEST_SUITE_END()
} // namespace tests