event: Mark test_event_probe() as sandbox-only

This test skips itself if not running on sandbox, but by that time the
driver model state has already been reset. This can impact other tests.

Change the test so that it is only started on sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-07-11 13:59:14 +02:00
parent 37e7aec2d2
commit 5b5694a0f8

View File

@@ -67,6 +67,7 @@ static int test_event_simple(struct unit_test_state *uts)
}
COMMON_TEST(test_event_simple, 0);
#ifdef CONFIG_SANDBOX
static int h_probe(void *ctx, struct event *event)
{
struct test_state *test_state = ctx;
@@ -91,9 +92,6 @@ static int test_event_probe(struct unit_test_state *uts)
struct test_state state;
struct udevice *dev;
if (!IS_ENABLED(SANDBOX))
return -EAGAIN;
state.val = 0;
ut_assertok(event_register("pre", EVT_DM_PRE_PROBE, h_probe, &state));
ut_assertok(event_register("post", EVT_DM_POST_PROBE, h_probe, &state));
@@ -107,3 +105,4 @@ static int test_event_probe(struct unit_test_state *uts)
return 0;
}
COMMON_TEST(test_event_probe, UTF_DM | UTF_SCAN_FDT);
#endif /* SANDBOX */