util: allow emitSignal with non-zero arguments
refs #2329
Change-Id: I7708878343f87bceff3c52c9266afcfd388e8683
diff --git a/tests/unit-tests/util/signal.cpp b/tests/unit-tests/util/signal.cpp
index afb4980..e0d70aa 100644
--- a/tests/unit-tests/util/signal.cpp
+++ b/tests/unit-tests/util/signal.cpp
@@ -68,6 +68,39 @@
BOOST_CHECK_EQUAL(hit2, 1);
}
+class SignalOwner1
+{
+public:
+ Signal<SignalOwner1, int> sig;
+
+protected:
+ DECLARE_SIGNAL_EMIT(sig)
+};
+
+class SignalEmitter1 : public SignalOwner1
+{
+public:
+ void
+ emitTestSignal()
+ {
+ this->emitSignal(sig, 8106);
+ }
+};
+
+BOOST_AUTO_TEST_CASE(OneArgument)
+{
+ SignalEmitter1 se;
+
+ int hit = 0;
+ se.sig.connect([&hit] (int a) {
+ ++hit;
+ BOOST_CHECK_EQUAL(a, 8106);
+ });
+ se.emitTestSignal();
+
+ BOOST_CHECK_EQUAL(hit, 1);
+}
+
BOOST_AUTO_TEST_CASE(TwoArguments)
{
Signal<std::remove_pointer<decltype(this)>::type, int, int> sig;