{"id":15956,"url":"https://patchwork.libcamera.org/api/1.1/patches/15956/?format=json","web_url":"https://patchwork.libcamera.org/patch/15956/","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":"<20220518131329.66994-7-tomi.valkeinen@ideasonboard.com>","date":"2022-05-18T13:13:17","name":"[libcamera-devel,v3,06/18] py: unittests: verify that cam and cm are freed","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"f3943f2d41db7a99cf5f5de0338a9bf7bd6658f4","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/1.1/people/109/?format=json","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15956/mbox/","series":[{"id":3122,"url":"https://patchwork.libcamera.org/api/1.1/series/3122/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3122","date":"2022-05-18T13:13:11","name":"Misc Python bindings patches","version":3,"mbox":"https://patchwork.libcamera.org/series/3122/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15956/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15956/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A8238C326D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 May 2022 13:13:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 351EE6566E;\n\tWed, 18 May 2022 15:13:57 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 78D6B65656\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 15:13:49 +0200 (CEST)","from deskari.lan (91-156-85-209.elisa-laajakaista.fi\n\t[91.156.85.209])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DF4111C13;\n\tWed, 18 May 2022 15:13:48 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652879637;\n\tbh=81cfyWdLmXwVC6nVNluygfhKfJMgfSkSf0jP/R91RlA=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=qqd/3E0P7CE61EJQDnKKPC38fYPpFob7ArlOYLqPguFgYfb0maRtM+T0OD7uK8AX3\n\twV+awMSfcy/2oLU8UWnn0H1AZCDVrw73uASjMJqZrzGLFQTaq67fGBpltks6nqxsZV\n\t4d4HbhjuTG3sKEEOCGraMrp3RzqfvgdMsckMS/MpLR3kM82nl68yYZHvgAbizOeAH+\n\tOCFQrAaVPo1NeWnZYiQbjrL4EhZWIUQqo0/RfB9aQZLQDJGufRSftxu1JwHh308IML\n\tNzk3GNp2oaBFS+iBl26PB7morUB7s8lm8r3PIuzif/E6gzYe2TvAwA99zA8vvJcTa/\n\tbdT3q9cIVcJxw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652879629;\n\tbh=81cfyWdLmXwVC6nVNluygfhKfJMgfSkSf0jP/R91RlA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=tsTPgqv/5P7aN1LYT+zHRZ7NujZluwuKRTVXsgwa7B/SVEOhQiFfeFpFANbF8fEmA\n\tvcw8Za5bbnz/WRMLVVkk/gm0hhf1U3MwWQkDvVaUDyC1U7jG6j6WXK2MpMK+pXjPzL\n\tl4nhYWoxwsFPqibDQFrwgHos9uxzFtIecNkyjEgg="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"tsTPgqv/\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tJacopo Mondi <jacopo@jmondi.org>","Date":"Wed, 18 May 2022 16:13:17 +0300","Message-Id":"<20220518131329.66994-7-tomi.valkeinen@ideasonboard.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20220518131329.66994-1-tomi.valkeinen@ideasonboard.com>","References":"<20220518131329.66994-1-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 06/18] py: unittests: verify that cam\n\tand cm are freed","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>","From":"Tomi Valkeinen via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add checks to CameraTesterBase to verify that both the Camera and the\nCameraManager gets freed.\n\nSigned-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n test/py/unittests.py | 6 ++++++\n 1 file changed, 6 insertions(+)","diff":"diff --git a/test/py/unittests.py b/test/py/unittests.py\nindex 9326358d..4c214f0a 100755\n--- a/test/py/unittests.py\n+++ b/test/py/unittests.py\n@@ -83,6 +83,9 @@ class CameraTesterBase(BaseTestCase):\n             self.cm = None\n             raise Exception('Failed to acquire camera')\n \n+        self.wr_cam = weakref.ref(self.cam)\n+        self.wr_cm = weakref.ref(self.cm)\n+\n     def tearDown(self):\n         # If a test fails, the camera may be in running state. So always stop.\n         self.cam.stop()\n@@ -94,6 +97,9 @@ class CameraTesterBase(BaseTestCase):\n         self.cam = None\n         self.cm = None\n \n+        self.assertIsNone(self.wr_cm())\n+        self.assertIsNone(self.wr_cam())\n+\n \n class AllocatorTestMethods(CameraTesterBase):\n     def test_allocator(self):\n","prefixes":["libcamera-devel","v3","06/18"]}