Commit graph

5 commits

Author SHA1 Message Date
Laurent Pinchart
50478550e5 test: controls: control_value: Expand test to cover array controls
Add tests to ControlValueTest to cover array controls of all supported
types.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-06 18:35:34 +02:00
Laurent Pinchart
38d6e5b9ca test: controls: control_value: Expand test to cover all control types
The ControlValueTest hasn't been updated for a long time and is
outdated. Improve it to support all control types, and test the type(),
isArray() and toString() methods.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-06 18:10:51 +02:00
Laurent Pinchart
dd37ef784e libcamera: controls: Use explicit 32-bit integer types
Make the control API more explicit when dealing with integer controls by
specifying the size. We already do so for 64-bit integers, using int64_t
and ControlTypeInteger64, do the same for 32-bit integers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-04 19:33:08 +03:00
Laurent Pinchart
224ef9776a libcamera: controls: Make ControlValue get/set accessors template methods
The ControlValue get accessors are implemented with functions of
different names, whlie the set accessors use polymorphism to support
different control types. This isn't very consistent and intuitive. Make
the API clearer by using template methods. This will also have the added
advantage that support for the new types will only require adding
template specialisations, without adding new methods.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-04 19:33:08 +03:00
Kieran Bingham
4cbf83da40 libcamera: test: Add ControlValue test
Add initial basic testing for the new ControlValue class.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-02 16:59:46 +03:00