summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-10-07 01:12:50 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-12-16 19:39:13 +0200
commitb5ef421e0320d4a0578dee0109049637a7ad7a0d (patch)
tree17c752ed8eed9574938ed9947d2a80fd5168095e
parentf0fef545a7c08e8b27b260c22de8a84fc3a43372 (diff)
test: controls: control_info: Test default def() values
Extend the ControlInfo test to verify the behaviour of the default 'def' argument to the ControlInfo constructor. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--test/controls/control_info.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/controls/control_info.cpp b/test/controls/control_info.cpp
index 56b4101f..1176a502 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;
}