[libcamera-devel] [PATCH] test: signal: Exercise the signal delivery code paths for Object

Kieran Bingham kieran.bingham at ideasonboard.com
Sat Apr 27 16:33:55 CEST 2019


Hi Laurent,

On 27/04/2019 14:16, Laurent Pinchart wrote:
> Member slots for objects deriving from the Object class receive special
> handling. Add one test to make sure we exercise the related code paths.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

> ---
>  test/signal.cpp | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/test/signal.cpp b/test/signal.cpp
> index 19a52c603a4a..bc579cca37e4 100644
> --- a/test/signal.cpp
> +++ b/test/signal.cpp
> @@ -176,6 +176,18 @@ protected:
>  		delete signal;
>  		delete slotObject;
>  
> +		/* Exercise the the Object slot code paths. */

'the the' : s/the //

> +		slotObject = new SlotObject();
> +		signalVoid_.connect(slotObject, &SlotObject::slot);
> +		valueStatic_ = 0;
> +		signalVoid_.emit();> +		if (valueStatic_ == 0) {
> +			cout << "Signal delivery for Object test failed" << endl;
> +			return TestFail;
> +		}
> +

Hrm ... I thought this was missing a signalVoid_.disconnect() but given
the test above this addition I guess the delete slotObject handles this.

> +		delete slotObject;
> +
>  		return TestPass;
>  	}
>  
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list