{"id":2508,"url":"https://patchwork.libcamera.org/api/1.1/patches/2508/?format=json","web_url":"https://patchwork.libcamera.org/patch/2508/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20200104050947.7673-13-laurent.pinchart@ideasonboard.com>","date":"2020-01-04T05:09:45","name":"[libcamera-devel,12/14] test: object-invoke: Test invoking a non-void method","commit_ref":"1f898ab114d7d4ede335bb01cb218a6f5eaf55ff","pull_url":null,"state":"accepted","archived":false,"hash":"ef40fa9fd003868a26fb29bb76a0424d58121d54","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2508/mbox/","series":[{"id":600,"url":"https://patchwork.libcamera.org/api/1.1/series/600/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=600","date":"2020-01-04T05:09:33","name":"object: Propagate return value of invoked method","version":1,"mbox":"https://patchwork.libcamera.org/series/600/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2508/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2508/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ECFE960623\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  4 Jan 2020 06:10:06 +0100 (CET)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8D7CEFA0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  4 Jan 2020 06:10:06 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1578114606;\n\tbh=w7GKfXnNZ4PbZ7dIcabStmNoViqiYYpWD7OMX60WpJc=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=d3fNiK/OW65JX4oWgWkBpUGYMdqpVuoaW+aeTLnefwqdUvROm1ibQ7PzVpWRuhoFs\n\tgVk56CSms1KPpsS1AlWmh4OgTNvakpLFR3oh6KpWGZNMCb4uF5ISJdN3fVyr7hsMjF\n\t845pYJ+Nrx3vnueZO0P2zC9kBPsY6psyaeU6GYtA=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat,  4 Jan 2020 07:09:45 +0200","Message-Id":"<20200104050947.7673-13-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","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 12/14] test: object-invoke: Test invoking\n\ta non-void method","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>","X-List-Received-Date":"Sat, 04 Jan 2020 05:10:08 -0000"},"content":"Test that Object::invokeMethod() can be used to invoke a non-void\nmethod. Verify that the return value is correctly propagated to the\ncaller.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n test/object-invoke.cpp | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)","diff":"diff --git a/test/object-invoke.cpp b/test/object-invoke.cpp\nindex ed16de99ef5e..8e2055ca620f 100644\n--- a/test/object-invoke.cpp\n+++ b/test/object-invoke.cpp\n@@ -53,6 +53,11 @@ public:\n \t{\n \t}\n \n+\tint methodWithReturn()\n+\t{\n+\t\treturn 42;\n+\t}\n+\n private:\n \tStatus status_;\n \tint value_;\n@@ -152,6 +157,15 @@ protected:\n \t\tobject_.invokeMethod(&InvokedObject::methodWithReference,\n \t\t\t\t     ConnectionTypeBlocking, 42);\n \n+\t\t/* Test invoking a method that returns a value. */\n+\t\tint ret = object_.invokeMethod(&InvokedObject::methodWithReturn,\n+\t\t\t\t\t       ConnectionTypeBlocking);\n+\t\tif (ret != 42) {\n+\t\t\tcout << \"Method invoked return incorrect value (\" << ret\n+\t\t\t     << \")\" << endl;\n+\t\t\treturn TestFail;\n+\t\t}\n+\n \t\treturn TestPass;\n \t}\n \n","prefixes":["libcamera-devel","12/14"]}