diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2015-05-20 22:27:27 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-05-21 16:16:16 +0300 |
commit | e721b882e9daf3ad3599eef5a9ccf3847b694228 (patch) | |
tree | d92fadcb65548e6ed19c60d4dfa27ecc80c3778c /test/dm/gpio.c | |
parent | 6e0d26c0502e4d697cb235069aef188f8f1407d3 (diff) | |
download | u-boot-e721b882e9daf3ad3599eef5a9ccf3847b694228.tar.xz |
test: Generalize the unit test framework
Separate the ability to define tests and assert status of test functions
from the dm tests so they can be used more consistently throughout all
tests.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm/gpio.c')
-rw-r--r-- | test/dm/gpio.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/dm/gpio.c b/test/dm/gpio.c index b29daf1af4..727db18690 100644 --- a/test/dm/gpio.c +++ b/test/dm/gpio.c @@ -8,15 +8,15 @@ #include <fdtdec.h> #include <dm.h> #include <dm/root.h> -#include <dm/ut.h> #include <dm/test.h> #include <dm/util.h> #include <asm/gpio.h> +#include <test/ut.h> DECLARE_GLOBAL_DATA_PTR; /* Test that sandbox GPIOs work correctly */ -static int dm_test_gpio(struct dm_test_state *dms) +static int dm_test_gpio(struct unit_test_state *uts) { unsigned int offset, gpio; struct dm_gpio_ops *ops; @@ -103,7 +103,7 @@ static int dm_test_gpio(struct dm_test_state *dms) DM_TEST(dm_test_gpio, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); /* Test that sandbox anonymous GPIOs work correctly */ -static int dm_test_gpio_anon(struct dm_test_state *dms) +static int dm_test_gpio_anon(struct unit_test_state *uts) { unsigned int offset, gpio; struct udevice *dev; @@ -125,7 +125,7 @@ static int dm_test_gpio_anon(struct dm_test_state *dms) DM_TEST(dm_test_gpio_anon, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); /* Test that gpio_requestf() works as expected */ -static int dm_test_gpio_requestf(struct dm_test_state *dms) +static int dm_test_gpio_requestf(struct unit_test_state *uts) { unsigned int offset, gpio; struct udevice *dev; @@ -143,7 +143,7 @@ static int dm_test_gpio_requestf(struct dm_test_state *dms) DM_TEST(dm_test_gpio_requestf, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); /* Test that gpio_request() copies its string */ -static int dm_test_gpio_copy(struct dm_test_state *dms) +static int dm_test_gpio_copy(struct unit_test_state *uts) { unsigned int offset, gpio; struct udevice *dev; @@ -165,19 +165,19 @@ static int dm_test_gpio_copy(struct dm_test_state *dms) DM_TEST(dm_test_gpio_copy, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); /* Test that we don't leak memory with GPIOs */ -static int dm_test_gpio_leak(struct dm_test_state *dms) +static int dm_test_gpio_leak(struct unit_test_state *uts) { - ut_assertok(dm_test_gpio(dms)); - ut_assertok(dm_test_gpio_anon(dms)); - ut_assertok(dm_test_gpio_requestf(dms)); - ut_assertok(dm_leak_check_end(dms)); + ut_assertok(dm_test_gpio(uts)); + ut_assertok(dm_test_gpio_anon(uts)); + ut_assertok(dm_test_gpio_requestf(uts)); + ut_assertok(dm_leak_check_end(uts)); return 0; } DM_TEST(dm_test_gpio_leak, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); /* Test that we can find GPIOs using phandles */ -static int dm_test_gpio_phandles(struct dm_test_state *dms) +static int dm_test_gpio_phandles(struct unit_test_state *uts) { struct gpio_desc desc, desc_list[8], desc_list2[8]; struct udevice *dev, *gpio_a, *gpio_b; |