]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
expo: Test editing a lineedit
authorSimon Glass <sjg@chromium.org>
Fri, 2 May 2025 14:46:26 +0000 (08:46 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 30 May 2025 08:49:32 +0000 (09:49 +0100)
Open the lineedit and add a few characters, to check that things look
right.

At present when the user moves to a new menu item, the menu code
handles this immediately. This means it is not possible to use an expo
action to effect the same change.

Update this so that EXPOACT_POINT_ITEM is handled in cedit_do_action().

Expand the test to cover this.

Signed-off-by: Simon Glass <sjg@chromium.org>
test/boot/cedit.c

index 97ca63b3082f1515951410c615980e8a9861e0f4..0c34d4b3df07d6a0ff2545dce5b61d706dcc95ed 100644 (file)
@@ -302,19 +302,40 @@ static int cedit_render(struct unit_test_state *uts)
        ut_assertok(expo_render(exp));
        ut_asserteq(4986, video_compress_fb(uts, dev, false));
 
+       act.type = EXPOACT_OPEN;
+       act.select.id = ID_POWER_LOSS;
+       ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
+       ut_assertok(expo_render(exp));
+       ut_asserteq(5393, video_compress_fb(uts, dev, false));
+
+       act.type = EXPOACT_POINT_ITEM;
+       act.select.id = ID_AC_ON;
+       ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
+       ut_assertok(expo_render(exp));
+       ut_asserteq(5365, video_compress_fb(uts, dev, false));
+
+       /* select it */
+       act.type = EXPOACT_SELECT;
+       act.select.id = ID_AC_ON;
+       ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
+       ut_assertok(expo_render(exp));
+       ut_asserteq(4980, video_compress_fb(uts, dev, false));
+
+       ut_asserteq(ID_AC_ON, menu->cur_item_id);
+
        /* move to the line-edit field */
        act.type = EXPOACT_POINT_OBJ;
        act.select.id = ID_MACHINE_NAME;
        ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
        ut_assertok(expo_render(exp));
-       ut_asserteq(4872, video_compress_fb(uts, dev, false));
+       ut_asserteq(4862, video_compress_fb(uts, dev, false));
 
        /* open it */
        act.type = EXPOACT_OPEN;
        act.select.id = ID_MACHINE_NAME;
        ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
        ut_assertok(expo_render(exp));
-       ut_asserteq(4841, video_compress_fb(uts, dev, false));
+       ut_asserteq(4851, video_compress_fb(uts, dev, false));
 
        /*
         * Send some keypresses. Note that the console must be enabled so that
@@ -330,7 +351,7 @@ static int cedit_render(struct unit_test_state *uts)
        ut_silence_console(uts);
        ut_assertok(cedit_arange(exp, vid_priv, scn->id));
        ut_assertok(expo_render(exp));
-       ut_asserteq(5009, video_compress_fb(uts, dev, false));
+       ut_asserteq(4996, video_compress_fb(uts, dev, false));
 
        expo_destroy(exp);
        cur_exp = NULL;