aboutsummaryrefslogtreecommitdiff
path: root/test/test-main.c
diff options
context:
space:
mode:
authorSimon Glass2022-03-04 08:43:01 -0700
committerTom Rini2022-03-10 08:28:36 -0500
commit7d02645fe4c07efe253f68d2d6134922e7c5323e (patch)
treefc3a8a8a4af25118b174deafd2d1ce25887ab9c8 /test/test-main.c
parent87a5d1b5d012b0663517bfa36f5e01c8028f121a (diff)
event: Add a simple test
Add a test for event registration and activation. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/test-main.c')
-rw-r--r--test/test-main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/test-main.c b/test/test-main.c
index 8fcb02ecea5..ee38d1faea8 100644
--- a/test/test-main.c
+++ b/test/test-main.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <console.h>
#include <dm.h>
+#include <event.h>
#include <dm/root.h>
#include <dm/test.h>
#include <dm/uclass-internal.h>
@@ -218,6 +219,8 @@ static int dm_test_restore(struct device_node *of_root)
*/
static int test_pre_run(struct unit_test_state *uts, struct unit_test *test)
{
+ ut_assertok(event_init());
+
if (test->flags & UT_TESTF_DM)
ut_assertok(dm_test_pre_run(uts));
@@ -260,6 +263,7 @@ static int test_post_run(struct unit_test_state *uts, struct unit_test *test)
ut_unsilence_console(uts);
if (test->flags & UT_TESTF_DM)
ut_assertok(dm_test_post_run(uts));
+ ut_assertok(event_uninit());
return 0;
}