summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-07-20 00:17:38 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-07-20 13:25:02 +0300
commitb0b66214892ff566c0f4342bb28eaacb1cfa8d68 (patch)
tree5053ec529564c3eb9cad6506452d9b985b576fcc
parent38136f9e11d1e1af3880bc3382e97e5a7250568d (diff)
test: control_list: Use get() to test for control presence
Now that the ControlList::get() function returns an std::optional<>, it is the preferred way to test if a control is present in a ControlList. Use it in the test to prepare for removal of ControlList::contains(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
-rw-r--r--test/controls/control_list.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/controls/control_list.cpp b/test/controls/control_list.cpp
index 70cf61b8..c03f230e 100644
--- a/test/controls/control_list.cpp
+++ b/test/controls/control_list.cpp
@@ -50,7 +50,7 @@ protected:
return TestFail;
}
- if (list.contains(controls::Brightness)) {
+ if (list.get(controls::Brightness)) {
cout << "List should not contain Brightness control" << endl;
return TestFail;
}
@@ -80,7 +80,7 @@ protected:
return TestFail;
}
- if (!list.contains(controls::Brightness)) {
+ if (!list.get(controls::Brightness)) {
cout << "List should contain Brightness control" << endl;
return TestFail;
}
@@ -99,7 +99,7 @@ protected:
return TestFail;
}
- if (list.contains(controls::Contrast)) {
+ if (list.get(controls::Contrast)) {
cout << "List should not contain Contract control" << endl;
return TestFail;
}
@@ -108,8 +108,8 @@ protected:
list.set(controls::Brightness, 0.0f);
list.set(controls::Contrast, 1.5f);
- if (!list.contains(controls::Brightness) ||
- !list.contains(controls::Contrast)) {
+ if (!list.get(controls::Brightness) ||
+ !list.get(controls::Contrast)) {
cout << "List should contain Brightness and Contrast controls"
<< endl;
return TestFail;
@@ -145,7 +145,7 @@ protected:
*/
list.set(controls::AwbEnable, true);
- if (list.contains(controls::AwbEnable)) {
+ if (list.get(controls::AwbEnable)) {
cout << "List shouldn't contain AwbEnable control" << endl;
return TestFail;
}
@@ -171,9 +171,9 @@ protected:
return TestFail;
}
- if (!mergeList.contains(controls::Brightness) ||
- !mergeList.contains(controls::Contrast) ||
- !mergeList.contains(controls::Saturation)) {
+ if (!mergeList.get(controls::Brightness) ||
+ !mergeList.get(controls::Contrast) ||
+ !mergeList.get(controls::Saturation)) {
cout << "Merged list does not contain all controls" << endl;
return TestFail;
}