static int dm_test_acpi_create_dmar(struct unit_test_state *uts)
{
struct acpi_dmar dmar;
+ struct udevice *cpu;
+ ut_assertok(uclass_first_device(UCLASS_CPU, &cpu));
+ ut_assertnonnull(cpu);
ut_assertok(acpi_create_dmar(&dmar, DMAR_INTR_REMAP));
ut_asserteq(DMAR_INTR_REMAP, dmar.flags);
ut_asserteq(32 - 1, dmar.host_address_width);
for (uclass_find_first_device(UCLASS_TEST, &dev);
dev;
uclass_find_next_device(&dev)) {
- ut_assert(dev);
+ ut_assertnonnull(dev);
uc_pdata = dev_get_uclass_platdata(dev);
ut_assert(uc_pdata);
for (uclass_find_first_device(UCLASS_TEST, &dev);
dev;
uclass_find_next_device(&dev)) {
- ut_assert(dev);
+ ut_assertnonnull(dev);
uc_pdata = dev_get_uclass_platdata(dev);
ut_assert(uc_pdata);
dev;
ret = uclass_find_next_device(&dev)) {
ut_assert(!ret);
- ut_assert(dev);
+ ut_assertnonnull(dev);
}
ut_assertok(uclass_find_first_device(UCLASS_TEST_DUMMY, &dev));
- ut_assert(!dev);
+ ut_assertnull(dev);
return 0;
}
testdev;
ret = uclass_find_next_device(&testdev)) {
ut_assertok(ret);
- ut_assert(testdev);
+ ut_assertnonnull(testdev);
findret = uclass_find_device_by_name(UCLASS_TEST_FDT,
testdev->name,
* allocation created in the bind() method.
*/
ut_assertok(uclass_find_first_device(UCLASS_TEST_DEVRES, &dev));
+ ut_assertnonnull(dev);
devres_get_stats(dev, &stats);
ut_asserteq(1, stats.allocs);
ut_asserteq(TEST_DEVRES_SIZE, stats.total_size);
struct udevice *back, *dev, *dev2;
ut_assertok(uclass_find_first_device(UCLASS_PANEL_BACKLIGHT, &back));
+ ut_assertnonnull(back);
ut_asserteq(-ENOENT, uclass_find_device_by_phandle(UCLASS_REGULATOR,
back, "missing", &dev));
ut_assertok(uclass_find_device_by_phandle(UCLASS_REGULATOR, back,
"power-supply", &dev));
+ ut_assertnonnull(dev);
ut_asserteq(0, device_active(dev));
ut_asserteq_str("ldo1", dev->name);
ut_assertok(uclass_get_device_by_phandle(UCLASS_REGULATOR, back,
/* check probe success */
ut_assertok(uclass_first_device(UCLASS_VIRTIO, &bus));
+ ut_assertnonnull(bus);
/* check the child virtio-blk device is bound */
ut_assertok(device_find_first_child(bus, &dev));
+ ut_assertnonnull(dev);
ut_assertok(strcmp(dev->name, "virtio-blk#0"));
/* check driver status */
/* check probe success */
ut_assertok(uclass_first_device(UCLASS_VIRTIO, &bus));
+ ut_assertnonnull(bus);
/* check the child virtio-blk device is bound */
ut_assertok(device_find_first_child(bus, &dev));
+ ut_assertnonnull(dev);
/*
* fake the virtio device probe by filling in uc_priv->vdev
* which is used by virtio_find_vqs/virtio_del_vqs.
*/
uc_priv = dev_get_uclass_priv(bus);
+ ut_assertnonnull(uc_priv);
uc_priv->vdev = dev;
/* test virtio_xxx APIs */
/* check probe success */
ut_assertok(uclass_first_device(UCLASS_VIRTIO, &bus));
+ ut_assertnonnull(bus);
/* check the child virtio-blk device is bound */
ut_assertok(device_find_first_child(bus, &dev));
+ ut_assertnonnull(dev);
/* set driver status to VIRTIO_CONFIG_S_DRIVER_OK */
ut_assertok(virtio_set_status(dev, VIRTIO_CONFIG_S_DRIVER_OK));