From f3481886255675a6ba1342865bf8fd0033a30eba Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Wed, 21 Apr 2021 17:20:00 +0200 Subject: test: control_list: Check for Brightness presence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current test verifies that after adding a new control to a list already populated with one control the new one is present. However the test wrongly tests for its presence twice instead of making sure the existing control is still there. Fix this by checking for the presence of both controls after the update, and fix the error message accordingly. Fixes: a8c40942b99e ("libcamera: controls: Improve the API towards applications") Reviewed-by: Niklas Söderlund Reviewed-by: Hirokazu Honda Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- test/controls/control_list.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/controls/control_list.cpp b/test/controls/control_list.cpp index b5a49dc1..2b321ddd 100644 --- a/test/controls/control_list.cpp +++ b/test/controls/control_list.cpp @@ -108,9 +108,10 @@ protected: list.set(controls::Brightness, 0.0f); list.set(controls::Contrast, 1.5f); - if (!list.contains(controls::Contrast) || + if (!list.contains(controls::Brightness) || !list.contains(controls::Contrast)) { - cout << "List should contain Contrast control" << endl; + cout << "List should contain Brightness and Contrast controls" + << endl; return TestFail; } -- cgit v1.2.1