diff options
author | Tom Rini <trini@konsulko.com> | 2022-04-15 08:04:16 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-04-15 08:04:16 -0400 |
commit | 74ae732d80f54540d3a244e0e28e66d263e6a57e (patch) | |
tree | e0ac006d78607573b9e00c1213a8e7bb56cf15a0 /test/dm/serial.c | |
parent | 42a2d90cf51acea56bf19006ed5688c93c099ff0 (diff) | |
parent | b8617df6d5c8afb74ae8bb4b732a8b56b4f5e9ee (diff) |
Merge branch '2022-04-14-assorted-updates'
- Apple M1 Ultra support, TI power domain fix, atsha204a big endian
support, LED cleanups and support for default-state, increase malloc
pool on sandbox, ubifs bugfix, further serial cleanup / semihost
support, fix a few cases around enabling/disabling FS support in SPL,
clean up duplication of table_compute_checksum()
Diffstat (limited to 'test/dm/serial.c')
-rw-r--r-- | test/dm/serial.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/dm/serial.c b/test/dm/serial.c index 0662b5f09b8..37d17a65f16 100644 --- a/test/dm/serial.c +++ b/test/dm/serial.c @@ -7,14 +7,22 @@ #include <log.h> #include <serial.h> #include <dm.h> +#include <asm/serial.h> #include <dm/test.h> #include <test/test.h> #include <test/ut.h> +static const char test_message[] = + "This is a test message\n" + "consisting of multiple lines\n"; + static int dm_test_serial(struct unit_test_state *uts) { + int i; struct serial_device_info info_serial = {0}; struct udevice *dev_serial; + size_t start, putc_written; + uint value_serial; ut_assertok(uclass_get_device_by_name(UCLASS_SERIAL, "serial", @@ -66,6 +74,17 @@ static int dm_test_serial(struct unit_test_state *uts) SERIAL_8_BITS, SERIAL_TWO_STOP))); + /* Verify that putc and puts print the same number of characters */ + sandbox_serial_endisable(false); + start = sandbox_serial_written(); + for (i = 0; i < sizeof(test_message) - 1; i++) + serial_putc(test_message[i]); + putc_written = sandbox_serial_written(); + serial_puts(test_message); + sandbox_serial_endisable(true); + ut_asserteq(putc_written - start, + sandbox_serial_written() - putc_written); + return 0; } |