Provide a way to click on an object and check that the expected action resulted. Put it in a common file so it can be used by cedit and expo tests. Tidy up the include-order in both cedit and expo. Signed-off-by: Simon Glass <sjg@chromium.org>
25 lines
597 B
C
25 lines
597 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Common functions for expo tests
|
|
*
|
|
* Copyright 2025 Simon Glass <sjg@chromium.org>
|
|
*/
|
|
|
|
#include <expo.h>
|
|
#include <test/ut.h>
|
|
#include "../../boot/scene_internal.h"
|
|
|
|
int click_check(struct unit_test_state *uts, struct scene *scn, uint id,
|
|
enum expoact_type expect_type, struct expo_action *act)
|
|
{
|
|
struct scene_obj *obj;
|
|
|
|
obj = scene_obj_find(scn, id, SCENEOBJT_NONE);
|
|
ut_assertnonnull(obj);
|
|
ut_assertok(scene_send_click(scn, (obj->bbox.x0 + obj->bbox.x1) / 2,
|
|
obj->bbox.y0 + 5, act));
|
|
ut_asserteq(expect_type, act->type);
|
|
|
|
return 0;
|
|
}
|