libcamera/test
Stefan Klug 6b67094cd2 libcamera: yaml-parser: Differentiate between empty and empty string
When accessing a nonexistent key on a dict the YamlObject returns an
empty element. This element can happily be cast to a string which is
unexpected. For example the following statement:

yamlDict["nonexistent"].get<string>("default")

is expected to return "default" but actually returns "". Fix this by
introducing an empty type to distinguish between an empty YamlObject and
a YamlObject of type value containing an empty string. For completeness
add an isEmpty() function and an explicit cast to bool to be able to
test for that type.

Extend the tests accordingly.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2024-09-23 13:03:35 +02:00
..
camera test: camera: Increase timeout for vimc capture tests 2024-06-03 11:53:01 +03:00
controls libcamera: Drop remaining file name from header comment blocks 2024-05-09 23:31:15 +03:00
gstreamer gstreamer: allocator: Ensure camera manager stay alive 2024-07-25 11:44:32 +01:00
ipa libcamera: ipa_manager: Remove singleton requirement 2024-08-07 18:58:55 +03:00
ipc libcamera: Avoid variable-length arrays 2024-07-31 01:22:13 +03:00
libtest libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
log libcamera: Drop remaining file name from header comment blocks 2024-05-09 23:31:15 +03:00
media_device libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
process libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
py py: unittests.py: Fix type checker warnings 2023-06-04 16:10:51 +03:00
serialization tests: Add a missing iostream include 2024-09-02 18:57:55 +03:00
stream libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
v4l2_compat libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
v4l2_subdevice libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
v4l2_videodevice test: v4l2_videodevice: Increase timeout for vimc capture tests 2024-06-03 11:53:10 +03:00
bayer-format.cpp libcamera: Drop remaining file name from header comment blocks 2024-05-09 23:31:15 +03:00
byte-stream-buffer.cpp libcamera: Drop remaining file name from header comment blocks 2024-05-09 23:31:15 +03:00
camera-sensor.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
color-space.cpp test: Add a ColorSpace test 2022-08-26 01:04:27 +03:00
delayed_controls.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
event-dispatcher.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
event-thread.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
event.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
fence.cpp test: fence: Increase timeout for fence test 2024-06-03 11:53:07 +03:00
file.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
flags.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
geometry.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
hotplug-cameras.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
mapped-buffer.cpp test: Remove using namespace in header files 2021-10-15 05:05:43 +03:00
meson.build libcamera: yaml-parser: Differentiate between empty and empty string 2024-09-23 13:03:35 +02:00
message.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
object-delete.cpp libcamera: Drop remaining file name from header comment blocks 2024-05-09 23:31:15 +03:00
object-invoke.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
object.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
pixel-format.cpp libcamera/base: Move utils to the base library 2021-06-25 16:11:02 +01:00
public-api.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
shared-fd.cpp libcamera: Drop remaining file name from header comment blocks 2024-05-09 23:31:15 +03:00
signal-threads.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
signal.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
span.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
threads.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
timer-fail.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
timer-thread.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
timer.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
transform.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
unique-fd.cpp libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
utils.cpp test: utils: Extend utils::hex() test to 8-bit and 16-bit values 2024-07-04 14:03:59 +03:00
yaml-parser.cpp libcamera: yaml-parser: Differentiate between empty and empty string 2024-09-23 13:03:35 +02:00