From ecf1c2e57b357f1b843796fd9ac4c77da940a26a Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 28 Sep 2019 02:45:49 +0300 Subject: libcamera: controls: Use ControlValidator to validate ControlList MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the manual validation of controls against a Camera with usage of the new ControlValidator interface. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- test/controls/control_list.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test/controls/control_list.cpp') 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 #include +#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; } -- cgit v1.2.1