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>
This commit is contained in:
parent
1f898ab114
commit
94f62f6b59
1 changed files with 17 additions and 0 deletions
|
@ -23,6 +23,11 @@ static void slotStatic(int value)
|
||||||
valueStatic_ = value;
|
valueStatic_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int slotStaticReturn()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
class SlotObject : public Object
|
class SlotObject : public Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -85,6 +90,11 @@ protected:
|
||||||
name_ = name;
|
name_ = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int slotReturn()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int init()
|
int init()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -174,6 +184,13 @@ protected:
|
||||||
return TestFail;
|
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 ----------------- */
|
/* ----------------- Signal -> Object tests ----------------- */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue