summaryrefslogtreecommitdiff
path: root/test/dm/serial.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-12-05 20:32:25 -0500
committerTom Rini <trini@konsulko.com>2018-12-05 20:32:25 -0500
commit2a055ea53260ac8addeeb94eb671172844bc9106 (patch)
tree5998b40de7145d98b553d7eb78b7a16be79aac75 /test/dm/serial.c
parent9450ab2ba8d720bd9f73bccc0af2e2b5a2c2aaf1 (diff)
parentb288cd9600724ad3a0e55c8786e70741dd13deae (diff)
Merge tag 'dm-pull-5dec18' of git://git.denx.de/u-boot-dm
Minor sandbox enhancements / fixes tpm improvements to clear up v1/v2 support buildman toolchain fixes New serial options to set/get config
Diffstat (limited to 'test/dm/serial.c')
-rw-r--r--test/dm/serial.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/dm/serial.c b/test/dm/serial.c
index 5c603e1f42..19a15d5d95 100644
--- a/test/dm/serial.c
+++ b/test/dm/serial.c
@@ -11,7 +11,9 @@
static int dm_test_serial(struct unit_test_state *uts)
{
+ struct serial_device_info info_serial = {0};
struct udevice *dev_serial;
+ uint value_serial;
ut_assertok(uclass_get_device_by_name(UCLASS_SERIAL, "serial",
&dev_serial));
@@ -22,6 +24,16 @@ static int dm_test_serial(struct unit_test_state *uts)
* sandbox_serial driver
*/
ut_assertok(serial_setconfig(SERIAL_DEFAULT_CONFIG));
+ ut_assertok(serial_getconfig(&value_serial));
+ ut_assert(value_serial == SERIAL_DEFAULT_CONFIG);
+ ut_assertok(serial_getinfo(&info_serial));
+ ut_assert(info_serial.type == SERIAL_CHIP_UNKNOWN);
+ ut_assert(info_serial.addr == SERIAL_DEFAULT_ADDRESS);
+ /*
+ * test with a parameter which is NULL pointer
+ */
+ ut_asserteq(-EINVAL, serial_getconfig(NULL));
+ ut_asserteq(-EINVAL, serial_getinfo(NULL));
/*
* test with a serial config which is not supported by
* sandbox_serial driver: test with wrong parity