{"id":579,"url":"https://patchwork.libcamera.org/api/patches/579/?format=json","web_url":"https://patchwork.libcamera.org/patch/579/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20190213171453.13852-2-kieran.bingham@ideasonboard.com>","date":"2019-02-13T17:14:51","name":"[libcamera-devel,v3,1/3] test: v4l2_device: Rename dev_ to capture_","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"63d11c99365bc8ac6b9735ed5937d557b683b81c","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/579/mbox/","series":[{"id":182,"url":"https://patchwork.libcamera.org/api/series/182/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=182","date":"2019-02-13T17:14:50","name":"libcamera: test: buffer_sharing","version":3,"mbox":"https://patchwork.libcamera.org/series/182/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/579/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/579/checks/","tags":{},"headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D257F610B6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Feb 2019 18:14:57 +0100 (CET)","from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5D4745B6;\n\tWed, 13 Feb 2019 18:14:57 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1550078097;\n\tbh=l8MbF2Ys9LogWotJpBSBJCl1Ro3djByisYylRCYDqv0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=JON5taaf/wmOsfF8BYgPQFJ4dPRaW6MNCBQXC6d1qf7TvVjJFxH7d2LsDcMgJs1k2\n\tPuVDwnMDgsJ8VcxXz2webvoqi4ZtTf3yQAVsuifXAEALItigM45EFV15plwOpk8foD\n\tOnp8O1ydNJiXWAsHOGohOqVsVwrW+z1WEhSuIS9o=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Date":"Wed, 13 Feb 2019 17:14:51 +0000","Message-Id":"<20190213171453.13852-2-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.19.1","In-Reply-To":"<20190213171453.13852-1-kieran.bingham@ideasonboard.com>","References":"<20190213171453.13852-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 1/3] test: v4l2_device: Rename dev_ to\n\tcapture_","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Wed, 13 Feb 2019 17:14:58 -0000"},"content":"Change the variable name globally throughout the tests.\n\nRepair the V4L2DeviceTest constructor style, as checkstyle complained.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n test/v4l2_device/capture_async.cpp    | 12 ++++++------\n test/v4l2_device/double_open.cpp      |  4 ++--\n test/v4l2_device/request_buffers.cpp  |  2 +-\n test/v4l2_device/stream_on_off.cpp    |  6 +++---\n test/v4l2_device/v4l2_device_test.cpp |  8 ++++----\n test/v4l2_device/v4l2_device_test.h   |  7 +++++--\n 6 files changed, 21 insertions(+), 18 deletions(-)","diff":"diff --git a/test/v4l2_device/capture_async.cpp b/test/v4l2_device/capture_async.cpp\nindex 511368d6b53d..2a41b11e95e7 100644\n--- a/test/v4l2_device/capture_async.cpp\n+++ b/test/v4l2_device/capture_async.cpp\n@@ -26,7 +26,7 @@ public:\n \t\tframes++;\n \n \t\t/* Requeue the buffer for further use. */\n-\t\tdev_->queueBuffer(buffer);\n+\t\tcapture_->queueBuffer(buffer);\n \t}\n \n protected:\n@@ -40,19 +40,19 @@ protected:\n \n \t\tpool_.createBuffers(bufferCount);\n \n-\t\tret = dev_->exportBuffers(&pool_);\n+\t\tret = capture_->exportBuffers(&pool_);\n \t\tif (ret)\n \t\t\treturn TestFail;\n \n-\t\tdev_->bufferReady.connect(this, &CaptureAsyncTest::receiveBuffer);\n+\t\tcapture_->bufferReady.connect(this, &CaptureAsyncTest::receiveBuffer);\n \n \t\t/* Queue all the buffers to the device. */\n \t\tfor (Buffer &b : pool_.buffers()) {\n-\t\t\tif (dev_->queueBuffer(&b))\n+\t\t\tif (capture_->queueBuffer(&b))\n \t\t\t\treturn TestFail;\n \t\t}\n \n-\t\tret = dev_->streamOn();\n+\t\tret = capture_->streamOn();\n \t\tif (ret)\n \t\t\treturn TestFail;\n \n@@ -75,7 +75,7 @@ protected:\n \n \t\tstd::cout << \"Processed \" << frames << \" frames\" << std::endl;\n \n-\t\tret = dev_->streamOff();\n+\t\tret = capture_->streamOff();\n \t\tif (ret)\n \t\t\treturn TestFail;\n \ndiff --git a/test/v4l2_device/double_open.cpp b/test/v4l2_device/double_open.cpp\nindex ca2b201454a4..7ec80a60f57e 100644\n--- a/test/v4l2_device/double_open.cpp\n+++ b/test/v4l2_device/double_open.cpp\n@@ -22,10 +22,10 @@ protected:\n \t\t * Expect failure: The device has already been opened by the\n \t\t * V4L2DeviceTest base class\n \t\t */\n-\t\tret = dev_->open();\n+\t\tret = capture_->open();\n \t\tif (!ret) {\n \t\t\tstd::cout << \"Double open erroneously succeeded\" << std::endl;\n-\t\t\tdev_->close();\n+\t\t\tcapture_->close();\n \t\t\treturn TestFail;\n \t\t}\n \ndiff --git a/test/v4l2_device/request_buffers.cpp b/test/v4l2_device/request_buffers.cpp\nindex 26d7d9528982..938d4f85d5a1 100644\n--- a/test/v4l2_device/request_buffers.cpp\n+++ b/test/v4l2_device/request_buffers.cpp\n@@ -21,7 +21,7 @@ protected:\n \n \t\tpool_.createBuffers(bufferCount);\n \n-\t\tint ret = dev_->exportBuffers(&pool_);\n+\t\tint ret = capture_->exportBuffers(&pool_);\n \t\tif (ret)\n \t\t\treturn TestFail;\n \ndiff --git a/test/v4l2_device/stream_on_off.cpp b/test/v4l2_device/stream_on_off.cpp\nindex 861d8d695813..ea1b3f5bd5a4 100644\n--- a/test/v4l2_device/stream_on_off.cpp\n+++ b/test/v4l2_device/stream_on_off.cpp\n@@ -16,15 +16,15 @@ protected:\n \n \t\tpool_.createBuffers(bufferCount);\n \n-\t\tint ret = dev_->exportBuffers(&pool_);\n+\t\tint ret = capture_->exportBuffers(&pool_);\n \t\tif (ret)\n \t\t\treturn TestFail;\n \n-\t\tret = dev_->streamOn();\n+\t\tret = capture_->streamOn();\n \t\tif (ret)\n \t\t\treturn TestFail;\n \n-\t\tret = dev_->streamOff();\n+\t\tret = capture_->streamOff();\n \t\tif (ret)\n \t\t\treturn TestFail;\n \ndiff --git a/test/v4l2_device/v4l2_device_test.cpp b/test/v4l2_device/v4l2_device_test.cpp\nindex a2a7ba82612d..2bdf8cfe983a 100644\n--- a/test/v4l2_device/v4l2_device_test.cpp\n+++ b/test/v4l2_device/v4l2_device_test.cpp\n@@ -52,16 +52,16 @@ int V4L2DeviceTest::init()\n \tif (!entity)\n \t\treturn TestSkip;\n \n-\tdev_ = new V4L2Device(entity);\n-\tif (!dev_)\n+\tcapture_ = new V4L2Device(entity);\n+\tif (!capture_)\n \t\treturn TestFail;\n \n-\treturn dev_->open();\n+\treturn capture_->open();\n }\n \n void V4L2DeviceTest::cleanup()\n {\n \tmedia_->release();\n \n-\tdelete dev_;\n+\tdelete capture_;\n };\ndiff --git a/test/v4l2_device/v4l2_device_test.h b/test/v4l2_device/v4l2_device_test.h\nindex 43539655f85b..c476d3c05e79 100644\n--- a/test/v4l2_device/v4l2_device_test.h\n+++ b/test/v4l2_device/v4l2_device_test.h\n@@ -22,7 +22,10 @@ using namespace libcamera;\n class V4L2DeviceTest : public Test\n {\n public:\n-\tV4L2DeviceTest() : dev_(nullptr){};\n+\tV4L2DeviceTest()\n+\t\t: capture_(nullptr)\n+\t{\n+\t}\n \n protected:\n \tint init();\n@@ -30,7 +33,7 @@ protected:\n \n \tstd::unique_ptr<DeviceEnumerator> enumerator_;\n \tstd::shared_ptr<MediaDevice> media_;\n-\tV4L2Device *dev_;\n+\tV4L2Device *capture_;\n \tBufferPool pool_;\n };\n \n","prefixes":["libcamera-devel","v3","1/3"]}