summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/signal.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/signal.cpp b/test/signal.cpp
index 0054ed5a..f83ceb05 100644
--- a/test/signal.cpp
+++ b/test/signal.cpp
@@ -220,6 +220,30 @@ protected:
delete dynamicSignal;
delete slotObject;
+ /*
+ * Test that signal manual disconnection from Object removes
+ * the signal for the object. This shall not generate any
+ * valgrind warning.
+ */
+ dynamicSignal = new Signal<>();
+ slotObject = new SlotObject();
+ dynamicSignal->connect(slotObject, &SlotObject::slot);
+ dynamicSignal->disconnect(slotObject);
+ delete dynamicSignal;
+ delete slotObject;
+
+ /*
+ * Test that signal manual disconnection from all slots removes
+ * the signal for the object. This shall not generate any
+ * valgrind warning.
+ */
+ dynamicSignal = new Signal<>();
+ slotObject = new SlotObject();
+ dynamicSignal->connect(slotObject, &SlotObject::slot);
+ dynamicSignal->disconnect();
+ delete dynamicSignal;
+ delete slotObject;
+
/* Exercise the Object slot code paths. */
slotObject = new SlotObject();
signalVoid_.connect(slotObject, &SlotObject::slot);