summaryrefslogtreecommitdiff
path: root/test/controls/control_list.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-04-27 21:04:06 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-04-27 23:38:34 +0300
commit256d0a4098aa4c4e9f87db46cecbd66f693dd9bf (patch)
treea038f307faa03919a842aa746e130287135f42d4 /test/controls/control_list.cpp
parent96980e35ae64df51fa6830622e776506e9a4cf42 (diff)
test: Use float values for brightness, contrast and saturation
Two tests use the brightness, contrast and saturation controls with integer failures. They were not updated by commit eff4b1aa01c1 which turned those controls into floats. This doesn't cause test failures as the control API converts the value types. For correctness, update the tests to use float values. Fixes: eff4b1aa01c1 ("libcamera: controls: Reorder and update description of existing controls") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'test/controls/control_list.cpp')
-rw-r--r--test/controls/control_list.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/controls/control_list.cpp b/test/controls/control_list.cpp
index 5374c6f9..d51ec47d 100644
--- a/test/controls/control_list.cpp
+++ b/test/controls/control_list.cpp
@@ -68,7 +68,7 @@ protected:
* Set a control, and verify that the list now contains it, and
* nothing else.
*/
- list.set(controls::Brightness, 255);
+ list.set(controls::Brightness, -0.5f);
if (list.empty()) {
cout << "List should not be empty" << endl;
@@ -94,7 +94,7 @@ protected:
return TestFail;
}
- if (list.get(controls::Brightness) != 255) {
+ if (list.get(controls::Brightness) != -0.5f) {
cout << "Incorrest Brightness control value" << endl;
return TestFail;
}
@@ -105,8 +105,8 @@ protected:
}
/* Update the first control and set a second one. */
- list.set(controls::Brightness, 64);
- list.set(controls::Contrast, 128);
+ list.set(controls::Brightness, 0.0f);
+ list.set(controls::Contrast, 1.5f);
if (!list.contains(controls::Contrast) ||
!list.contains(controls::Contrast)) {
@@ -114,8 +114,8 @@ protected:
return TestFail;
}
- if (list.get(controls::Brightness) != 64 ||
- list.get(controls::Contrast) != 128) {
+ if (list.get(controls::Brightness) != 0.0f ||
+ list.get(controls::Contrast) != 1.5f) {
cout << "Failed to retrieve control value" << endl;
return TestFail;
}
@@ -124,11 +124,11 @@ protected:
* Update both controls and verify that the container doesn't
* grow.
*/
- list.set(controls::Brightness, 10);
- list.set(controls::Contrast, 20);
+ list.set(controls::Brightness, 0.5f);
+ list.set(controls::Contrast, 1.1f);
- if (list.get(controls::Brightness) != 10 ||
- list.get(controls::Contrast) != 20) {
+ if (list.get(controls::Brightness) != 0.5f ||
+ list.get(controls::Contrast) != 1.1f) {
cout << "Failed to update control value" << endl;
return TestFail;
}