[libcamera-devel] [PATCH] test: controls: control_info: Test default def() values

Umang Jain umang.jain at ideasonboard.com
Wed Oct 12 12:40:49 CEST 2022


Hi

On 10/7/22 3:47 AM, Laurent Pinchart via libcamera-devel wrote:
> On Fri, Oct 07, 2022 at 01:15:06AM +0300, Laurent Pinchart via libcamera-devel wrote:
>> Extend the ControlInfoMap test to verify the behaviour of the default
>> 'def' argument to the ControlInfoMap constructor.
> s/ControlInfoMap/ControlInfo/
>
>> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

I thought I reviewed this but might have forgotten to send r-b, here it is:

Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>

>> ---
>>   test/controls/control_info.cpp | 8 +++++---
>>   1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/test/controls/control_info.cpp b/test/controls/control_info.cpp
>> index 56b4101f72fe..1176a5024b3a 100644
>> --- a/test/controls/control_info.cpp
>> +++ b/test/controls/control_info.cpp
>> @@ -27,19 +27,21 @@ protected:
>>   		ControlInfo brightness;
>>   
>>   		if (brightness.min().type() != ControlType::ControlTypeNone ||
>> -		    brightness.max().type() != ControlType::ControlTypeNone) {
>> +		    brightness.max().type() != ControlType::ControlTypeNone ||
>> +		    brightness.def().type() != ControlType::ControlTypeNone) {
>>   			cout << "Invalid control range for Brightness" << endl;
>>   			return TestFail;
>>   		}
>>   
>>   		/*
>>   		 * Test information retrieval from a control with a minimum and
>> -		 * a maximum value.
>> +		 * a maximum value, and an implicit default value.
>>   		 */
>>   		ControlInfo contrast(10, 200);
>>   
>>   		if (contrast.min().get<int32_t>() != 10 ||
>> -		    contrast.max().get<int32_t>() != 200) {
>> +		    contrast.max().get<int32_t>() != 200 ||
>> +		    !contrast.def().isNone()) {
>>   			cout << "Invalid control range for Contrast" << endl;
>>   			return TestFail;
>>   		}



More information about the libcamera-devel mailing list