Skip to content

Commit 4cc0cd6

Browse files
author
Daniel Campora
committed
tests/wipy: Additional tests for when the UART is un-initialized.
1 parent d936317 commit 4cc0cd6

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

tests/wipy/uart.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'''
2-
UART test fro the CC3200 based boards.
2+
UART test for the CC3200 based boards.
33
UART0 and UART1 must be connected together for this test to pass.
44
'''
55

@@ -109,23 +109,28 @@
109109
except Exception:
110110
print('Exception')
111111

112-
uart0 = UART(0, 1000000)
113-
uart0.deinit()
114112
try:
115113
uart0.read()
116114
except Exception:
117115
print('Exception')
118116

119-
uart0 = UART(0, 1000000)
120-
uart0.deinit()
121117
try:
122118
uart0.write('abc')
123119
except Exception:
124120
print('Exception')
125121

126-
uart0 = UART(0, 1000000)
127-
uart0.deinit()
128122
try:
129123
uart0.sendbreak('abc')
130124
except Exception:
131125
print('Exception')
126+
127+
for uart_id in uart_id_range:
128+
uart = UART(uart_id, 1000000)
129+
uart.deinit()
130+
# test printing an unitialized uart
131+
print(uart)
132+
# initialize it back and check that it works again
133+
uart.init(115200)
134+
print(uart)
135+
uart.read()
136+

tests/wipy/uart.py.exp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ Exception
4040
Exception
4141
Exception
4242
Exception
43+
UART(0)
44+
UART(0, baudrate=115200, bits=8, parity=None, stop=1)
45+
UART(1)
46+
UART(1, baudrate=115200, bits=8, parity=None, stop=1)

0 commit comments

Comments
 (0)