From patchwork Sat Jan 4 05:09:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2509 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 4448460608 for ; Sat, 4 Jan 2020 06:10:07 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D9964A49 for ; Sat, 4 Jan 2020 06:10:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1578114607; bh=Fzd4jZSgzcaD4adAa9bjYFqCaUVOdLkOoPsYlANy21A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=C70anl/Sa8O2lTyLlOZOp7DjP4awfqg3zBvSYqyArDq018b4sAwHqAdzi0cjom4Kr xL884avRWeMB+ZSiO5e3psj7Cqc4rM5PUtoETHeuOJqQosgVqzjdf95RXfghc/iPaa RKjgdGghrMFylkTa7g1P8DCI6YfYIt37C/f4s88E= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 4 Jan 2020 07:09:46 +0200 Message-Id: <20200104050947.7673-14-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200104050947.7673-1-laurent.pinchart@ideasonboard.com> References: <20200104050947.7673-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 13/14] test: signal: Test connecting to non-void slots 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: , X-List-Received-Date: Sat, 04 Jan 2020 05:10:08 -0000 Test that a signal can be connected to non-void static and member slots. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- test/signal.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/signal.cpp b/test/signal.cpp index 9d8f985d15e5..0054ed5a380d 100644 --- a/test/signal.cpp +++ b/test/signal.cpp @@ -23,6 +23,11 @@ static void slotStatic(int value) valueStatic_ = value; } +static int slotStaticReturn() +{ + return 0; +} + class SlotObject : public Object { public: @@ -85,6 +90,11 @@ protected: name_ = name; } + int slotReturn() + { + return 0; + } + int init() { return 0; @@ -174,6 +184,13 @@ protected: return TestFail; } + /* + * Test connecting to slots that return a value. This targets + * compilation, there's no need to check runtime results. + */ + signalVoid_.connect(slotStaticReturn); + signalVoid_.connect(this, &SignalTest::slotReturn); + /* ----------------- Signal -> Object tests ----------------- */ /*