1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) 2018 Theobroma Systems Design und Consulting GmbH
14 static int dm_test_bootcount(struct unit_test_state *uts)
19 ut_assertok(uclass_get_device(UCLASS_BOOTCOUNT, 0, &dev));
20 ut_assertok(dm_bootcount_set(dev, 0));
21 ut_assertok(dm_bootcount_get(dev, &val));
23 ut_assertok(dm_bootcount_set(dev, 0xab));
24 ut_assertok(dm_bootcount_get(dev, &val));
25 ut_assert(val == 0xab);
30 DM_TEST(dm_test_bootcount, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);