tests/wipy: Additional tests for when the UART is un-initialized.

This commit is contained in:
Daniel Campora 2015-09-08 15:19:24 +02:00
parent d936317143
commit 4cc0cd6cab
2 changed files with 16 additions and 7 deletions

View File

@ -1,5 +1,5 @@
'''
UART test fro the CC3200 based boards.
UART test for the CC3200 based boards.
UART0 and UART1 must be connected together for this test to pass.
'''
@ -109,23 +109,28 @@ try:
except Exception:
print('Exception')
uart0 = UART(0, 1000000)
uart0.deinit()
try:
uart0.read()
except Exception:
print('Exception')
uart0 = UART(0, 1000000)
uart0.deinit()
try:
uart0.write('abc')
except Exception:
print('Exception')
uart0 = UART(0, 1000000)
uart0.deinit()
try:
uart0.sendbreak('abc')
except Exception:
print('Exception')
for uart_id in uart_id_range:
uart = UART(uart_id, 1000000)
uart.deinit()
# test printing an unitialized uart
print(uart)
# initialize it back and check that it works again
uart.init(115200)
print(uart)
uart.read()

View File

@ -40,3 +40,7 @@ Exception
Exception
Exception
Exception
UART(0)
UART(0, baudrate=115200, bits=8, parity=None, stop=1)
UART(1)
UART(1, baudrate=115200, bits=8, parity=None, stop=1)