From 8f08880082472c16a6fdb55c34b05386508d532d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Wed, 27 Mar 2019 20:19:05 +0100 Subject: test: camera: Remove streams argument from configurationValid() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In preparation of reworking how a default configuration is retrieved from a camera remove the streams and validation using the stream when judging if a camera configuration is valid. This is needed as once stream usage hints are added applications will no longer fetch default configuration based on Stream IDs so using them to verify the returned format is not useful. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- test/camera/camera_test.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'test/camera/camera_test.cpp') diff --git a/test/camera/camera_test.cpp b/test/camera/camera_test.cpp index a92f2165..1609c4b0 100644 --- a/test/camera/camera_test.cpp +++ b/test/camera/camera_test.cpp @@ -46,27 +46,18 @@ void CameraTest::cleanup() cm_->stop(); }; -bool CameraTest::configurationValid(const std::set &streams, - const std::map &conf) const +bool CameraTest::configurationValid(const std::map &config) const { - /* Test that the numbers of streams matches that of configuration. */ - if (streams.size() != conf.size()) + /* Test that the configuration is not empty. */ + if (config.empty()) return false; - /* - * Test that stream can be found in configuration and that the - * configuration is valid. - */ - for (Stream *stream : streams) { - std::map::const_iterator it = - conf.find(stream); + /* Test that configuration is valid. */ + for (auto const &it : config) { + const StreamConfiguration &conf = it.second; - if (it == conf.end()) - return false; - - const StreamConfiguration *sconf = &it->second; - if (sconf->width == 0 || sconf->height == 0 || - sconf->pixelFormat == 0 || sconf->bufferCount == 0) + if (conf.width == 0 || conf.height == 0 || + conf.pixelFormat == 0 || conf.bufferCount == 0) return false; } -- cgit v1.2.1