Commit graph

6 commits

Author SHA1 Message Date
Laurent Pinchart
bc0d9a6f5d test: camera_reconfigure: Qualify move() with std:: namespace
clang-15 warns about unqualified std cast calls:

../../test/camera/camera_reconfigure.cpp:101:24: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
                        requests_.push_back(move(request));
                                            ^
                                            std::

Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-11-08 17:51:02 +02:00
Marvin Schmidt
7354fb3b89 test: camera: Remove redundant call of std::string::c_str()
libcamera::File::exists() takes a const reference to a std::string and
clang-tidy's readability-redundant-string-cstr check warns about it:

> ../test/camera/camera_reconfigure.cpp:182:21: warning: redundant call to 'c_str' [readability-redundant-string-cstr]
>                         if (File::exists(pname.c_str())) {
>                                          ^~~~~~~~~~~~~
>                                          pname

Signed-off-by: Marvin Schmidt <marvin.schmidt1987@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-08-30 15:26:38 +03:00
Laurent Pinchart
54398c1583 libcamera: base: timer: Drop start() overload with int argument
The start(unsigned int msec) overload is error-prone, as the argument
unit can easily be mistaken in callers. Drop it and update all callers
to use the start(std::chrono::milliseconds) overload instead.

The callers now need to use std::chrono_literals. The using statement
could be added to timer.h for convenience, but "using" is discouraged in
header files to avoid namespace pollution. Update the callers instead,
and while at it, sort the "using" statements alphabetically in tests.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-03-25 13:11:12 +02:00
Hirokazu Honda
1526650fc7 test: Remove using namespace in header files
"using namespace" in a header file propagates the namespace to
the files including the header file. So it should be avoided.
This removes "using namespace" in header files in test.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-10-15 05:05:43 +03:00
Laurent Pinchart
eb5c4ead88 libcamera: Use simpler Signal::disconnect() function
When disconnecting a signal from a receiver, it is usually not necessary
to specify the receiver's slot function explicitly, as the signal is
often connected to a single slot for a given receiver. We can thus use a
simpler version of Signal::disconnect() that takes a pointer to the
receiver object only. This reduces code size, as the disconnect()
function is a template function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2021-09-02 01:16:44 +03:00
Umang Jain
e35cae0679 test: camera: Camera reconfiguration and fd-leak test
Development and usage of isolated IPA's has identified bugs in the
transmission of the file descriptors between the pipeline handler and
the IPA through.

Add tests to identify these bugs and prevent regressions.

This tests basically checks for two things:
- Camera reconfigurations without stopping CameraManager
- Fd leaks across IPA IPC boundary [1]

Currently, it uses vimc, but can be easily changed to using another
platform (for e.g. IPU3) by changing kCamId_ and kIpaProxyName_.

The test performs kNumOfReconfigures_ (currently set to 10)
reconfigurations of the camera. Each reconfiguration runs
start(), capture(100ms), stop() of the camera. Hence, the test
runs approximately for 1 second.

For checking the fd leaks, the test monitors the /proc/$PROXY_PID/fd
directory for open fds. It compares the number of open fds after each
run to the number of open fds before the first run. If those two are
found to be mis-matched, the test shall report failure.

The test validates IPA IPC code paths which are used when the IPA is run
in isolated mode. The CameraTest is constructed with the isolate flag
set to enforce this.

[1] https://bugs.libcamera.org/show_bug.cgi?id=63

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-08-19 13:16:15 +05:30