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 commiteff4b1aa01
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:eff4b1aa01
("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>
This commit is contained in:
parent
96980e35ae
commit
256d0a4098
2 changed files with 13 additions and 13 deletions
|
@ -68,7 +68,7 @@ protected:
|
||||||
* Set a control, and verify that the list now contains it, and
|
* Set a control, and verify that the list now contains it, and
|
||||||
* nothing else.
|
* nothing else.
|
||||||
*/
|
*/
|
||||||
list.set(controls::Brightness, 255);
|
list.set(controls::Brightness, -0.5f);
|
||||||
|
|
||||||
if (list.empty()) {
|
if (list.empty()) {
|
||||||
cout << "List should not be empty" << endl;
|
cout << "List should not be empty" << endl;
|
||||||
|
@ -94,7 +94,7 @@ protected:
|
||||||
return TestFail;
|
return TestFail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list.get(controls::Brightness) != 255) {
|
if (list.get(controls::Brightness) != -0.5f) {
|
||||||
cout << "Incorrest Brightness control value" << endl;
|
cout << "Incorrest Brightness control value" << endl;
|
||||||
return TestFail;
|
return TestFail;
|
||||||
}
|
}
|
||||||
|
@ -105,8 +105,8 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the first control and set a second one. */
|
/* Update the first control and set a second one. */
|
||||||
list.set(controls::Brightness, 64);
|
list.set(controls::Brightness, 0.0f);
|
||||||
list.set(controls::Contrast, 128);
|
list.set(controls::Contrast, 1.5f);
|
||||||
|
|
||||||
if (!list.contains(controls::Contrast) ||
|
if (!list.contains(controls::Contrast) ||
|
||||||
!list.contains(controls::Contrast)) {
|
!list.contains(controls::Contrast)) {
|
||||||
|
@ -114,8 +114,8 @@ protected:
|
||||||
return TestFail;
|
return TestFail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list.get(controls::Brightness) != 64 ||
|
if (list.get(controls::Brightness) != 0.0f ||
|
||||||
list.get(controls::Contrast) != 128) {
|
list.get(controls::Contrast) != 1.5f) {
|
||||||
cout << "Failed to retrieve control value" << endl;
|
cout << "Failed to retrieve control value" << endl;
|
||||||
return TestFail;
|
return TestFail;
|
||||||
}
|
}
|
||||||
|
@ -124,11 +124,11 @@ protected:
|
||||||
* Update both controls and verify that the container doesn't
|
* Update both controls and verify that the container doesn't
|
||||||
* grow.
|
* grow.
|
||||||
*/
|
*/
|
||||||
list.set(controls::Brightness, 10);
|
list.set(controls::Brightness, 0.5f);
|
||||||
list.set(controls::Contrast, 20);
|
list.set(controls::Contrast, 1.1f);
|
||||||
|
|
||||||
if (list.get(controls::Brightness) != 10 ||
|
if (list.get(controls::Brightness) != 0.5f ||
|
||||||
list.get(controls::Contrast) != 20) {
|
list.get(controls::Contrast) != 1.1f) {
|
||||||
cout << "Failed to update control value" << endl;
|
cout << "Failed to update control value" << endl;
|
||||||
return TestFail;
|
return TestFail;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,9 +42,9 @@ protected:
|
||||||
const ControlInfoMap &infoMap = camera_->controls();
|
const ControlInfoMap &infoMap = camera_->controls();
|
||||||
ControlList list(infoMap);
|
ControlList list(infoMap);
|
||||||
|
|
||||||
list.set(controls::Brightness, 255);
|
list.set(controls::Brightness, 0.5f);
|
||||||
list.set(controls::Contrast, 128);
|
list.set(controls::Contrast, 1.2f);
|
||||||
list.set(controls::Saturation, 50);
|
list.set(controls::Saturation, 0.2f);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Serialize the control list, this should fail as the control
|
* Serialize the control list, this should fail as the control
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue