summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2025-04-02 06:29:36 +1300
committerTom Rini <trini@konsulko.com>2025-05-02 13:40:25 -0600
commit236ae39fb0c571d2553271a7fa75920348f9c5eb (patch)
treec8790ebae8423023fa1585ce6557a3369da6316c /test
parent0d0b2341dd419c7c56def9e23f31625da2d31168 (diff)
video: Begin support for measuring multiple lines of text
Update the vidconsole API so that measure() can measure multiple lines of text. This will make it easier to implement multi-line fields in expo. Tidy up the function comments while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/dm/video.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/dm/video.c b/test/dm/video.c
index 6ce1a756e25..cfc831b6931 100644
--- a/test/dm/video.c
+++ b/test/dm/video.c
@@ -788,6 +788,7 @@ static int dm_test_font_measure(struct unit_test_state *uts)
struct vidconsole_bbox bbox;
struct video_priv *priv;
struct udevice *dev, *con;
+ struct alist lines;
ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
priv = dev_get_uclass_priv(dev);
@@ -797,11 +798,13 @@ static int dm_test_font_measure(struct unit_test_state *uts)
/* this is using the Nimbus font with size of 18 pixels */
ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
vidconsole_position_cursor(con, 0, 0);
- ut_assertok(vidconsole_measure(con, NULL, 0, test_string, &bbox));
+ ut_assertok(vidconsole_measure(con, NULL, 0, test_string, &bbox,
+ &lines));
ut_asserteq(0, bbox.x0);
ut_asserteq(0, bbox.y0);
ut_asserteq(0x47a, bbox.x1);
ut_asserteq(0x12, bbox.y1);
+ ut_asserteq(0, lines.count);
return 0;
}