From patchwork Thu Jan 22 04:11:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1770 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=1769055179; bh=RaDOseyqgi4q6DO4sbedB9N4Cg2Ylgn6PtRUzKelM0I=; 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=FxGXittnokqttmgXyXliJlTX/ppBVaANIDhoGMoZkPWMUddOygteywjQXiKRqsdJY uLk2kSRo2EFdONBh20x66puCCtGHD3Wl+spHNlywpJu8AGALJz756H8+o8DrTbxz3O eiBBgJEwSe02FNaMTMznbB2UjSASWto052NUub+DSzgKAHdRV2uJgrDdjOt2B3eW2l wK2rpZo2QLV60pzwwfQEU/ky2n32c04m/XX/ixoBjUBr2473IJ1d9ZUbQXYpEg/KiF Erna5/HvGMJoxSQU+xV4IuVp7FydpZ9LuvqNu1yoxx9DQqBiw63/+Q2Jb/juXWcDMY rqQEP+VVQoDpg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0FF8F6962D for ; Wed, 21 Jan 2026 21:12:59 -0700 (MST) 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 dNj-a75QZOmc for ; Wed, 21 Jan 2026 21:12:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769055178; bh=RaDOseyqgi4q6DO4sbedB9N4Cg2Ylgn6PtRUzKelM0I=; 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=Sm0jNXP37N4S4das4T36PBR48glThwdeuKmoMIyx88GgxMwFAFlqPWaJsYRV8LsGl H8LCH5W9PMh0RWBZqd9PrEYnd5WxUMPyevP3rYIESt/w7nZFqFulHZdB27n9vTIyue nPtC3dUarbzAwYOTta2al1lDqykwVqeJb2AMApxLLys69KVBK70kG6YkuptAtf1BzV CcZCnhj/c6WdmwTlT3ALUzBTLiPEwTAmaKof5mbdAmKTXY+wmuUAe4y5MmjV+d9cCo /cRDYyfDWHLqOBCPp13DwGMZxl6+102BFUpGyuYT3E9MFEBCtNT0PHksMOrEuXma4p H/k6Loaq48NQw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F34756962A for ; Wed, 21 Jan 2026 21:12:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769055176; bh=7MEt0egkOCij5dQb86A5EMOXzKHQmzWvkyf6aqfV79U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WO76v7OCwvM/T2e8jObYjpa63rN2FaTU57pBQGCoMeX6hfe8bNzgjZlxdk+VeS3MQ tPTGL53Tqw8KGAlSHi7gZpamUzKGwp6w3p7Zkm3H42ROC5V3FmslamcfHrbdXJlwgh sWSlzfW3GDUZ/Wir116tCPHCrPCSTHvl1bCdP9baxjmg2zL/G1fqAgO0AzlLMgrU+g DqZ3BkFgp4hVAs8imOy3fH8dlxsuKvj+G5BkUnY6Of9I2HQBb0I6eSTO0Zm/D5HAsp ZAaKBaE2qFtlcwaV90eMHnSJkr4HS2tbU+Uns6ojnZIfyyPU2aWs9iyodi6jEqp1Ws TBh1GTWwXKMMw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ED9B9694CC; Wed, 21 Jan 2026 21:12:56 -0700 (MST) 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 D_D_z39FJG8S; Wed, 21 Jan 2026 21:12:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769055172; bh=jAEXPxiMLtBZeo6aYfsSWz5Y8A9shg0LQ2jNFs4UKD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CxyIlsYU5tX1cLr8XbkFHlIq488exIGekIii0P+y+kafShVNBxlQF7onIPs/E5IAg qWBYOQhMA6gqfBSOZaEkiADnaDVpE206yhOB6/Gw0MragfQZf43i8/nq6nc3/ipm5X XQ1r14ji/MqPWVcQ3weO8hbsUietvLP+QQi3d0z8IpwZ2Wf3EPk3gaTciK1FI1EDWl px5qYrlJY6hzaaE3ustd4rirrzN4BW0CgNMZUogsI24d0RbHBv57qLA40frp0HtGuz YdeuMmPN3nrDqvHo+QD3t+SqEPGpIQHih0dIoS3coZ2P5r63TbeRD89sNpsBMQdHb4 ro9Iqn5MzjdUA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9E46F69616; Wed, 21 Jan 2026 21:12:52 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 21:11:39 -0700 Message-ID: <20260122041155.174721-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260122041155.174721-1-sjg@u-boot.org> References: <20260122041155.174721-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5AELCOHRMXUP5XF2O2IXTPOAI5S2CLRI X-Message-ID-Hash: 5AELCOHRMXUP5XF2O2IXTPOAI5S2CLRI 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: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 11/16] test: expo: Add keypress tests to expo_render_textedit 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 Extend the textedit rendering test to verify keypress handling. Add tests for: - Character input ('X') - Cursor movement (Ctrl-B to move left) - Character deletion (Ctrl-D to delete at cursor) Also check that the text content changes as expected. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- test/boot/expo.c | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/test/boot/expo.c b/test/boot/expo.c index 4a20b00b901..8598f32d341 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -1592,6 +1592,35 @@ static int expo_render_textedit(struct unit_test_state *uts) ut_asserteq(100, ted->tin.cls.eol_num); ut_asserteq(21526, video_compress_fb(uts, dev, false)); + /* send a keypress to add a character */ + ut_assertok(expo_send_key(exp, 'X')); + ut_asserteq(101, ted->tin.cls.num); + ut_asserteq(101, ted->tin.cls.eol_num); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + ut_asserteq(21607, video_compress_fb(uts, dev, false)); + + ut_assertok(expo_send_key(exp, CTL_CH('b'))); + ut_assertok(expo_send_key(exp, CTL_CH('b'))); + ut_assertok(expo_send_key(exp, CTL_CH('b'))); + + /* check cursor moved back three positions, before 'e' */ + ut_asserteq(98, ted->tin.cls.num); + ut_asserteq(101, ted->tin.cls.eol_num); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + ut_asserteq(21623, video_compress_fb(uts, dev, false)); + + /* delete a character at the cursor (removes 'e') */ + ut_assertok(expo_send_key(exp, CTL_CH('d'))); + + /* check character deleted at cursor position */ + ut_asserteq(98, ted->tin.cls.num); + ut_asserteq(100, ted->tin.cls.eol_num); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + ut_asserteq(21541, video_compress_fb(uts, dev, false)); + /* close the textedit with Enter (BKEY_SELECT) */ ut_assertok(expo_send_key(exp, BKEY_SELECT)); ut_assertok(expo_action_get(exp, &act)); @@ -1599,11 +1628,14 @@ static int expo_render_textedit(struct unit_test_state *uts) ut_asserteq(OBJ_TEXTED, act.select.id); ut_assertok(scene_set_open(scn, act.select.id, false)); - /* check the textedit is closed */ + /* check the textedit is closed and text is changed */ ut_asserteq(0, ted->obj.flags & SCENEOF_OPEN); + ut_asserteq_str("This\nis the initial contents of the text " + "editor but it is quite likely that more will be added latrX", + abuf_data(&ted->tin.buf)); ut_assertok(scene_arrange(scn)); ut_assertok(expo_render(exp)); - ut_asserteq(21662, video_compress_fb(uts, dev, false)); + ut_asserteq(21659, video_compress_fb(uts, dev, false)); abuf_uninit(&buf); abuf_uninit(&logo_copy);