test: Convert to pragma once

Remove the verbose #ifndef/#define/#endif pattern for maintaining
header idempotency, and replace it with a simple #pragma once.

This simplifies the headers, and prevents redundant changes when
header files get moved.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
This commit is contained in:
Kieran Bingham 2021-11-23 17:23:07 +00:00
parent 4f32b0815e
commit 2698597994
8 changed files with 14 additions and 32 deletions

View file

@ -5,8 +5,7 @@
* gstreamer_test.cpp - GStreamer test base class * gstreamer_test.cpp - GStreamer test base class
*/ */
#ifndef __LIBCAMERA_GSTREAMER_TEST_H__ #pragma once
#define __LIBCAMERA_GSTREAMER_TEST_H__
#include <iostream> #include <iostream>
#include <unistd.h> #include <unistd.h>
@ -33,5 +32,3 @@ protected:
GstElement *libcameraSrc_; GstElement *libcameraSrc_;
int status_; int status_;
}; };
#endif /* __LIBCAMERA_GSTREAMER_TEST_H__ */

View file

@ -4,8 +4,8 @@
* *
* buffer_source.h - libcamera camera test helper to create FrameBuffers * buffer_source.h - libcamera camera test helper to create FrameBuffers
*/ */
#ifndef __LIBCAMERA_BUFFER_SOURCE_TEST_H__
#define __LIBCAMERA_BUFFER_SOURCE_TEST_H__ #pragma once
#include <libcamera/stream.h> #include <libcamera/stream.h>
@ -25,5 +25,3 @@ private:
std::shared_ptr<libcamera::MediaDevice> media_; std::shared_ptr<libcamera::MediaDevice> media_;
std::vector<std::unique_ptr<libcamera::FrameBuffer>> buffers_; std::vector<std::unique_ptr<libcamera::FrameBuffer>> buffers_;
}; };
#endif /* __LIBCAMERA_BUFFER_SOURCE_TEST_H__ */

View file

@ -4,8 +4,8 @@
* *
* camera_test.h - libcamera camera test base class * camera_test.h - libcamera camera test base class
*/ */
#ifndef __LIBCAMERA_CAMERA_TEST_H__
#define __LIBCAMERA_CAMERA_TEST_H__ #pragma once
#include <memory> #include <memory>
@ -23,5 +23,3 @@ protected:
std::shared_ptr<libcamera::Camera> camera_; std::shared_ptr<libcamera::Camera> camera_;
int status_; int status_;
}; };
#endif /* __LIBCAMERA_CAMERA_TEST_H__ */

View file

@ -4,8 +4,8 @@
* *
* test.h - libcamera test base class * test.h - libcamera test base class
*/ */
#ifndef __TEST_TEST_H__
#define __TEST_TEST_H__ #pragma once
#include <sstream> #include <sstream>
@ -34,5 +34,3 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char *argv[]) \
{ \ { \
return klass().execute(); \ return klass().execute(); \
} }
#endif /* __TEST_TEST_H__ */

View file

@ -4,8 +4,8 @@
* *
* media_device_test.h - libcamera media device test base class * media_device_test.h - libcamera media device test base class
*/ */
#ifndef __LIBCAMERA_MEDIADEVICE_TEST_H__
#define __LIBCAMERA_MEDIADEVICE_TEST_H__ #pragma once
#include <memory> #include <memory>
@ -28,5 +28,3 @@ protected:
private: private:
std::unique_ptr<libcamera::DeviceEnumerator> enumerator_; std::unique_ptr<libcamera::DeviceEnumerator> enumerator_;
}; };
#endif /* __LIBCAMERA_MEDIADEVICE_TEST_H__ */

View file

@ -4,8 +4,8 @@
* *
* serialization_test.h - Base class for serialization tests * serialization_test.h - Base class for serialization tests
*/ */
#ifndef __LIBCAMERA_SERIALIZATION_TEST_H__
#define __LIBCAMERA_SERIALIZATION_TEST_H__ #pragma once
#include <libcamera/camera.h> #include <libcamera/camera.h>
#include <libcamera/camera_manager.h> #include <libcamera/camera_manager.h>
@ -27,5 +27,3 @@ public:
static bool equals(const libcamera::ControlList &lhs, static bool equals(const libcamera::ControlList &lhs,
const libcamera::ControlList &rhs); const libcamera::ControlList &rhs);
}; };
#endif /* __LIBCAMERA_SERIALIZATION_TEST_H__ */

View file

@ -5,8 +5,7 @@
* v4l2_subdevice_test.h - VIMC-based V4L2 subdevice test * v4l2_subdevice_test.h - VIMC-based V4L2 subdevice test
*/ */
#ifndef __LIBCAMERA_V4L2_SUBDEVICE_TEST_H__ #pragma once
#define __LIBCAMERA_V4L2_SUBDEVICE_TEST_H__
#include <libcamera/framebuffer.h> #include <libcamera/framebuffer.h>
@ -32,5 +31,3 @@ protected:
std::shared_ptr<libcamera::MediaDevice> media_; std::shared_ptr<libcamera::MediaDevice> media_;
libcamera::V4L2Subdevice *scaler_; libcamera::V4L2Subdevice *scaler_;
}; };
#endif /* __LIBCAMERA_V4L2_SUBDEVICE_TEST_H__ */

View file

@ -4,8 +4,8 @@
* *
* vl42device_test.h - libcamera v4l2device test base class * vl42device_test.h - libcamera v4l2device test base class
*/ */
#ifndef __LIBCAMERA_V4L2_DEVICE_TEST_H_
#define __LIBCAMERA_V4L2_DEVICE_TEST_H_ #pragma once
#include <memory> #include <memory>
@ -41,5 +41,3 @@ protected:
libcamera::V4L2VideoDevice *capture_; libcamera::V4L2VideoDevice *capture_;
std::vector<std::unique_ptr<libcamera::FrameBuffer>> buffers_; std::vector<std::unique_ptr<libcamera::FrameBuffer>> buffers_;
}; };
#endif /* __LIBCAMERA_V4L2_DEVICE_TEST_H_ */