blob: 0c34d4b3df07d6a0ff2545dce5b61d706dcc95ed [file] [log] [blame]
Simon Glass44e4ec72023-08-14 16:40:26 -06001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2023 Google LLC
4 * Written by Simon Glass <sjg@chromium.org>
5 */
6
Simon Glass44e4ec72023-08-14 16:40:26 -06007#include <cedit.h>
Simon Glassee440642025-05-02 08:46:19 -06008#include <dm.h>
Simon Glass237f3752023-08-14 16:40:35 -06009#include <env.h>
Simon Glass44e4ec72023-08-14 16:40:26 -060010#include <expo.h>
Simon Glass28bf4352023-08-14 16:40:33 -060011#include <mapmem.h>
12#include <dm/ofnode.h>
Simon Glass44e4ec72023-08-14 16:40:26 -060013#include <test/ut.h>
Simon Glassee440642025-05-02 08:46:19 -060014#include <test/video.h>
Simon Glass44e4ec72023-08-14 16:40:26 -060015#include "bootstd_common.h"
16#include <test/cedit-test.h>
17#include "../../boot/scene_internal.h"
18
19/* Check the cedit command */
20static int cedit_base(struct unit_test_state *uts)
21{
22 extern struct expo *cur_exp;
23 struct scene_obj_menu *menu;
24 struct scene_obj_txt *txt;
25 struct expo *exp;
26 struct scene *scn;
27
28 ut_assertok(run_command("cedit load hostfs - cedit.dtb", 0));
29
Simon Glass44e4ec72023-08-14 16:40:26 -060030 /*
31 * ^N Move down to second menu
32 * ^M Open menu
33 * ^N Move down to second item
34 * ^M Select item
35 * \e Quit
Simon Glass53a0a2f2024-10-14 16:31:57 -060036 *
37 * cedit_run() returns -EACCESS so this command returns CMD_RET_FAILURE
Simon Glass44e4ec72023-08-14 16:40:26 -060038 */
39 console_in_puts("\x0e\x0d\x0e\x0d\e");
Simon Glass53a0a2f2024-10-14 16:31:57 -060040 ut_asserteq(1, run_command("cedit run", 0));
Simon Glass44e4ec72023-08-14 16:40:26 -060041
42 exp = cur_exp;
43 scn = expo_lookup_scene_id(exp, exp->scene_id);
44 ut_assertnonnull(scn);
45
46 menu = scene_obj_find(scn, scn->highlight_id, SCENEOBJT_NONE);
47 ut_assertnonnull(menu);
48
49 txt = scene_obj_find(scn, menu->title_id, SCENEOBJT_NONE);
50 ut_assertnonnull(txt);
51 ut_asserteq_str("AC Power", expo_get_str(exp, txt->str_id));
52
53 ut_asserteq(ID_AC_ON, menu->cur_item_id);
54
55 return 0;
56}
Simon Glassf0425022024-08-22 07:57:54 -060057BOOTSTD_TEST(cedit_base, UTF_CONSOLE);
Simon Glass28bf4352023-08-14 16:40:33 -060058
Simon Glassb1cd32b2023-08-14 16:40:34 -060059/* Check the cedit write_fdt and read_fdt commands */
Simon Glass28bf4352023-08-14 16:40:33 -060060static int cedit_fdt(struct unit_test_state *uts)
61{
Simon Glass70c579b2023-10-01 19:13:39 -060062 struct scene_obj_textline *tline;
Simon Glass28bf4352023-08-14 16:40:33 -060063 struct video_priv *vid_priv;
64 extern struct expo *cur_exp;
Simon Glassb1cd32b2023-08-14 16:40:34 -060065 struct scene_obj_menu *menu;
Simon Glass736bc0d2025-05-02 08:46:22 -060066 struct udevice *dev;
Simon Glass28bf4352023-08-14 16:40:33 -060067 ulong addr = 0x1000;
68 struct ofprop prop;
69 struct scene *scn;
70 oftree tree;
71 ofnode node;
Simon Glass70c579b2023-10-01 19:13:39 -060072 char *str;
Simon Glass28bf4352023-08-14 16:40:33 -060073 void *fdt;
74 int i;
75
Simon Glass736bc0d2025-05-02 08:46:22 -060076 ut_assertok(uclass_first_device_err(UCLASS_VIDEO, &dev));
77 vid_priv = dev_get_uclass_priv(dev);
78
Simon Glass28bf4352023-08-14 16:40:33 -060079 ut_assertok(run_command("cedit load hostfs - cedit.dtb", 0));
80
Simon Glass736bc0d2025-05-02 08:46:22 -060081 ut_asserteq(ID_SCENE1, cedit_prepare(cur_exp, dev, &scn));
Simon Glass28bf4352023-08-14 16:40:33 -060082
Simon Glassb1cd32b2023-08-14 16:40:34 -060083 /* get a menu to fiddle with */
84 menu = scene_obj_find(scn, ID_CPU_SPEED, SCENEOBJT_MENU);
85 ut_assertnonnull(menu);
86 menu->cur_item_id = ID_CPU_SPEED_2;
87
Simon Glass70c579b2023-10-01 19:13:39 -060088 /* get a textline to fiddle with too */
89 tline = scene_obj_find(scn, ID_MACHINE_NAME, SCENEOBJT_TEXTLINE);
90 ut_assertnonnull(tline);
91 str = abuf_data(&tline->buf);
92 strcpy(str, "my-machine");
93
Simon Glass28bf4352023-08-14 16:40:33 -060094 ut_assertok(run_command("cedit write_fdt hostfs - settings.dtb", 0));
95 ut_assertok(run_commandf("load hostfs - %lx settings.dtb", addr));
96 ut_assert_nextlinen("1024 bytes read");
97
98 fdt = map_sysmem(addr, 1024);
99 tree = oftree_from_fdt(fdt);
100 node = ofnode_find_subnode(oftree_root(tree), CEDIT_NODE_NAME);
Simon Glass70c579b2023-10-01 19:13:39 -0600101 ut_assert(ofnode_valid(node));
Simon Glass28bf4352023-08-14 16:40:33 -0600102
Simon Glassb1cd32b2023-08-14 16:40:34 -0600103 ut_asserteq(ID_CPU_SPEED_2,
Simon Glass28bf4352023-08-14 16:40:33 -0600104 ofnode_read_u32_default(node, "cpu-speed", 0));
Simon Glass6f3e87a2024-10-14 16:32:00 -0600105 ut_asserteq(3,
106 ofnode_read_u32_default(node, "cpu-speed-value", 0));
Simon Glassb1cd32b2023-08-14 16:40:34 -0600107 ut_asserteq_str("2.5 GHz", ofnode_read_string(node, "cpu-speed-str"));
Simon Glass70c579b2023-10-01 19:13:39 -0600108 ut_asserteq_str("my-machine", ofnode_read_string(node, "machine-name"));
Simon Glass28bf4352023-08-14 16:40:33 -0600109
Simon Glass6f3e87a2024-10-14 16:32:00 -0600110 /* There should only be 7 properties */
Simon Glass28bf4352023-08-14 16:40:33 -0600111 for (i = 0, ofnode_first_property(node, &prop); ofprop_valid(&prop);
112 i++, ofnode_next_property(&prop))
113 ;
Simon Glass6f3e87a2024-10-14 16:32:00 -0600114 ut_asserteq(7, i);
Simon Glass28bf4352023-08-14 16:40:33 -0600115
Simon Glassb1cd32b2023-08-14 16:40:34 -0600116 ut_assert_console_end();
117
118 /* reset the expo */
119 menu->cur_item_id = ID_CPU_SPEED_1;
Simon Glass70c579b2023-10-01 19:13:39 -0600120 *str = '\0';
Simon Glassb1cd32b2023-08-14 16:40:34 -0600121
122 /* load in the settings and make sure they update */
123 ut_assertok(run_command("cedit read_fdt hostfs - settings.dtb", 0));
124 ut_asserteq(ID_CPU_SPEED_2, menu->cur_item_id);
Simon Glass70c579b2023-10-01 19:13:39 -0600125 ut_asserteq_str("my-machine", ofnode_read_string(node, "machine-name"));
Simon Glassb1cd32b2023-08-14 16:40:34 -0600126
127 ut_assertnonnull(menu);
Simon Glass28bf4352023-08-14 16:40:33 -0600128 ut_assert_console_end();
129
130 return 0;
131}
Simon Glassf0425022024-08-22 07:57:54 -0600132BOOTSTD_TEST(cedit_fdt, UTF_CONSOLE);
Simon Glass237f3752023-08-14 16:40:35 -0600133
Simon Glass0f2e5a62023-08-14 16:40:36 -0600134/* Check the cedit write_env and read_env commands */
Simon Glass237f3752023-08-14 16:40:35 -0600135static int cedit_env(struct unit_test_state *uts)
136{
Simon Glass70c579b2023-10-01 19:13:39 -0600137 struct scene_obj_textline *tline;
Simon Glass237f3752023-08-14 16:40:35 -0600138 struct video_priv *vid_priv;
139 extern struct expo *cur_exp;
140 struct scene_obj_menu *menu;
Simon Glass736bc0d2025-05-02 08:46:22 -0600141 struct udevice *dev;
Simon Glass237f3752023-08-14 16:40:35 -0600142 struct scene *scn;
Simon Glass70c579b2023-10-01 19:13:39 -0600143 char *str;
Simon Glass237f3752023-08-14 16:40:35 -0600144
Simon Glass237f3752023-08-14 16:40:35 -0600145 ut_assertok(run_command("cedit load hostfs - cedit.dtb", 0));
146
Simon Glass736bc0d2025-05-02 08:46:22 -0600147 ut_assertok(uclass_first_device_err(UCLASS_VIDEO, &dev));
148 vid_priv = dev_get_uclass_priv(dev);
149
150 ut_asserteq(ID_SCENE1, cedit_prepare(cur_exp, dev, &scn));
Simon Glass237f3752023-08-14 16:40:35 -0600151
152 /* get a menu to fiddle with */
153 menu = scene_obj_find(scn, ID_CPU_SPEED, SCENEOBJT_MENU);
154 ut_assertnonnull(menu);
155 menu->cur_item_id = ID_CPU_SPEED_2;
156
Simon Glass70c579b2023-10-01 19:13:39 -0600157 /* get a textline to fiddle with too */
158 tline = scene_obj_find(scn, ID_MACHINE_NAME, SCENEOBJT_TEXTLINE);
159 ut_assertnonnull(tline);
160 str = abuf_data(&tline->buf);
161 strcpy(str, "my-machine");
162
Simon Glass237f3752023-08-14 16:40:35 -0600163 ut_assertok(run_command("cedit write_env -v", 0));
Simon Glass53a0a2f2024-10-14 16:31:57 -0600164 ut_assert_nextlinen("c.cpu-speed=11");
Simon Glass237f3752023-08-14 16:40:35 -0600165 ut_assert_nextlinen("c.cpu-speed-str=2.5 GHz");
Simon Glass6f3e87a2024-10-14 16:32:00 -0600166 ut_assert_nextlinen("c.cpu-speed-value=3");
Simon Glass53a0a2f2024-10-14 16:31:57 -0600167 ut_assert_nextlinen("c.power-loss=14");
Simon Glass237f3752023-08-14 16:40:35 -0600168 ut_assert_nextlinen("c.power-loss-str=Always Off");
Simon Glass6f3e87a2024-10-14 16:32:00 -0600169 ut_assert_nextlinen("c.power-loss-value=0");
Simon Glass70c579b2023-10-01 19:13:39 -0600170 ut_assert_nextlinen("c.machine-name=my-machine");
Simon Glass237f3752023-08-14 16:40:35 -0600171 ut_assert_console_end();
172
Simon Glass53a0a2f2024-10-14 16:31:57 -0600173 ut_asserteq(11, env_get_ulong("c.cpu-speed", 10, 0));
Simon Glass237f3752023-08-14 16:40:35 -0600174 ut_asserteq_str("2.5 GHz", env_get("c.cpu-speed-str"));
Simon Glass70c579b2023-10-01 19:13:39 -0600175 ut_asserteq_str("my-machine", env_get("c.machine-name"));
Simon Glass237f3752023-08-14 16:40:35 -0600176
Simon Glass0f2e5a62023-08-14 16:40:36 -0600177 /* reset the expo */
178 menu->cur_item_id = ID_CPU_SPEED_1;
Simon Glass70c579b2023-10-01 19:13:39 -0600179 *str = '\0';
Simon Glass0f2e5a62023-08-14 16:40:36 -0600180
181 ut_assertok(run_command("cedit read_env -v", 0));
Simon Glass53a0a2f2024-10-14 16:31:57 -0600182 ut_assert_nextlinen("c.cpu-speed=11");
183 ut_assert_nextlinen("c.power-loss=14");
Simon Glass70c579b2023-10-01 19:13:39 -0600184 ut_assert_nextlinen("c.machine-name=my-machine");
Simon Glass0f2e5a62023-08-14 16:40:36 -0600185 ut_assert_console_end();
186
187 ut_asserteq(ID_CPU_SPEED_2, menu->cur_item_id);
Simon Glass70c579b2023-10-01 19:13:39 -0600188 ut_asserteq_str("my-machine", env_get("c.machine-name"));
Simon Glass0f2e5a62023-08-14 16:40:36 -0600189
Simon Glass237f3752023-08-14 16:40:35 -0600190 return 0;
191}
Simon Glassf0425022024-08-22 07:57:54 -0600192BOOTSTD_TEST(cedit_env, UTF_CONSOLE);
Simon Glass2b91ca62023-08-14 16:40:37 -0600193
194/* Check the cedit write_cmos and read_cmos commands */
195static int cedit_cmos(struct unit_test_state *uts)
196{
197 struct scene_obj_menu *menu, *menu2;
198 struct video_priv *vid_priv;
199 extern struct expo *cur_exp;
Simon Glass736bc0d2025-05-02 08:46:22 -0600200 struct udevice *dev;
Simon Glass2b91ca62023-08-14 16:40:37 -0600201 struct scene *scn;
202
Simon Glass2b91ca62023-08-14 16:40:37 -0600203 ut_assertok(run_command("cedit load hostfs - cedit.dtb", 0));
204
Simon Glass736bc0d2025-05-02 08:46:22 -0600205 ut_assertok(uclass_first_device_err(UCLASS_VIDEO, &dev));
206 vid_priv = dev_get_uclass_priv(dev);
207 ut_asserteq(ID_SCENE1, cedit_prepare(cur_exp, dev, &scn));
Simon Glass2b91ca62023-08-14 16:40:37 -0600208
209 /* get the menus to fiddle with */
210 menu = scene_obj_find(scn, ID_CPU_SPEED, SCENEOBJT_MENU);
211 ut_assertnonnull(menu);
212 menu->cur_item_id = ID_CPU_SPEED_2;
213
214 menu2 = scene_obj_find(scn, ID_POWER_LOSS, SCENEOBJT_MENU);
215 ut_assertnonnull(menu2);
216 menu2->cur_item_id = ID_AC_MEMORY;
217
218 ut_assertok(run_command("cedit write_cmos -v", 0));
219 ut_assert_nextlinen("Write 2 bytes from offset 80 to 84");
220 ut_assert_console_end();
221
Simon Glass4462fa32023-08-14 16:40:38 -0600222 /* reset the expo */
223 menu->cur_item_id = ID_CPU_SPEED_1;
224 menu2->cur_item_id = ID_AC_OFF;
225
226 ut_assertok(run_command("cedit read_cmos -v", 0));
227 ut_assert_nextlinen("Read 2 bytes from offset 80 to 84");
228 ut_assert_console_end();
229
230 ut_asserteq(ID_CPU_SPEED_2, menu->cur_item_id);
231 ut_asserteq(ID_AC_MEMORY, menu2->cur_item_id);
232
Simon Glass2b91ca62023-08-14 16:40:37 -0600233 return 0;
234}
Simon Glassf0425022024-08-22 07:57:54 -0600235BOOTSTD_TEST(cedit_cmos, UTF_CONSOLE);
Simon Glassee440642025-05-02 08:46:19 -0600236
Simon Glass38fdda02025-05-02 08:46:23 -0600237/* Check the cedit displays correctly */
Simon Glassee440642025-05-02 08:46:19 -0600238static int cedit_render(struct unit_test_state *uts)
239{
Simon Glass14bd4132025-05-02 08:46:21 -0600240 struct scene_obj_menu *menu;
Simon Glassee440642025-05-02 08:46:19 -0600241 struct video_priv *vid_priv;
242 extern struct expo *cur_exp;
Simon Glass38fdda02025-05-02 08:46:23 -0600243 struct expo_action evt;
Simon Glass14bd4132025-05-02 08:46:21 -0600244 struct expo_action act;
Simon Glass38fdda02025-05-02 08:46:23 -0600245 struct udevice *dev, *con;
246 struct stdio_dev *sdev;
Simon Glassee440642025-05-02 08:46:19 -0600247 struct scene *scn;
248 struct expo *exp;
Simon Glass38fdda02025-05-02 08:46:23 -0600249 int i;
Simon Glassee440642025-05-02 08:46:19 -0600250
251 ut_assertok(run_command("cedit load hostfs - cedit.dtb", 0));
252
253 exp = cur_exp;
Simon Glass38fdda02025-05-02 08:46:23 -0600254 sdev = stdio_get_by_name("vidconsole");
255 ut_assertnonnull(sdev);
256 con = sdev->priv;
257
258 dev = dev_get_parent(con);
Simon Glass736bc0d2025-05-02 08:46:22 -0600259 vid_priv = dev_get_uclass_priv(dev);
260 ut_asserteq(ID_SCENE1, cedit_prepare(exp, dev, &scn));
Simon Glass14bd4132025-05-02 08:46:21 -0600261
262 menu = scene_obj_find(scn, ID_POWER_LOSS, SCENEOBJT_MENU);
263 ut_assertnonnull(menu);
264 ut_asserteq(ID_AC_OFF, menu->cur_item_id);
265
Simon Glassee440642025-05-02 08:46:19 -0600266 ut_assertok(expo_render(exp));
267 ut_asserteq(4929, video_compress_fb(uts, dev, false));
268 ut_assertok(video_check_copy_fb(uts, dev));
Simon Glass14bd4132025-05-02 08:46:21 -0600269
270 /* move to the second menu */
271 act.type = EXPOACT_POINT_OBJ;
272 act.select.id = ID_POWER_LOSS;
273 ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
274 ut_assertok(expo_render(exp));
275 ut_asserteq(4986, video_compress_fb(uts, dev, false));
276
277 /* open the menu */
278 act.type = EXPOACT_OPEN;
279 act.select.id = ID_POWER_LOSS;
280 ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
281 ut_assertok(expo_render(exp));
282 ut_asserteq(5393, video_compress_fb(uts, dev, false));
283
284 /* close the menu */
285 act.type = EXPOACT_CLOSE;
286 act.select.id = ID_POWER_LOSS;
287 ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
288 ut_assertok(expo_render(exp));
289 ut_asserteq(4986, video_compress_fb(uts, dev, false));
290
291 /* open the menu again to check it looks the same */
292 act.type = EXPOACT_OPEN;
293 act.select.id = ID_POWER_LOSS;
294 ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
295 ut_assertok(expo_render(exp));
296 ut_asserteq(5393, video_compress_fb(uts, dev, false));
297
298 /* close the menu */
299 act.type = EXPOACT_CLOSE;
300 act.select.id = ID_POWER_LOSS;
301 ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
302 ut_assertok(expo_render(exp));
303 ut_asserteq(4986, video_compress_fb(uts, dev, false));
304
Simon Glassa2b78052025-05-02 08:46:26 -0600305 act.type = EXPOACT_OPEN;
306 act.select.id = ID_POWER_LOSS;
307 ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
308 ut_assertok(expo_render(exp));
309 ut_asserteq(5393, video_compress_fb(uts, dev, false));
310
311 act.type = EXPOACT_POINT_ITEM;
312 act.select.id = ID_AC_ON;
313 ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
314 ut_assertok(expo_render(exp));
315 ut_asserteq(5365, video_compress_fb(uts, dev, false));
316
317 /* select it */
318 act.type = EXPOACT_SELECT;
319 act.select.id = ID_AC_ON;
320 ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
321 ut_assertok(expo_render(exp));
322 ut_asserteq(4980, video_compress_fb(uts, dev, false));
323
324 ut_asserteq(ID_AC_ON, menu->cur_item_id);
325
Simon Glass38fdda02025-05-02 08:46:23 -0600326 /* move to the line-edit field */
327 act.type = EXPOACT_POINT_OBJ;
328 act.select.id = ID_MACHINE_NAME;
329 ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
330 ut_assertok(expo_render(exp));
Simon Glassa2b78052025-05-02 08:46:26 -0600331 ut_asserteq(4862, video_compress_fb(uts, dev, false));
Simon Glass38fdda02025-05-02 08:46:23 -0600332
333 /* open it */
334 act.type = EXPOACT_OPEN;
335 act.select.id = ID_MACHINE_NAME;
336 ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
337 ut_assertok(expo_render(exp));
Simon Glassa2b78052025-05-02 08:46:26 -0600338 ut_asserteq(4851, video_compress_fb(uts, dev, false));
Simon Glass38fdda02025-05-02 08:46:23 -0600339
340 /*
341 * Send some keypresses. Note that the console must be enabled so that
342 * the characters actually reach the putc_xy() in console_truetype,
343 * since in scene_textline_send_key(), the lineedit restores the
344 * vidconsole state, outputs the character and then saves the state
345 * again. If the character is never output, then the state won't be
346 * updated and the lineedit will be inconsistent.
347 */
348 ut_unsilence_console(uts);
349 for (i = 'a'; i < 'd'; i++)
350 ut_assertok(scene_send_key(scn, i, &evt));
351 ut_silence_console(uts);
352 ut_assertok(cedit_arange(exp, vid_priv, scn->id));
353 ut_assertok(expo_render(exp));
Simon Glassa2b78052025-05-02 08:46:26 -0600354 ut_asserteq(4996, video_compress_fb(uts, dev, false));
Simon Glass38fdda02025-05-02 08:46:23 -0600355
Simon Glassee440642025-05-02 08:46:19 -0600356 expo_destroy(exp);
357 cur_exp = NULL;
358
359 return 0;
360}
361BOOTSTD_TEST(cedit_render, UTF_DM | UTF_SCAN_FDT);
Simon Glass38fdda02025-05-02 08:46:23 -0600362
363/* Check the cedit displays lineedits correctly */
364static int cedit_render_lineedit(struct unit_test_state *uts)
365{
366 struct scene_obj_textline *tline;
367 struct video_priv *vid_priv;
368 extern struct expo *cur_exp;
369 struct expo_action evt;
370 struct expo_action act;
371 struct udevice *dev, *con;
372 struct stdio_dev *sdev;
373 struct scene *scn;
374 struct expo *exp;
375 char *str;
376 int i;
377
378 ut_assertok(run_command("cedit load hostfs - cedit.dtb", 0));
379
380 exp = cur_exp;
381 sdev = stdio_get_by_name("vidconsole");
382 ut_assertnonnull(sdev);
383 con = sdev->priv;
384
385 dev = dev_get_parent(con);
386 vid_priv = dev_get_uclass_priv(dev);
387 ut_asserteq(ID_SCENE1, cedit_prepare(exp, dev, &scn));
388
389 /* set up an initial value for the textline */
390 tline = scene_obj_find(scn, ID_MACHINE_NAME, SCENEOBJT_TEXTLINE);
391 ut_assertnonnull(tline);
392 str = abuf_data(&tline->buf);
393 strcpy(str, "my-machine");
394 ut_asserteq(20, tline->pos);
395
396 ut_assertok(expo_render(exp));
397 ut_asserteq(5336, video_compress_fb(uts, dev, false));
398 ut_assertok(video_check_copy_fb(uts, dev));
399
400 /* move to the line-edit field */
401 act.type = EXPOACT_POINT_OBJ;
402 act.select.id = ID_MACHINE_NAME;
403 ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
404 ut_assertok(expo_render(exp));
405 ut_asserteq(5363, video_compress_fb(uts, dev, false));
406
407 /* open it */
408 act.type = EXPOACT_OPEN;
409 act.select.id = ID_MACHINE_NAME;
410 ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
411 // ut_asserteq(0, tline->pos);
412 ut_assertok(expo_render(exp));
413 ut_asserteq(5283, video_compress_fb(uts, dev, false));
414
415 /* delete some characters */
416 ut_unsilence_console(uts);
417 for (i = 0; i < 3; i++)
418 ut_assertok(scene_send_key(scn, '\b', &evt));
419 ut_silence_console(uts);
420 ut_asserteq_str("my-mach", str);
421
422 ut_assertok(cedit_arange(exp, vid_priv, scn->id));
423 ut_assertok(expo_render(exp));
424 ut_asserteq(5170, video_compress_fb(uts, dev, false));
425
426 expo_destroy(exp);
427 cur_exp = NULL;
428
429 return 0;
430}
431BOOTSTD_TEST(cedit_render_lineedit, UTF_DM | UTF_SCAN_FDT);