1 // SPDX-License-Identifier: GPL-2.0+
8 #include <virtio_types.h>
10 #include <dm/device-internal.h>
13 #include <dm/uclass-internal.h>
14 #include <test/test.h>
17 /* Test of the virtio driver that does not have required driver ops */
18 static int dm_test_virtio_missing_ops(struct unit_test_state *uts)
22 /* find the virtio device */
23 ut_assertok(uclass_find_device(UCLASS_VIRTIO, 1, &bus));
26 * Probe the device should fail with error -ENOENT.
27 * See ops check in virtio_uclass_pre_probe().
29 ut_asserteq(-ENOENT, device_probe(bus));
33 DM_TEST(dm_test_virtio_missing_ops, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);