From patchwork Thu Oct 2 15:45:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 475 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759419988; bh=+Knc1mqh7SUyARbZWMwcscNfje5bg2wt5qKnu3ZR/p0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Ccknja86eFBEghz3GPBZ5F33jjaUNKuQq94Kt7QKWQhpIzsYjT7A3SdhSeXOelhUT hxWF8m99gg+3UYI+LfreesiDDe1iDTUM7rq16NYiVy51tE3SbcKU6GxbLGw7Lx1ZxP AydXKUpsBSql7pHVuEKPi5BqH7ACTiyqcBUpoxDUpLesDOhxeMCY3uoTTZER4x9Duc l7tdedQ6l5tutKgtYIgk+HBq3D9/TfmIPKEw7JJ+d+OR2DmyfBvi7R4OyF13ZVJIyW V+GSrgBu8ZcKMeHmvJqgYV4rcvLJxbIhODHVx0bGRdAht3/MqcL/wr64LCJaw8b8Ue xvvJmdeaF1PXg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A196B67F17 for ; Thu, 2 Oct 2025 09:46:28 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 9qQLg3reGZkH for ; Thu, 2 Oct 2025 09:46:28 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759419988; bh=+Knc1mqh7SUyARbZWMwcscNfje5bg2wt5qKnu3ZR/p0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Ccknja86eFBEghz3GPBZ5F33jjaUNKuQq94Kt7QKWQhpIzsYjT7A3SdhSeXOelhUT hxWF8m99gg+3UYI+LfreesiDDe1iDTUM7rq16NYiVy51tE3SbcKU6GxbLGw7Lx1ZxP AydXKUpsBSql7pHVuEKPi5BqH7ACTiyqcBUpoxDUpLesDOhxeMCY3uoTTZER4x9Duc l7tdedQ6l5tutKgtYIgk+HBq3D9/TfmIPKEw7JJ+d+OR2DmyfBvi7R4OyF13ZVJIyW V+GSrgBu8ZcKMeHmvJqgYV4rcvLJxbIhODHVx0bGRdAht3/MqcL/wr64LCJaw8b8Ue xvvJmdeaF1PXg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 91CD367E66 for ; Thu, 2 Oct 2025 09:46:28 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759419986; bh=F0Vk6O2lrsEhkknSFEHnL6Qb/hd54kXPwOQod44H4T0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O28j7+UhAHJ7LgqEbpHaM0EcMa9WVZ/cUxLOkhCR5Dc+6/E2Ile9nh9Lr9jonKURk LM7SlNeerE8kvGh08eIL3dxeF4Ia2IW8h4wytUxKPcLcJQHyLrVgAxDjfkIVhIoTul m8Xe72kVijYy/9d7olpMzEyo6I+p/v9G4ZSBiVs1cCmCCK+8eNC92jFXCiwJ5h8O/y LHqlsJ3133zOAKs98E9TL0WwOxEFjtjS4vSgqdKKIOP9NA59ZE0xWFKOiWiU86rcUD N21/ZxTAOTOXSFFFjAT84/Rzzy06V37nBelcNop44+2lUQHQFgXB9y2Ovs+IS6K4Lb LHIW2I8FjnMew== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 92EBF67E4D; Thu, 2 Oct 2025 09:46:26 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id OkKPItDvjn-U; Thu, 2 Oct 2025 09:46:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759419983; bh=W9PVUa/1C3EqomdGMKD9FauQI5Aw0uh9E98k6uoTVP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CGvLSQQoROKVYyzA6TwSVebqc2ixsXa9pNseyW/YuTRGLq6UQu5lP9AKx2ZjgrpCs FtX+xmJhheJuHvLGwx390BhpDE1vGXggHAbxKqC4N/IAUgL22mfe2BB5MGDWagxbUN aV4XpyMDBH58DFk0SbMDs/lk3Kfurw1qhRCrbB/qgnJooRC3FyVSQdIIej7h5YJh/I XiRBIGaBN1MLvsu7w6eBknMfysez+TNMB2Gcmwp/ZkJ2zd8PphRvZ0QOp5nxJIt2Sn fBvd+NrJRJnLI/LLhFlTicajLzKgEgFDvAE4YfJx9kKi1L+PaboOMtGlrGpVJUz6qC U5Ap4490UKe5w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E62A067D8D; Thu, 2 Oct 2025 09:46:22 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 2 Oct 2025 09:45:43 -0600 Message-ID: <20251002154554.4129220-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251002154554.4129220-1-sjg@u-boot.org> References: <20251002154554.4129220-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: U3HHZHFQ24YKSMO24W5XYZX3WXJW7TTU X-Message-ID-Hash: U3HHZHFQ24YKSMO24W5XYZX3WXJW7TTU X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 3/9] video: Add tests for the video commands List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a simple test for the setcurs and lcdputs commands. Co-developed-by: Claude Signed-off-by: Simon Glass --- Changes in v2: - Pull out the docs into a separate patch - Update test result for hex test/dm/video.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/dm/video.c b/test/dm/video.c index 702e9854005..847342891fd 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -1080,3 +1080,23 @@ static int dm_test_video_backspace_truetype(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_video_backspace_truetype, UTF_SCAN_PDATA | UTF_SCAN_FDT); + +/* video commands */ +static int dm_test_video_cmd(struct unit_test_state *uts) +{ + struct udevice *dev, *con; + + ut_assertok(select_vidconsole(uts, "vidconsole0")); + ut_assertok(video_get_nologo(uts, &dev)); + ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con)); + ut_assertok(vidconsole_select_font(con, "8x16", 0)); + + ut_assertok(run_command("setcurs 10 5", 0)); + + ut_assertok(run_command("lcdputs \"Test string\"", 0)); + ut_asserteq(187, video_compress_fb(uts, dev, false)); + ut_assertok(video_check_copy_fb(uts, dev)); + + return 0; +} +DM_TEST(dm_test_video_cmd, UTF_SCAN_PDATA | UTF_SCAN_FDT);