summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-09-28 02:45:49 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-05 20:02:51 +0300
commitecf1c2e57b357f1b843796fd9ac4c77da940a26a (patch)
treec955705f0641f26b9e53749f40756509cb7e2d16 /test
parentf671d84ceb491fdb07ad39d1fe20950fd6482e4f (diff)
libcamera: controls: Use ControlValidator to validate ControlList
Replace the manual validation of controls against a Camera with usage of the new ControlValidator interface. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'test')
-rw-r--r--test/controls/control_list.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/controls/control_list.cpp b/test/controls/control_list.cpp
index 8469ecf0..1bcfecc4 100644
--- a/test/controls/control_list.cpp
+++ b/test/controls/control_list.cpp
@@ -12,6 +12,7 @@
#include <libcamera/control_ids.h>
#include <libcamera/controls.h>
+#include "camera_controls.h"
#include "test.h"
using namespace std;
@@ -40,7 +41,8 @@ protected:
int run()
{
- ControlList list(camera_.get());
+ CameraControlValidator validator(camera_.get());
+ ControlList list(&validator);
/* Test that the list is initially empty. */
if (!list.empty()) {
@@ -141,6 +143,17 @@ protected:
return TestFail;
}
+ /*
+ * Attempt to set an invalid control and verify that the
+ * operation failed.
+ */
+ list.set(controls::AwbEnable, true);
+
+ if (list.contains(controls::AwbEnable)) {
+ cout << "List shouldn't contain AwbEnable control" << endl;
+ return TestFail;
+ }
+
return TestPass;
}