]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
dm: test: Add tests for get/find uclass's device by name
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Mon, 20 Apr 2015 11:32:33 +0000 (13:32 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:30:10 +0000 (22:30 +0200)
commite4e4fae6383bbdec5ed0771d70cc20c9ba2b9a2f
tree493718d64479029f53d7a11b8d8294fcd6043c24
parentb775e4e19f1353b70aa6fdfb431abac9a23a264d
dm: test: Add tests for get/find uclass's device by name

This commit introduces simple tests for functions:
- uclass_find_device_by_name()
- uclass_get_device_by_name()

Tests added by this commit:
- Test: dm_test_uclass_devices_find_by_name: for uclass id: UCLASS_TEST_FDT
 * get uclass's devices by uclass_find_first/next_device() each as 'testdev',
 * for each returned device, call: uclass_find_device_by_name(),
   with previously returned device's name as an argument ('testdev->name').
 * for the found device ('founddev') check if:
   * founddev != NULL
   * testdev == founddev
   * testdev->name == founddev->name (by strcmp)

- Test: dm_test_uclass_devices_get_by_name: for uclass id: UCLASS_TEST_FDT
 * get uclass's devices by uclass_get_first/next_device() each as 'testdev',
 * for each returned device, call: uclass_get_device_by_name(),
   with previously returned device's name as an argument ('testdev->name').
 * for the found device ('founddev') check if:
   * founddev != NULL
   * founddev is active
   * testdev == founddev
   * testdev->name == founddev->name (by strcmp)

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
test/dm/core.c