From patchwork Thu Jan 22 04:11:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1769 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=1769055173; bh=dRbzkFIisBc8OKfVaa7fe7gZqQSZGArWjw+47xRhO4k=; 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=YknVsQFb+P6qfM/RAq0XRxZsjkOf/PLx+Q96jdAk0C0ac6gkh2y+FLKb7T3lRkabj Gbwewo6ng8jvqhaXbCqVpBJ2l0CW0IbHh5rQ1HCabYyMd4B1HyhQKVAtqx6IzD9JBE XD1ekKBPom8sofWPd897kYvFyJOBVh0JaPlLGWzG/mcXRvrxvUDlywbHK+k6KWHL69 BhGSd7/1avGzqKcz7V9VEhi0hhkDbSpBHKgm3iz8M1RFImCIj0Lpo/8T/ikt/JJ8Mp dHOJwQMcFoaUPX6Tg+j5PZDDy+SbgcoG4XzFuecT9gQxrYJQu7LdbgabXrKoMQpqc4 6J1Eox7SmM7cQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 972506962D for ; Wed, 21 Jan 2026 21:12:53 -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 PhjwV-S1wp_5 for ; Wed, 21 Jan 2026 21:12:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769055173; bh=dRbzkFIisBc8OKfVaa7fe7gZqQSZGArWjw+47xRhO4k=; 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=YknVsQFb+P6qfM/RAq0XRxZsjkOf/PLx+Q96jdAk0C0ac6gkh2y+FLKb7T3lRkabj Gbwewo6ng8jvqhaXbCqVpBJ2l0CW0IbHh5rQ1HCabYyMd4B1HyhQKVAtqx6IzD9JBE XD1ekKBPom8sofWPd897kYvFyJOBVh0JaPlLGWzG/mcXRvrxvUDlywbHK+k6KWHL69 BhGSd7/1avGzqKcz7V9VEhi0hhkDbSpBHKgm3iz8M1RFImCIj0Lpo/8T/ikt/JJ8Mp dHOJwQMcFoaUPX6Tg+j5PZDDy+SbgcoG4XzFuecT9gQxrYJQu7LdbgabXrKoMQpqc4 6J1Eox7SmM7cQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 86D806962A for ; Wed, 21 Jan 2026 21:12:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769055172; bh=Dc4qYY1dkwUc+iSvW5mEeyba9Hbcv1mgvlqbyGPrFv8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IBf871LtrCxlrE7YOm9KtDPcMS0UmjRjEcNtZ7H0nkoETNJiUuBLnKvs5VnKLhvnK PYOlYqr7Ka/wpwksm0iGRFwvy5KND2WZ1uS7ws5uPxrZNjmfA25x4DnPRXe1YSzYCR SsLL4vQ1R1umZr4vIWdpkVEsG4UGu58dLrlsMonupLQyiHkx+tSpO4CSKjFEusIyDV CpduYdKZ3R3b1CswfQrtYeuH6ouoI0jpsEKcqaD3ZY9csFhOE0n1dzN0OR64FbL83u xxVCM2ImEYF5mx905OHL5kLp7uBcYEFQ7xLFn1Gg48oZHsGL6lTYMtSaEMxnfR883W nt5wyLmsN9QRg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 13460694CC; Wed, 21 Jan 2026 21:12:52 -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 B2rqIOmPoa-1; Wed, 21 Jan 2026 21:12:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769055168; bh=hmn1owvFz0Vd6sVHLp5/Gym2WWwGj6Rinfc87AD5tmI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G29hTENYE2kRJurVKt8cHqPx5+yVs7OdtjAx3+BI5o4nt32DhNEIYwgQxZMpjAWU9 6YyvvpkvR59BpysCl8Sg0yrFFHUwFKH+UuKV8CJcI4IaJILUXF2hCTu3Fx3DIMaEE3 7RIV5a53bg4Nk4NyoVjSBrLvCbxCz6pCvH24dMLqWl2T6L0XlV0oi9vQ3F6RRAuXlS cWPuwvxsgO//dfDNQcadYakIPQxE5u64BekJ5whb8ymLTqgxn6cYviiLSQPj9JlzHE qFWX53rd/gQJH9FvD/+galpFvaN5WxEava/jSTfieDNMAylE8O7K4Hf8AWEWdLIl/J 9/tGnXaSoL15A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B380969616; Wed, 21 Jan 2026 21:12:47 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 21:11:38 -0700 Message-ID: <20260122041155.174721-11-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: SBJMIPB5I4IIXAGTIRLR5VVMJ4UFAMET X-Message-ID-Hash: SBJMIPB5I4IIXAGTIRLR5VVMJ4UFAMET 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 10/16] test: expo: Add open/close testing 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 expo_render_textedit() test to cover opening the textedit, rendering with the cursor visible, then closing it with BKEY_SELECT and verifying the display returns to its previous state. This tests the full open/close cycle similar to expo_render_textline. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- test/boot/expo.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/boot/expo.c b/test/boot/expo.c index 2ace10994b6..4a20b00b901 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -1542,6 +1542,7 @@ static int expo_render_textedit(struct unit_test_state *uts) struct scene_obj_txtedit *ted; struct scene_obj_menu *menu; struct abuf buf, logo_copy; + struct expo_action act; struct scene *scn; struct udevice *dev; struct expo *exp; @@ -1549,6 +1550,7 @@ static int expo_render_textedit(struct unit_test_state *uts) ut_assertok(create_test_expo(uts, &exp, &scn, &menu, &buf, &logo_copy)); dev = exp->display; + expo_enter_mode(exp); id = scene_texted(scn, "texted", OBJ_TEXTED, 40, &ted); ut_assert(id > 0); @@ -1580,9 +1582,33 @@ static int expo_render_textedit(struct unit_test_state *uts) ut_assertok(expo_render(exp)); ut_asserteq(21662, video_compress_fb(uts, dev, false)); + /* open the textedit and re-render */ + ut_assertok(scene_set_open(scn, OBJ_TEXTED, true)); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + + /* the cursor should be at the end */ + ut_asserteq(100, ted->tin.cls.num); + ut_asserteq(100, ted->tin.cls.eol_num); + ut_asserteq(21526, 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)); + ut_asserteq(EXPOACT_CLOSE, act.type); + ut_asserteq(OBJ_TEXTED, act.select.id); + ut_assertok(scene_set_open(scn, act.select.id, false)); + + /* check the textedit is closed */ + ut_asserteq(0, ted->obj.flags & SCENEOF_OPEN); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + ut_asserteq(21662, video_compress_fb(uts, dev, false)); + abuf_uninit(&buf); abuf_uninit(&logo_copy); + expo_exit_mode(exp); expo_destroy(exp); return 0;