blob: f3411f734fa26df0c94038d53e89ed1ccfb55efe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2023 Google LLC
* Written by Simon Glass <sjg@chromium.org>
*/
#include <common.h>
#include <cedit.h>
#include <expo.h>
#include <test/ut.h>
#include "bootstd_common.h"
#include <test/cedit-test.h>
#include "../../boot/scene_internal.h"
/* Check the cedit command */
static int cedit_base(struct unit_test_state *uts)
{
extern struct expo *cur_exp;
struct scene_obj_menu *menu;
struct scene_obj_txt *txt;
struct expo *exp;
struct scene *scn;
ut_assertok(run_command("cedit load hostfs - cedit.dtb", 0));
console_record_reset_enable();
/*
* ^N Move down to second menu
* ^M Open menu
* ^N Move down to second item
* ^M Select item
* \e Quit
*/
console_in_puts("\x0e\x0d\x0e\x0d\e");
ut_assertok(run_command("cedit run", 0));
exp = cur_exp;
scn = expo_lookup_scene_id(exp, exp->scene_id);
ut_assertnonnull(scn);
menu = scene_obj_find(scn, scn->highlight_id, SCENEOBJT_NONE);
ut_assertnonnull(menu);
txt = scene_obj_find(scn, menu->title_id, SCENEOBJT_NONE);
ut_assertnonnull(txt);
ut_asserteq_str("AC Power", expo_get_str(exp, txt->str_id));
ut_asserteq(ID_AC_ON, menu->cur_item_id);
return 0;
}
BOOTSTD_TEST(cedit_base, 0);
|