summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-27 00:36:13 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-08-25 02:58:04 +0300
commitdbafe16da7a9999ec77da21a42537702fb87f124 (patch)
treebf195d3f0feee0efc714267f70d85bfc54b8c63c /test
parent3ef378731ad89de4dd77e0cb79860cc86676060e (diff)
meson: Remove -Wno-unused-parameter
We build libcamera with -Wno-unused-parameter and this doesn't cause much issue internally. However, it prevents catching unused parameters in inline functions defined in public headers. This can lead to compilation warnings for applications compiled without -Wno-unused-parameter. To catch those issues, remove -Wno-unused-parameter and fix all the related warnings with [[maybe_unused]]. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'test')
-rw-r--r--test/camera/buffer_import.cpp3
-rw-r--r--test/camera/capture.cpp3
-rw-r--r--test/hotplug-cameras.cpp4
-rw-r--r--test/ipa/ipa_wrappers_test.cpp4
-rw-r--r--test/libtest/test.h2
-rw-r--r--test/log/log_process.cpp3
-rw-r--r--test/object-invoke.cpp2
-rw-r--r--test/process/process_test.cpp3
-rw-r--r--test/timer-thread.cpp2
-rw-r--r--test/timer.cpp2
10 files changed, 16 insertions, 12 deletions
diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp
index 97a85827..d57ffa75 100644
--- a/test/camera/buffer_import.cpp
+++ b/test/camera/buffer_import.cpp
@@ -33,7 +33,8 @@ public:
}
protected:
- void bufferComplete(Request *request, FrameBuffer *buffer)
+ void bufferComplete([[maybe_unused]] Request *request,
+ FrameBuffer *buffer)
{
if (buffer->metadata().status != FrameMetadata::FrameSuccess)
return;
diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp
index 0fe3bf9b..eb67bf2d 100644
--- a/test/camera/capture.cpp
+++ b/test/camera/capture.cpp
@@ -26,7 +26,8 @@ protected:
unsigned int completeBuffersCount_;
unsigned int completeRequestsCount_;
- void bufferComplete(Request *request, FrameBuffer *buffer)
+ void bufferComplete([[maybe_unused]] Request *request,
+ FrameBuffer *buffer)
{
if (buffer->metadata().status != FrameMetadata::FrameSuccess)
return;
diff --git a/test/hotplug-cameras.cpp b/test/hotplug-cameras.cpp
index 6a94535f..7d551eeb 100644
--- a/test/hotplug-cameras.cpp
+++ b/test/hotplug-cameras.cpp
@@ -26,12 +26,12 @@ using namespace libcamera;
class HotplugTest : public Test
{
protected:
- void cameraAddedHandler(std::shared_ptr<Camera> cam)
+ void cameraAddedHandler([[maybe_unused]] std::shared_ptr<Camera> cam)
{
cameraAdded_ = true;
}
- void cameraRemovedHandler(std::shared_ptr<Camera> cam)
+ void cameraRemovedHandler([[maybe_unused]] std::shared_ptr<Camera> cam)
{
cameraRemoved_ = true;
}
diff --git a/test/ipa/ipa_wrappers_test.cpp b/test/ipa/ipa_wrappers_test.cpp
index 23c799da..59d991cb 100644
--- a/test/ipa/ipa_wrappers_test.cpp
+++ b/test/ipa/ipa_wrappers_test.cpp
@@ -70,8 +70,8 @@ public:
void configure(const CameraSensorInfo &sensorInfo,
const std::map<unsigned int, IPAStream> &streamConfig,
const std::map<unsigned int, const ControlInfoMap &> &entityControls,
- const IPAOperationData &ipaConfig,
- IPAOperationData *result) override
+ [[maybe_unused]] const IPAOperationData &ipaConfig,
+ [[maybe_unused]] IPAOperationData *result) override
{
/* Verify sensorInfo. */
if (sensorInfo.outputSize.width != 2560 ||
diff --git a/test/libtest/test.h b/test/libtest/test.h
index 26d4b94b..8ecf2bda 100644
--- a/test/libtest/test.h
+++ b/test/libtest/test.h
@@ -30,7 +30,7 @@ protected:
};
#define TEST_REGISTER(klass) \
-int main(int argc, char *argv[]) \
+int main([[maybe_unused]] int argc, [[maybe_unused]] char *argv[]) \
{ \
return klass().execute(); \
}
diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp
index d46d5e35..b024f002 100644
--- a/test/log/log_process.cpp
+++ b/test/log/log_process.cpp
@@ -125,7 +125,8 @@ protected:
}
private:
- void procFinished(Process *proc, enum Process::ExitStatus exitStatus, int exitCode)
+ void procFinished([[maybe_unused]] Process *proc,
+ enum Process::ExitStatus exitStatus, int exitCode)
{
exitStatus_ = exitStatus;
exitCode_ = exitCode;
diff --git a/test/object-invoke.cpp b/test/object-invoke.cpp
index 1ae11bb1..f3fd2328 100644
--- a/test/object-invoke.cpp
+++ b/test/object-invoke.cpp
@@ -50,7 +50,7 @@ public:
value_ = value;
}
- void methodWithReference(const int &value)
+ void methodWithReference([[maybe_unused]] const int &value)
{
}
diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp
index 721a7c9d..42a26749 100644
--- a/test/process/process_test.cpp
+++ b/test/process/process_test.cpp
@@ -80,7 +80,8 @@ protected:
}
private:
- void procFinished(Process *proc, enum Process::ExitStatus exitStatus, int exitCode)
+ void procFinished([[maybe_unused]] Process *proc,
+ enum Process::ExitStatus exitStatus, int exitCode)
{
exitStatus_ = exitStatus;
exitCode_ = exitCode;
diff --git a/test/timer-thread.cpp b/test/timer-thread.cpp
index 2f901787..f794d8e7 100644
--- a/test/timer-thread.cpp
+++ b/test/timer-thread.cpp
@@ -40,7 +40,7 @@ public:
}
private:
- void timeoutHandler(Timer *timer)
+ void timeoutHandler([[maybe_unused]] Timer *timer)
{
timeout_ = true;
}
diff --git a/test/timer.cpp b/test/timer.cpp
index 7d5b93c3..537489d7 100644
--- a/test/timer.cpp
+++ b/test/timer.cpp
@@ -57,7 +57,7 @@ public:
}
private:
- void timeoutHandler(Timer *timer)
+ void timeoutHandler([[maybe_unused]] Timer *timer)
{
expiration_ = std::chrono::steady_clock::now();
count_++;