diff options
author | Christian Rauch <Rauch.Christian@gmx.de> | 2022-09-03 23:33:30 +0200 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2022-09-12 18:29:11 +0900 |
commit | 5fd18af2330b9338c705d8590007acd706b83827 (patch) | |
tree | 5ab41f8c39daa8f0c44393f14fc2365e4e9d32b3 /test/controls | |
parent | cbc2be34ed9e47f5b17d0955bf3496d735359795 (diff) |
libcamera: controls: initialise control info to ControlTypeNone by default
The default ControlInfo constructor allows partially initialising the
min/max/def values. Uninitialised values are assigned to 0 by default.
This implicit initialisation makes it impossible to distinguish between
an uninitialised and an explicitly 0-initialised ControlValue.
Default construct the ControlValue in the ControlInfo default contructor to
explicitly represent uninitialised values by the ControlTypeNone type.
Signed-off-by: Christian Rauch <Rauch.Christian@gmx.de>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'test/controls')
-rw-r--r-- | test/controls/control_info.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/controls/control_info.cpp b/test/controls/control_info.cpp index 2827473b..56b4101f 100644 --- a/test/controls/control_info.cpp +++ b/test/controls/control_info.cpp @@ -26,8 +26,8 @@ protected: */ ControlInfo brightness; - if (brightness.min().get<int32_t>() != 0 || - brightness.max().get<int32_t>() != 0) { + if (brightness.min().type() != ControlType::ControlTypeNone || + brightness.max().type() != ControlType::ControlTypeNone) { cout << "Invalid control range for Brightness" << endl; return TestFail; } |