libcamera/test
Laurent Pinchart 03526e58d1 tests: gstreamer: Fix compiler error with gcc 8.4.0
The provider g_autoptr variable introduced by commit adb1bbb748
("tests: gstreamer: Test cameras' enumeration from GstDeviceProvider")
is left uninitialized when declared. The cleanup function could thus get
called on an unitialized variable if the scope was exited before the
variable gets initialized. This can't occur here, but gcc 8.4.0 still
complains about it:

/usr/include/glib-2.0/glib/gmacros.h: In member function ‘virtual int GstreamerDeviceProviderTest::run()’:
/usr/include/glib-2.0/glib/gmacros.h:1049:27: error: ‘provider’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     { if (_ptr) (cleanup) ((ParentName *) _ptr); }                                                              \
                           ^
../test/gstreamer/gstreamer_device_provider_test.cpp:37:32: note: ‘provider’ was declared here
   g_autoptr(GstDeviceProvider) provider;

Silence the error by initializing the variable to NULL at declaration
time. This is a good practice in any case, as later refactoring could
otherwise introduce a scope exit before initialization.

Fixes: adb1bbb748 ("tests: gstreamer: Test cameras' enumeration from GstDeviceProvider")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-11 15:58:06 +01:00
..
camera test: camera_reconfigure: Qualify move() with std:: namespace 2022-11-08 17:51:02 +02:00
controls test: controls: control_info_map: Test default constructor 2023-04-20 10:54:12 +01:00
gstreamer tests: gstreamer: Fix compiler error with gcc 8.4.0 2023-07-11 15:58:06 +01:00
ipa ipa: vimc: Add Flags to parameters 2022-10-18 18:52:52 +09:00
ipc test: meson: Use dictionaries instead of arrays to store test information 2022-10-07 17:05:42 +03:00
libtest libcamera: v4l2_videodevice: Reintroduce toV4L2PixelFormat() 2022-08-03 15:07:20 +02:00
log test: meson: Use dictionaries instead of arrays to store test information 2022-10-07 17:05:42 +03:00
media_device test: meson: Use dictionaries instead of arrays to store test information 2022-10-07 17:05:42 +03:00
process test: meson: Use dictionaries instead of arrays to store test information 2022-10-07 17:05:42 +03:00
py py: unittests.py: Fix type checker warnings 2023-06-04 16:10:51 +03:00
serialization test: generated_serializer: Test Flags that is struct member 2022-10-18 18:52:42 +09:00
stream meson: Fix space around colon issues 2023-07-07 11:39:19 +03:00
v4l2_compat test: v4l2_compat: Enable test with ASan 2022-12-24 03:29:43 +02:00
v4l2_subdevice test: meson: Use dictionaries instead of arrays to store test information 2022-10-07 17:05:42 +03:00
v4l2_videodevice test: meson: Use dictionaries instead of arrays to store test information 2022-10-07 17:05:42 +03:00
bayer-format.cpp libcamera: Replace toString with operator<<() for format classes 2022-05-04 14:11:33 +03:00
byte-stream-buffer.cpp test: byte-stream-buffer: Initialize data array 2021-05-26 10:24:15 +02:00
camera-sensor.cpp libcamera: Test sensor's ability to discover ancillary devices 2022-11-24 14:52:00 +00:00
color-space.cpp test: Add a ColorSpace test 2022-08-26 01:04:27 +03:00
delayed_controls.cpp test: delayed_controls: Remove sequenceOffset 2022-07-06 09:03:46 +02:00
event-dispatcher.cpp libcamera: base: timer: Drop start() overload with int argument 2022-03-25 13:11:12 +02:00
event-thread.cpp libcamera: Drop emitter object pointer from signal arguments 2021-09-02 01:16:45 +03:00
event.cpp libcamera: base: timer: Drop start() overload with int argument 2022-03-25 13:11:12 +02:00
fence.cpp libcamera: base: timer: Drop start() overload with int argument 2022-03-25 13:11:12 +02:00
file.cpp test: Replace "/proc/self/exe" with path to test binary 2021-12-01 08:54:24 +02:00
flags.cpp test: Add tests for the Flags class 2021-08-03 10:55:21 +03:00
geometry.cpp libcamera: Replace toString with operator<<() for geometry classes 2022-05-04 14:11:25 +03:00
hotplug-cameras.cpp libcamera: base: timer: Drop start() overload with int argument 2022-03-25 13:11:12 +02:00
mapped-buffer.cpp test: Remove using namespace in header files 2021-10-15 05:05:43 +03:00
meson.build test: Drop pipeline test 2022-12-24 03:29:49 +02:00
message.cpp test: message: Test recursive Thread::dispatchMessages() calls 2021-07-11 17:41:59 +03:00
object-delete.cpp libcamera/base: Move extended base functionality 2021-06-25 16:11:08 +01:00
object-invoke.cpp libcamera/base: Move extended base functionality 2021-06-25 16:11:08 +01:00
object.cpp libcamera/base: Move extended base functionality 2021-06-25 16:11:08 +01:00
pixel-format.cpp libcamera/base: Move utils to the base library 2021-06-25 16:11:02 +01:00
public-api.cpp test: Ensure LIBCAMERA_BASE_PRIVATE isn't public 2021-06-25 16:11:11 +01:00
shared-fd.cpp libcamera: base: shared_fd: Rename fd() to get() 2021-12-04 23:05:07 +02:00
signal-threads.cpp libcamera/base: Move extended base functionality 2021-06-25 16:11:08 +01:00
signal.cpp libcamera: base: object: Prevent the same signal being connected more than once 2022-02-04 10:13:29 +00:00
span.cpp libcamera/base: Move span to base library 2021-06-25 16:11:11 +01:00
threads.cpp test: threads: Test thread cleanup upon abnormal termination 2022-10-04 17:58:00 +03:00
timer-thread.cpp libcamera: base: timer: Drop start() overload with int argument 2022-03-25 13:11:12 +02:00
timer.cpp libcamera: base: timer: Drop start() overload with int argument 2022-03-25 13:11:12 +02:00
unique-fd.cpp test: Add UniqueFD test 2021-12-03 19:20:41 +02:00
utils.cpp libcamera: base: utils: Drop defopt 2022-10-10 17:04:29 +03:00
yaml-parser.cpp libcamera: yaml_parser: Enable YamlObject::get() for int8_t and uint8_t 2022-08-21 21:47:19 +03:00