summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-01-03 21:10:11 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-01-07 22:29:46 +0200
commit94f62f6b590857e9bcee379aec8e818625aebdf8 (patch)
tree63736eb9ac99abe3129571922643e77f804cd1a7
parent1f898ab114d7d4ede335bb01cb218a6f5eaf55ff (diff)
test: signal: Test connecting to non-void slots
Test that a signal can be connected to non-void static and member slots. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
-rw-r--r--test/signal.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/signal.cpp b/test/signal.cpp
index 9d8f985d..0054ed5a 100644
--- a/test/signal.cpp
+++ b/test/signal.cpp
@@ -23,6 +23,11 @@ static void slotStatic(int value)
valueStatic_ = value;
}
+static int slotStaticReturn()
+{
+ return 0;
+}
+
class SlotObject : public Object
{
public:
@@ -85,6 +90,11 @@ protected:
name_ = name;
}
+ int slotReturn()
+ {
+ return 0;
+ }
+
int init()
{
return 0;
@@ -174,6 +184,13 @@ protected:
return TestFail;
}
+ /*
+ * Test connecting to slots that return a value. This targets
+ * compilation, there's no need to check runtime results.
+ */
+ signalVoid_.connect(slotStaticReturn);
+ signalVoid_.connect(this, &SignalTest::slotReturn);
+
/* ----------------- Signal -> Object tests ----------------- */
/*