[libcamera-devel] [PATCH 13/14] test: signal: Test connecting to non-void slots
Niklas Söderlund
niklas.soderlund at ragnatech.se
Tue Jan 7 20:22:20 CET 2020
Hi Laurent,
Thanks for your work.
On 2020-01-04 07:09:46 +0200, Laurent Pinchart wrote:
> Test that a signal can be connected to non-void static and member slots.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> test/signal.cpp | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/test/signal.cpp b/test/signal.cpp
> index 9d8f985d15e5..0054ed5a380d 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 ----------------- */
>
> /*
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list