summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNora Schiffer <[email protected]>2026-06-02 13:57:50 +0200
committerFabio Estevam <[email protected]>2026-06-05 12:56:32 -0300
commit0ef21dd37dc1779293a101413a7ce32bd63870bb (patch)
tree7492aca938acf40835a66d4538fef178d70c7e13 /test
parentfa03ee371de84b512e6f941395d4e13040eedd17 (diff)
sysinfo: add sysinfo_get_and_detect() helper
sysinfo_detect() is commonly called after sysinfo_get(). Make the API a bit more convenient to use by introducing a helper. Signed-off-by: Nora Schiffer <[email protected]> Signed-off-by: Alexander Feilke <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/dm/sysinfo.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/dm/sysinfo.c b/test/dm/sysinfo.c
index 14ebe6b42e7..611f2e98d14 100644
--- a/test/dm/sysinfo.c
+++ b/test/dm/sysinfo.c
@@ -66,3 +66,19 @@ static int dm_test_sysinfo(struct unit_test_state *uts)
return 0;
}
DM_TEST(dm_test_sysinfo, UTF_SCAN_PDATA | UTF_SCAN_FDT);
+
+static int dm_test_sysinfo_get_and_detect(struct unit_test_state *uts)
+{
+ struct udevice *sysinfo;
+ bool called_detect = false;
+
+ ut_assertok(sysinfo_get_and_detect(&sysinfo));
+ ut_assert(sysinfo);
+
+ ut_assertok(sysinfo_get_bool(sysinfo, BOOL_CALLED_DETECT,
+ &called_detect));
+ ut_assert(called_detect);
+
+ return 0;
+}
+DM_TEST(dm_test_sysinfo_get_and_detect, UTF_SCAN_PDATA | UTF_SCAN_FDT);