From patchwork Tue Oct 5 07:31:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14050 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E3843BDC71 for ; Tue, 5 Oct 2021 07:31:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A2B96691BE; Tue, 5 Oct 2021 09:31:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="MNr7jyIz"; dkim-atps=neutral Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C195B691AD for ; Tue, 5 Oct 2021 09:31:35 +0200 (CEST) Received: by mail-pg1-x52b.google.com with SMTP id e7so18994520pgk.2 for ; Tue, 05 Oct 2021 00:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F1tp93JtwZl0N6lNbF8v2MAO1RuA4bBN2LbhDqet+bs=; b=MNr7jyIz2iJNrdwl8xlrrDS0wYbBY5MHq7jOQA/N8UeeUbiuOlWHkZG0PD9CZwWkgh Yom0aA4pmUyjoEDlmq5oHwKu/lIHx4ph64GWtidvxQMBZ6+1Ju+x14hQDdUrzrlR+4JX JcKABKeO2aC+9BSWJcw3EfjbluMsk9CR7Sq+Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F1tp93JtwZl0N6lNbF8v2MAO1RuA4bBN2LbhDqet+bs=; b=WkPWGheJztdIWVJB0D6gGLKPMa7dtvZqmupl5/aKqS08nRpuITIaop6QWofTLwi1Nl NrYorWIpsjdeT5uB+FQaW9ZYNS1/zC93Tf3ejpwtKJ2gGGD+DgjzDSzwFFKW48+9ccRE 7uLeoSntGMSXrv2bcmhPrqDfAeDaHNwEoiRrN26DMnQNx9VsFymTcn9R0uvyVarcvbgl TOqwycSxpK1Nc9DEMsZmoi/e6ZqHalOJG+3MAZuuD8pgYfFfuE01/IZaV6Kui335wej0 9oBt3fDInVa8lZMVf21pri+9WlT66/PI1pG4qovthnRjR6I/sO+eLvAET+phtAVwdULe x9hg== X-Gm-Message-State: AOAM533vmgLf5jbdOTzbUd+GSgkBc80r/LmwR00bUxbZvRA4h5uCcKNc 9I+QkrhotS5g7cAC6YkhWzwa7b5PU3v9Kg== X-Google-Smtp-Source: ABdhPJzi2Sc5jvknd/TrAQBgI92t7EhJkNMpbIViAqHSuxS4/5DpFYEPtC3apgKzOOjqUMsXcEDSKw== X-Received: by 2002:aa7:8f12:0:b0:44c:833f:9dad with SMTP id x18-20020aa78f12000000b0044c833f9dadmr1355864pfr.35.1633419093936; Tue, 05 Oct 2021 00:31:33 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:debc:d0db:3bd8:f961]) by smtp.gmail.com with ESMTPSA id o14sm16761812pfh.145.2021.10.05.00.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 00:31:33 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Tue, 5 Oct 2021 16:31:14 +0900 Message-Id: <20211005073114.3997303-7-hiroh@chromium.org> X-Mailer: git-send-email 2.33.0.800.g4c38ced690-goog In-Reply-To: <20211005073114.3997303-1-hiroh@chromium.org> References: <20211005073114.3997303-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 6/6] test: Remove using namespace in header files X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" "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 Reviewed-by: Laurent Pinchart --- test/camera/camera_reconfigure.cpp | 1 + test/camera/capture.cpp | 1 + test/camera/configuration_default.cpp | 1 + test/camera/configuration_set.cpp | 1 + test/camera/statemachine.cpp | 1 + test/gstreamer/gstreamer_test.h | 2 -- test/libtest/buffer_source.cpp | 2 ++ test/libtest/buffer_source.h | 10 ++++------ test/libtest/camera_test.h | 6 ++---- test/mapped-buffer.cpp | 1 + test/media_device/media_device_test.h | 6 ++---- test/serialization/serialization_test.h | 10 ++++------ test/v4l2_subdevice/v4l2_subdevice_test.h | 8 +++----- test/v4l2_videodevice/buffer_sharing.cpp | 2 ++ test/v4l2_videodevice/capture_async.cpp | 2 ++ test/v4l2_videodevice/v4l2_videodevice_test.h | 14 ++++++-------- 16 files changed, 33 insertions(+), 35 deletions(-) diff --git a/test/camera/camera_reconfigure.cpp b/test/camera/camera_reconfigure.cpp index 48d61c00..0fd8ab70 100644 --- a/test/camera/camera_reconfigure.cpp +++ b/test/camera/camera_reconfigure.cpp @@ -21,6 +21,7 @@ #include "camera_test.h" #include "test.h" +using namespace libcamera; using namespace std; namespace { diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp index 238d98db..41ae00d7 100644 --- a/test/camera/capture.cpp +++ b/test/camera/capture.cpp @@ -16,6 +16,7 @@ #include "camera_test.h" #include "test.h" +using namespace libcamera; using namespace std; namespace { diff --git a/test/camera/configuration_default.cpp b/test/camera/configuration_default.cpp index c2b20194..209eb6a5 100644 --- a/test/camera/configuration_default.cpp +++ b/test/camera/configuration_default.cpp @@ -10,6 +10,7 @@ #include "camera_test.h" #include "test.h" +using namespace libcamera; using namespace std; namespace { diff --git a/test/camera/configuration_set.cpp b/test/camera/configuration_set.cpp index a1dc446a..4281a1c4 100644 --- a/test/camera/configuration_set.cpp +++ b/test/camera/configuration_set.cpp @@ -10,6 +10,7 @@ #include "camera_test.h" #include "test.h" +using namespace libcamera; using namespace std; namespace { diff --git a/test/camera/statemachine.cpp b/test/camera/statemachine.cpp index 26fb5ca1..9c2b0c6a 100644 --- a/test/camera/statemachine.cpp +++ b/test/camera/statemachine.cpp @@ -12,6 +12,7 @@ #include "camera_test.h" #include "test.h" +using namespace libcamera; using namespace std; namespace { diff --git a/test/gstreamer/gstreamer_test.h b/test/gstreamer/gstreamer_test.h index 9c50e288..ccfe0b92 100644 --- a/test/gstreamer/gstreamer_test.h +++ b/test/gstreamer/gstreamer_test.h @@ -17,8 +17,6 @@ #include -using namespace std; - class GstreamerTest { public: diff --git a/test/libtest/buffer_source.cpp b/test/libtest/buffer_source.cpp index 64e7376a..1b261697 100644 --- a/test/libtest/buffer_source.cpp +++ b/test/libtest/buffer_source.cpp @@ -14,6 +14,8 @@ #include "test.h" +using namespace libcamera; + BufferSource::BufferSource() { } diff --git a/test/libtest/buffer_source.h b/test/libtest/buffer_source.h index 14b4770e..84e2fa8f 100644 --- a/test/libtest/buffer_source.h +++ b/test/libtest/buffer_source.h @@ -12,20 +12,18 @@ #include "libcamera/internal/media_device.h" #include "libcamera/internal/v4l2_videodevice.h" -using namespace libcamera; - class BufferSource { public: BufferSource(); ~BufferSource(); - int allocate(const StreamConfiguration &config); - const std::vector> &buffers(); + int allocate(const libcamera::StreamConfiguration &config); + const std::vector> &buffers(); private: - std::shared_ptr media_; - std::vector> buffers_; + std::shared_ptr media_; + std::vector> buffers_; }; #endif /* __LIBCAMERA_BUFFER_SOURCE_TEST_H__ */ diff --git a/test/libtest/camera_test.h b/test/libtest/camera_test.h index f56e343e..23122245 100644 --- a/test/libtest/camera_test.h +++ b/test/libtest/camera_test.h @@ -12,8 +12,6 @@ #include #include -using namespace libcamera; - class CameraTest { public: @@ -21,8 +19,8 @@ public: ~CameraTest(); protected: - CameraManager *cm_; - std::shared_ptr camera_; + libcamera::CameraManager *cm_; + std::shared_ptr camera_; int status_; }; diff --git a/test/mapped-buffer.cpp b/test/mapped-buffer.cpp index 97571945..b4422f7d 100644 --- a/test/mapped-buffer.cpp +++ b/test/mapped-buffer.cpp @@ -14,6 +14,7 @@ #include "camera_test.h" #include "test.h" +using namespace libcamera; using namespace std; namespace { diff --git a/test/media_device/media_device_test.h b/test/media_device/media_device_test.h index 0c8bf9f2..a88de56c 100644 --- a/test/media_device/media_device_test.h +++ b/test/media_device/media_device_test.h @@ -14,8 +14,6 @@ #include "test.h" -using namespace libcamera; - class MediaDeviceTest : public Test { public: @@ -25,10 +23,10 @@ public: protected: int init(); - std::shared_ptr media_; + std::shared_ptr media_; private: - std::unique_ptr enumerator_; + std::unique_ptr enumerator_; }; #endif /* __LIBCAMERA_MEDIADEVICE_TEST_H__ */ diff --git a/test/serialization/serialization_test.h b/test/serialization/serialization_test.h index f51ae546..d654c7bf 100644 --- a/test/serialization/serialization_test.h +++ b/test/serialization/serialization_test.h @@ -14,8 +14,6 @@ #include "camera_test.h" #include "test.h" -using namespace libcamera; - class SerializationTest : public CameraTest, public Test { public: @@ -24,10 +22,10 @@ public: { } - static bool equals(const ControlInfoMap &lhs, - const ControlInfoMap &rhs); - static bool equals(const ControlList &lhs, - const ControlList &rhs); + static bool equals(const libcamera::ControlInfoMap &lhs, + const libcamera::ControlInfoMap &rhs); + static bool equals(const libcamera::ControlList &lhs, + const libcamera::ControlList &rhs); }; #endif /* __LIBCAMERA_SERIALIZATION_TEST_H__ */ diff --git a/test/v4l2_subdevice/v4l2_subdevice_test.h b/test/v4l2_subdevice/v4l2_subdevice_test.h index e981abf7..83beb6a2 100644 --- a/test/v4l2_subdevice/v4l2_subdevice_test.h +++ b/test/v4l2_subdevice/v4l2_subdevice_test.h @@ -16,8 +16,6 @@ #include "test.h" -using namespace libcamera; - class V4L2SubdeviceTest : public Test { public: @@ -30,9 +28,9 @@ protected: int init() override; void cleanup() override; - std::unique_ptr enumerator_; - std::shared_ptr media_; - V4L2Subdevice *scaler_; + std::unique_ptr enumerator_; + std::shared_ptr media_; + libcamera::V4L2Subdevice *scaler_; }; #endif /* __LIBCAMERA_V4L2_SUBDEVICE_TEST_H__ */ diff --git a/test/v4l2_videodevice/buffer_sharing.cpp b/test/v4l2_videodevice/buffer_sharing.cpp index 6af96a98..75ee93ce 100644 --- a/test/v4l2_videodevice/buffer_sharing.cpp +++ b/test/v4l2_videodevice/buffer_sharing.cpp @@ -20,6 +20,8 @@ #include "v4l2_videodevice_test.h" +using namespace libcamera; + class BufferSharingTest : public V4L2VideoDeviceTest { public: diff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp index 805cb610..3aa4ca0b 100644 --- a/test/v4l2_videodevice/capture_async.cpp +++ b/test/v4l2_videodevice/capture_async.cpp @@ -15,6 +15,8 @@ #include "v4l2_videodevice_test.h" +using namespace libcamera; + class CaptureAsyncTest : public V4L2VideoDeviceTest { public: diff --git a/test/v4l2_videodevice/v4l2_videodevice_test.h b/test/v4l2_videodevice/v4l2_videodevice_test.h index d46540d4..e7762294 100644 --- a/test/v4l2_videodevice/v4l2_videodevice_test.h +++ b/test/v4l2_videodevice/v4l2_videodevice_test.h @@ -19,8 +19,6 @@ #include "test.h" -using namespace libcamera; - class V4L2VideoDeviceTest : public Test { public: @@ -36,12 +34,12 @@ protected: std::string driver_; std::string entity_; - std::unique_ptr enumerator_; - std::shared_ptr media_; - CameraSensor *sensor_; - V4L2Subdevice *debayer_; - V4L2VideoDevice *capture_; - std::vector> buffers_; + std::unique_ptr enumerator_; + std::shared_ptr media_; + libcamera::CameraSensor *sensor_; + libcamera::V4L2Subdevice *debayer_; + libcamera::V4L2VideoDevice *capture_; + std::vector> buffers_; }; #endif /* __LIBCAMERA_V4L2_DEVICE_TEST_H_ */