{"id":14744,"url":"https://patchwork.libcamera.org/api/patches/14744/?format=json","web_url":"https://patchwork.libcamera.org/patch/14744/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20211123224015.3619282-14-kieran.bingham@ideasonboard.com>","date":"2021-11-23T22:40:13","name":"[libcamera-devel,13/15] test: Convert to pragma once","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"a3af65eecd17d4693df93fbcb7ec4de534c8960a","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":{"id":11,"url":"https://patchwork.libcamera.org/api/users/11/?format=json","username":"kbingham","first_name":"Kieran","last_name":"Bingham","email":"kieran.bingham@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/14744/mbox/","series":[{"id":2749,"url":"https://patchwork.libcamera.org/api/series/2749/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2749","date":"2021-11-23T22:40:00","name":"Use pragma once","version":1,"mbox":"https://patchwork.libcamera.org/series/2749/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14744/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14744/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id BC111C3251\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Nov 2021 22:40:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6803C6033C;\n\tTue, 23 Nov 2021 23:40:40 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AE4C260121\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Nov 2021 23:40:23 +0100 (CET)","from Monstersaurus.ksquared.org.uk.beta.tailscale.net\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5D827A1B;\n\tTue, 23 Nov 2021 23:40:23 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"M5z15Odp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637707223;\n\tbh=UWRZlXn7Dzj3SpF2i1Lkwew7y5FpgcYwkUGWAlvd/jU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=M5z15OdpNhh+X1GvvMQvI7UWHclgkgUWHtsJKUBrr1d5Jd4KWxR5cDlvFQTho2Qhp\n\tbdWdWfovywiExC5ZYYs2b1kkIcQ0yYA3uDylZtai6CEeYXkP/hq5P75Ra97J+UG6LK\n\tQnF1meI3Oc/z68YfIyZ2HTLEZsZMhNkjHYgpwuvw=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Tue, 23 Nov 2021 22:40:13 +0000","Message-Id":"<20211123224015.3619282-14-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.30.2","In-Reply-To":"<20211123224015.3619282-1-kieran.bingham@ideasonboard.com>","References":"<20211123224015.3619282-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 13/15] test: Convert to pragma once","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Remove the verbose #ifndef/#define/#endif pattern for maintaining\nheader idempotency, and replace it with a simple #pragma once.\n\nThis simplifies the headers, and prevents redundant changes when\nheader files get moved.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n test/gstreamer/gstreamer_test.h               | 5 +----\n test/libtest/buffer_source.h                  | 6 ++----\n test/libtest/camera_test.h                    | 6 ++----\n test/libtest/test.h                           | 6 ++----\n test/media_device/media_device_test.h         | 6 ++----\n test/serialization/serialization_test.h       | 6 ++----\n test/v4l2_subdevice/v4l2_subdevice_test.h     | 5 +----\n test/v4l2_videodevice/v4l2_videodevice_test.h | 6 ++----\n 8 files changed, 14 insertions(+), 32 deletions(-)","diff":"diff --git a/test/gstreamer/gstreamer_test.h b/test/gstreamer/gstreamer_test.h\nindex ccfe0b92e1bb..9869d252c7ba 100644\n--- a/test/gstreamer/gstreamer_test.h\n+++ b/test/gstreamer/gstreamer_test.h\n@@ -5,8 +5,7 @@\n  * gstreamer_test.cpp - GStreamer test base class\n  */\n \n-#ifndef __LIBCAMERA_GSTREAMER_TEST_H__\n-#define __LIBCAMERA_GSTREAMER_TEST_H__\n+#pragma once\n \n #include <iostream>\n #include <unistd.h>\n@@ -33,5 +32,3 @@ protected:\n \tGstElement *libcameraSrc_;\n \tint status_;\n };\n-\n-#endif /* __LIBCAMERA_GSTREAMER_TEST_H__ */\ndiff --git a/test/libtest/buffer_source.h b/test/libtest/buffer_source.h\nindex 84e2fa8f41a0..0cc71aa59478 100644\n--- a/test/libtest/buffer_source.h\n+++ b/test/libtest/buffer_source.h\n@@ -4,8 +4,8 @@\n  *\n  * buffer_source.h - libcamera camera test helper to create FrameBuffers\n  */\n-#ifndef __LIBCAMERA_BUFFER_SOURCE_TEST_H__\n-#define __LIBCAMERA_BUFFER_SOURCE_TEST_H__\n+\n+#pragma once\n \n #include <libcamera/stream.h>\n \n@@ -25,5 +25,3 @@ private:\n \tstd::shared_ptr<libcamera::MediaDevice> media_;\n \tstd::vector<std::unique_ptr<libcamera::FrameBuffer>> buffers_;\n };\n-\n-#endif /* __LIBCAMERA_BUFFER_SOURCE_TEST_H__ */\ndiff --git a/test/libtest/camera_test.h b/test/libtest/camera_test.h\nindex 23122245faf9..0b178bc21a96 100644\n--- a/test/libtest/camera_test.h\n+++ b/test/libtest/camera_test.h\n@@ -4,8 +4,8 @@\n  *\n  * camera_test.h - libcamera camera test base class\n  */\n-#ifndef __LIBCAMERA_CAMERA_TEST_H__\n-#define __LIBCAMERA_CAMERA_TEST_H__\n+\n+#pragma once\n \n #include <memory>\n \n@@ -23,5 +23,3 @@ protected:\n \tstd::shared_ptr<libcamera::Camera> camera_;\n \tint status_;\n };\n-\n-#endif /* __LIBCAMERA_CAMERA_TEST_H__ */\ndiff --git a/test/libtest/test.h b/test/libtest/test.h\nindex 8ecf2bda950f..ee01a22591f8 100644\n--- a/test/libtest/test.h\n+++ b/test/libtest/test.h\n@@ -4,8 +4,8 @@\n  *\n  * test.h - libcamera test base class\n  */\n-#ifndef __TEST_TEST_H__\n-#define __TEST_TEST_H__\n+\n+#pragma once\n \n #include <sstream>\n \n@@ -34,5 +34,3 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char *argv[])\t\\\n {\t\t\t\t\t\t\t\t\t\\\n \treturn klass().execute();\t\t\t\t\t\\\n }\n-\n-#endif /* __TEST_TEST_H__ */\ndiff --git a/test/media_device/media_device_test.h b/test/media_device/media_device_test.h\nindex a88de56c5023..9b226f1a726d 100644\n--- a/test/media_device/media_device_test.h\n+++ b/test/media_device/media_device_test.h\n@@ -4,8 +4,8 @@\n  *\n  * media_device_test.h - libcamera media device test base class\n  */\n-#ifndef __LIBCAMERA_MEDIADEVICE_TEST_H__\n-#define __LIBCAMERA_MEDIADEVICE_TEST_H__\n+\n+#pragma once\n \n #include <memory>\n \n@@ -28,5 +28,3 @@ protected:\n private:\n \tstd::unique_ptr<libcamera::DeviceEnumerator> enumerator_;\n };\n-\n-#endif /* __LIBCAMERA_MEDIADEVICE_TEST_H__ */\ndiff --git a/test/serialization/serialization_test.h b/test/serialization/serialization_test.h\nindex d654c7bfbdfd..609f9fdfc29e 100644\n--- a/test/serialization/serialization_test.h\n+++ b/test/serialization/serialization_test.h\n@@ -4,8 +4,8 @@\n  *\n  * serialization_test.h - Base class for serialization tests\n  */\n-#ifndef __LIBCAMERA_SERIALIZATION_TEST_H__\n-#define __LIBCAMERA_SERIALIZATION_TEST_H__\n+\n+#pragma once\n \n #include <libcamera/camera.h>\n #include <libcamera/camera_manager.h>\n@@ -27,5 +27,3 @@ public:\n \tstatic bool equals(const libcamera::ControlList &lhs,\n \t\t\t   const libcamera::ControlList &rhs);\n };\n-\n-#endif /* __LIBCAMERA_SERIALIZATION_TEST_H__ */\ndiff --git a/test/v4l2_subdevice/v4l2_subdevice_test.h b/test/v4l2_subdevice/v4l2_subdevice_test.h\nindex 83beb6a27eac..e73c583b50ae 100644\n--- a/test/v4l2_subdevice/v4l2_subdevice_test.h\n+++ b/test/v4l2_subdevice/v4l2_subdevice_test.h\n@@ -5,8 +5,7 @@\n  * v4l2_subdevice_test.h - VIMC-based V4L2 subdevice test\n  */\n \n-#ifndef __LIBCAMERA_V4L2_SUBDEVICE_TEST_H__\n-#define __LIBCAMERA_V4L2_SUBDEVICE_TEST_H__\n+#pragma once\n \n #include <libcamera/framebuffer.h>\n \n@@ -32,5 +31,3 @@ protected:\n \tstd::shared_ptr<libcamera::MediaDevice> media_;\n \tlibcamera::V4L2Subdevice *scaler_;\n };\n-\n-#endif /* __LIBCAMERA_V4L2_SUBDEVICE_TEST_H__ */\ndiff --git a/test/v4l2_videodevice/v4l2_videodevice_test.h b/test/v4l2_videodevice/v4l2_videodevice_test.h\nindex e7762294cb3e..d2de1a6de29f 100644\n--- a/test/v4l2_videodevice/v4l2_videodevice_test.h\n+++ b/test/v4l2_videodevice/v4l2_videodevice_test.h\n@@ -4,8 +4,8 @@\n  *\n  * vl42device_test.h - libcamera v4l2device test base class\n  */\n-#ifndef __LIBCAMERA_V4L2_DEVICE_TEST_H_\n-#define __LIBCAMERA_V4L2_DEVICE_TEST_H_\n+\n+#pragma once\n \n #include <memory>\n \n@@ -41,5 +41,3 @@ protected:\n \tlibcamera::V4L2VideoDevice *capture_;\n \tstd::vector<std::unique_ptr<libcamera::FrameBuffer>> buffers_;\n };\n-\n-#endif /* __LIBCAMERA_V4L2_DEVICE_TEST_H_ */\n","prefixes":["libcamera-devel","13/15"]}