diff options
| author | Simon Glass <[email protected]> | 2025-05-02 08:46:37 -0600 |
|---|---|---|
| committer | Simon Glass <[email protected]> | 2025-05-30 09:49:32 +0100 |
| commit | 5a80996cb6a285d09c03d687dc9ad793f12e7bf1 (patch) | |
| tree | f380eb465821947d9af64a8d9364a446c9065713 /test/boot | |
| parent | 5ea2b533ed037b8f6f89c33f13dcf6188ba9162d (diff) | |
expo: Create a struct for generic text attributes
In preparation for adding more text types, refactor the common fields
into a new structure. This will allow common code to be used.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'test/boot')
| -rw-r--r-- | test/boot/bootflow.c | 2 | ||||
| -rw-r--r-- | test/boot/cedit.c | 2 | ||||
| -rw-r--r-- | test/boot/expo.c | 15 |
3 files changed, 10 insertions, 9 deletions
diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 58885b5d8bf..ea1a994fd3d 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -858,7 +858,7 @@ static int check_font(struct unit_test_state *uts, struct scene *scn, uint id, txt = scene_obj_find(scn, id, SCENEOBJT_TEXT); ut_assertnonnull(txt); - ut_asserteq(font_size, txt->font_size); + ut_asserteq(font_size, txt->gen.font_size); return 0; } diff --git a/test/boot/cedit.c b/test/boot/cedit.c index 0c34d4b3df0..dbf781902fb 100644 --- a/test/boot/cedit.c +++ b/test/boot/cedit.c @@ -48,7 +48,7 @@ static int cedit_base(struct unit_test_state *uts) 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_str("AC Power", expo_get_str(exp, txt->gen.str_id)); ut_asserteq(ID_AC_ON, menu->cur_item_id); diff --git a/test/boot/expo.c b/test/boot/expo.c index 70db33d48b1..96c5943f394 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -280,8 +280,8 @@ static int expo_object_attr(struct unit_test_state *uts) strcpy(name, "font2"); ut_assertok(scene_txt_set_font(scn, OBJ_TEXT, name, 42)); - ut_asserteq_ptr(name, txt->font_name); - ut_asserteq(42, txt->font_size); + ut_asserteq_ptr(name, txt->gen.font_name); + ut_asserteq(42, txt->gen.font_size); ut_asserteq(-ENOENT, scene_txt_set_font(scn, OBJ_TEXT2, name, 42)); @@ -296,7 +296,7 @@ static int expo_object_attr(struct unit_test_state *uts) node = ofnode_path("/bootstd/theme"); ut_assert(ofnode_valid(node)); ut_assertok(expo_apply_theme(exp, node)); - ut_asserteq(30, txt->font_size); + ut_asserteq(30, txt->gen.font_size); expo_destroy(exp); @@ -727,7 +727,7 @@ static int expo_test_build(struct unit_test_state *uts) ut_assertnonnull(scn); ut_asserteq_str("main", scn->name); ut_asserteq(ID_SCENE1, scn->id); - ut_asserteq(ID_DYNAMIC_START + 1, scn->title_id); + ut_asserteq(ID_DYNAMIC_START, scn->title_id); ut_asserteq(0, scn->highlight_id); /* check the title */ @@ -739,7 +739,8 @@ static int expo_test_build(struct unit_test_state *uts) ut_asserteq(scn->title_id, obj->id); ut_asserteq(SCENEOBJT_TEXT, obj->type); ut_asserteq(0, obj->flags); - ut_asserteq_str("Test Configuration", expo_get_str(exp, txt->str_id)); + ut_asserteq_str("Test Configuration", + expo_get_str(exp, txt->gen.str_id)); /* check the menu */ menu = scene_obj_find(scn, ID_CPU_SPEED, SCENEOBJT_NONE); @@ -751,7 +752,7 @@ static int expo_test_build(struct unit_test_state *uts) ut_asserteq(0, obj->flags); txt = scene_obj_find(scn, menu->title_id, SCENEOBJT_NONE); - ut_asserteq_str("CPU speed", expo_get_str(exp, txt->str_id)); + ut_asserteq_str("CPU speed", expo_get_str(exp, txt->gen.str_id)); ut_asserteq(0, menu->cur_item_id); ut_asserteq(0, menu->pointer_id); @@ -768,7 +769,7 @@ static int expo_test_build(struct unit_test_state *uts) ut_asserteq(0, item->value); txt = scene_obj_find(scn, item->label_id, SCENEOBJT_NONE); - ut_asserteq_str("2 GHz", expo_get_str(exp, txt->str_id)); + ut_asserteq_str("2 GHz", expo_get_str(exp, txt->gen.str_id)); count = list_count_nodes(&menu->item_head); ut_asserteq(3, count); |
