From patchwork Fri Jun 21 16:13:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 1497 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 70A01615BC for ; Fri, 21 Jun 2019 18:14:07 +0200 (CEST) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 257C6E0C; Fri, 21 Jun 2019 18:14:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1561133647; bh=5UShzsoGre4Oq/mg2zHBbXwtxijEO5sZqG6gmeHMtZ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r46r1QKU165tayPaQNd22ozdjW+y68CEUUsFyD1AkxoCcNBZKcumSEBvwAWPMQCMt PhuFb7kZ5X3kkalWhi0rzeLox4wWLNx/DOwX7EwSBfKacLN3v+cSbFid+9dwlKeOC/ sn/St+mWSDWE33L4yzIQI8Uitj+qdiBg1g9PKMYI= From: Kieran Bingham To: LibCamera Devel Date: Fri, 21 Jun 2019 17:13:56 +0100 Message-Id: <20190621161401.28337-5-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190621161401.28337-1-kieran.bingham@ideasonboard.com> References: <20190621161401.28337-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v2 4/9] libcamera: test: Add ControlInfo tests X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 16:14:07 -0000 Provide an initial test coverage for the ControlInfo class. Signed-off-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- test/controls.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ test/meson.build | 1 + 2 files changed, 41 insertions(+) create mode 100644 test/controls.cpp diff --git a/test/controls.cpp b/test/controls.cpp new file mode 100644 index 000000000000..94e89f270108 --- /dev/null +++ b/test/controls.cpp @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (C) 2019, Google Inc. + * + * controls.cpp - Control tests + */ + +#include + +#include + +#include "test.h" + +using namespace std; +using namespace libcamera; + +class Controls : public Test +{ +protected: + int testControlInfo() + { + ControlInfo gainInfo(ManualGain); + cout << "Gain Info: " << gainInfo << endl; + + return TestPass; + } + + int run() + { + int ret; + + ret = testControlInfo(); + if (ret) + return ret; + + return TestPass; + } +}; + +TEST_REGISTER(Controls) diff --git a/test/meson.build b/test/meson.build index eff541ddc0a6..0b3e6c6813e6 100644 --- a/test/meson.build +++ b/test/meson.build @@ -9,6 +9,7 @@ subdir('v4l2_subdevice') subdir('v4l2_videodevice') public_tests = [ + ['controls', 'controls.cpp'], ['event', 'event.cpp'], ['event-dispatcher', 'event-dispatcher.cpp'], ['geometry', 'geometry.cpp'],