From patchwork Tue Apr 28 18:16:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3597 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DFA3A61AD4 for ; Tue, 28 Apr 2020 20:16:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="cL3/z9ej"; dkim-atps=neutral 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 6E1C097D for ; Tue, 28 Apr 2020 20:16:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1588097814; bh=zDqpu+qaIFcdL1zmm4Y6xSUVso4Rjm7wJOkl353Vw40=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cL3/z9ejXzwsdS5Xc/zBp9XLboMTEdYXM78YCXRkZn3vwWEoHfHp69o1Jyou7NjNR WtxcDpJAkfop2sVonwl5B08FZj3uHTagozwdC/Nhwuo4oh5OhoM++jL4PULwpMBkHw qDBwfFk1Jtb+5AiNtzCfX+A69CGhKAwo+q3KXFF0= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Tue, 28 Apr 2020 21:16:49 +0300 Message-Id: <20200428181650.5071-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200428181650.5071-1-laurent.pinchart@ideasonboard.com> References: <20200428181650.5071-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/3] test: camera_sensor: Test the model() function 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: Tue, 28 Apr 2020 18:16:55 -0000 Verify that the sensor model matches the expected value. The whole model extraction heuristic isn't fully tested as that would require being able to inject different entity names. It is still useful as an initial step. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- test/camera-sensor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/camera-sensor.cpp b/test/camera-sensor.cpp index 27c190fe7ace..6069d668e495 100644 --- a/test/camera-sensor.cpp +++ b/test/camera-sensor.cpp @@ -61,6 +61,12 @@ protected: int run() { + if (sensor_->model() != "Sensor A") { + cerr << "Incorrect sensor model '" << sensor_->model() + << "'" << endl; + return TestFail; + } + const std::vector &codes = sensor_->mbusCodes(); auto iter = std::find(codes.begin(), codes.end(), MEDIA_BUS_FMT_ARGB8888_1X32);