aboutsummaryrefslogtreecommitdiffstats
path: root/tests/soft_uart/soft_uart_test.ok
diff options
context:
space:
mode:
Diffstat (limited to 'tests/soft_uart/soft_uart_test.ok')
-rw-r--r--tests/soft_uart/soft_uart_test.ok278
1 files changed, 278 insertions, 0 deletions
diff --git a/tests/soft_uart/soft_uart_test.ok b/tests/soft_uart/soft_uart_test.ok
new file mode 100644
index 00000000..dcd7ceb4
--- /dev/null
+++ b/tests/soft_uart/soft_uart_test.ok
@@ -0,0 +1,278 @@
+
+Executing test_rx
+======== testing 8-N-1 (no data)
+test_rx_exec() @ 0: flush the Rx buffer
+test_rx_exec() @ 6: flush the Rx buffer
+test_rx_exec() @ 12: flush the Rx buffer
+======== testing 8-N-1 (fill up flush)
+suart_rx_cb(flags=00): de ad be ef
+suart_rx_cb(flags=00): 00 aa 55 ff
+test_rx_exec() @ 101: flush the Rx buffer
+======== testing 8-N-1 (HELLO)
+test_rx_exec() @ 18: flush the Rx buffer
+suart_rx_cb(flags=00): 48
+test_rx_exec() @ 31: flush the Rx buffer
+suart_rx_cb(flags=00): 45
+test_rx_exec() @ 57: flush the Rx buffer
+suart_rx_cb(flags=00): 4c
+test_rx_exec() @ 70: flush the Rx buffer
+suart_rx_cb(flags=00): 4c
+test_rx_exec() @ 96: flush the Rx buffer
+suart_rx_cb(flags=00): 4f
+======== testing 8-N-1 (framing errors)
+suart_rx_cb(flags=01): 00
+suart_rx_cb(flags=01): aa
+test_rx_exec() @ 41: flush the Rx buffer
+suart_rx_cb(flags=00): ff
+======== testing 8-N-2 (HELLO)
+test_rx_exec() @ 20: flush the Rx buffer
+test_rx_exec() @ 22: flush the Rx buffer
+suart_rx_cb(flags=00): 48
+test_rx_exec() @ 35: flush the Rx buffer
+test_rx_exec() @ 37: flush the Rx buffer
+suart_rx_cb(flags=00): 45
+test_rx_exec() @ 65: flush the Rx buffer
+test_rx_exec() @ 67: flush the Rx buffer
+suart_rx_cb(flags=00): 4c
+test_rx_exec() @ 80: flush the Rx buffer
+test_rx_exec() @ 82: flush the Rx buffer
+suart_rx_cb(flags=00): 4c
+test_rx_exec() @ 110: flush the Rx buffer
+test_rx_exec() @ 112: flush the Rx buffer
+suart_rx_cb(flags=00): 4f
+======== testing 8-N-2 (framing errors)
+suart_rx_cb(flags=01): 00
+suart_rx_cb(flags=01): aa
+suart_rx_cb(flags=01): 55
+test_rx_exec() @ 57: flush the Rx buffer
+suart_rx_cb(flags=00): ff
+======== testing 8-E-1 (invalid parity)
+suart_rx_cb(flags=02): 00
+suart_rx_cb(flags=02): 01
+suart_rx_cb(flags=02): ff
+test_rx_exec() @ 49: flush the Rx buffer
+======== testing 8-E-1 (valid parity)
+test_rx_exec() @ 63: flush the Rx buffer
+suart_rx_cb(flags=00): 00 ff aa 55
+test_rx_exec() @ 120: flush the Rx buffer
+suart_rx_cb(flags=00): 80 e0 f8 fe
+======== testing 8-O-1 (invalid parity)
+suart_rx_cb(flags=02): 00
+suart_rx_cb(flags=02): 01
+suart_rx_cb(flags=02): ff
+test_rx_exec() @ 42: flush the Rx buffer
+======== testing 8-O-1 (valid parity)
+test_rx_exec() @ 63: flush the Rx buffer
+suart_rx_cb(flags=00): 00 ff aa 55
+test_rx_exec() @ 120: flush the Rx buffer
+suart_rx_cb(flags=00): 80 e0 f8 fe
+
+Executing test_rx_flush
+calling osmo_soft_uart_flush_rx() while Rx disabled
+enabling the receiver
+calling osmo_soft_uart_flush_rx() while Rx enabled, but no data
+testing corner case: manual flushing during a parity error (8-E-1)
+test_rx_exec() @ 47: flush the Rx buffer
+suart_rx_cb(flags=02): aa 55
+suart_rx_cb(flags=02): ff
+
+Executing test_tx_rx
+======== testing 8-N-1
+suart_tx_cb(len=4/4): de ad be ef
+suart_rx_cb(flags=00): de ad be ef
+test_tx_rx_exec_one(n_bits_total=40): 0011110111 0101101011 0011111011 0111101111
+suart_tx_cb(len=4/4): 00 aa 55 ff
+suart_rx_cb(flags=00): 00 aa 55 ff
+test_tx_rx_exec_one(n_bits_total=40): 0000000001 0010101011 0101010101 0111111111
+suart_tx_cb(len=4/4): 01 02 04 08
+suart_rx_cb(flags=00): 01 02 04 08
+test_tx_rx_exec_one(n_bits_total=40): 0100000001 0010000001 0001000001 0000100001
+suart_tx_cb(len=4/4): 10 20 40 80
+suart_rx_cb(flags=00): 10 20 40 80
+test_tx_rx_exec_one(n_bits_total=40): 0000010001 0000001001 0000000101 0000000011
+suart_tx_cb(len=0/4):
+test_tx_rx_exec_one(n_bits_total=40): 1111111111 1111111111 1111111111 1111111111
+======== testing 8-N-2
+suart_tx_cb(len=4/4): de ad be ef
+suart_rx_cb(flags=00): de ad be ef
+test_tx_rx_exec_one(n_bits_total=44): 00111101111 01011010111 00111110111 01111011111
+suart_tx_cb(len=4/4): 00 aa 55 ff
+suart_rx_cb(flags=00): 00 aa 55 ff
+test_tx_rx_exec_one(n_bits_total=44): 00000000011 00101010111 01010101011 01111111111
+suart_tx_cb(len=4/4): 01 02 04 08
+suart_rx_cb(flags=00): 01 02 04 08
+test_tx_rx_exec_one(n_bits_total=44): 01000000011 00100000011 00010000011 00001000011
+suart_tx_cb(len=4/4): 10 20 40 80
+suart_rx_cb(flags=00): 10 20 40 80
+test_tx_rx_exec_one(n_bits_total=44): 00000100011 00000010011 00000001011 00000000111
+suart_tx_cb(len=0/4):
+test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111
+======== testing 8-E-1
+suart_tx_cb(len=4/4): de ad be ef
+suart_rx_cb(flags=00): de ad be ef
+test_tx_rx_exec_one(n_bits_total=44): 00111101101 01011010111 00111110101 01111011111
+suart_tx_cb(len=4/4): 00 aa 55 ff
+suart_rx_cb(flags=00): 00 aa 55 ff
+test_tx_rx_exec_one(n_bits_total=44): 00000000001 00101010101 01010101001 01111111101
+suart_tx_cb(len=4/4): 01 02 04 08
+suart_rx_cb(flags=00): 01 02 04 08
+test_tx_rx_exec_one(n_bits_total=44): 01000000011 00100000011 00010000011 00001000011
+suart_tx_cb(len=4/4): 10 20 40 80
+suart_rx_cb(flags=00): 10 20 40 80
+test_tx_rx_exec_one(n_bits_total=44): 00000100011 00000010011 00000001011 00000000111
+suart_tx_cb(len=0/4):
+test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111
+======== testing 8-O-1
+suart_tx_cb(len=4/4): de ad be ef
+suart_rx_cb(flags=00): de ad be ef
+test_tx_rx_exec_one(n_bits_total=44): 00111101111 01011010101 00111110111 01111011101
+suart_tx_cb(len=4/4): 00 aa 55 ff
+suart_rx_cb(flags=00): 00 aa 55 ff
+test_tx_rx_exec_one(n_bits_total=44): 00000000011 00101010111 01010101011 01111111111
+suart_tx_cb(len=4/4): 01 02 04 08
+suart_rx_cb(flags=00): 01 02 04 08
+test_tx_rx_exec_one(n_bits_total=44): 01000000001 00100000001 00010000001 00001000001
+suart_tx_cb(len=4/4): 10 20 40 80
+suart_rx_cb(flags=00): 10 20 40 80
+test_tx_rx_exec_one(n_bits_total=44): 00000100001 00000010001 00000001001 00000000101
+suart_tx_cb(len=0/4):
+test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111
+======== testing 8-M-1
+suart_tx_cb(len=4/4): de ad be ef
+suart_rx_cb(flags=00): de ad be ef
+test_tx_rx_exec_one(n_bits_total=44): 00111101111 01011010111 00111110111 01111011111
+suart_tx_cb(len=4/4): 00 aa 55 ff
+suart_rx_cb(flags=00): 00 aa 55 ff
+test_tx_rx_exec_one(n_bits_total=44): 00000000011 00101010111 01010101011 01111111111
+suart_tx_cb(len=4/4): 01 02 04 08
+suart_rx_cb(flags=00): 01 02 04 08
+test_tx_rx_exec_one(n_bits_total=44): 01000000011 00100000011 00010000011 00001000011
+suart_tx_cb(len=4/4): 10 20 40 80
+suart_rx_cb(flags=00): 10 20 40 80
+test_tx_rx_exec_one(n_bits_total=44): 00000100011 00000010011 00000001011 00000000111
+suart_tx_cb(len=0/4):
+test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111
+======== testing 8-S-1
+suart_tx_cb(len=4/4): de ad be ef
+suart_rx_cb(flags=00): de ad be ef
+test_tx_rx_exec_one(n_bits_total=44): 00111101101 01011010101 00111110101 01111011101
+suart_tx_cb(len=4/4): 00 aa 55 ff
+suart_rx_cb(flags=00): 00 aa 55 ff
+test_tx_rx_exec_one(n_bits_total=44): 00000000001 00101010101 01010101001 01111111101
+suart_tx_cb(len=4/4): 01 02 04 08
+suart_rx_cb(flags=00): 01 02 04 08
+test_tx_rx_exec_one(n_bits_total=44): 01000000001 00100000001 00010000001 00001000001
+suart_tx_cb(len=4/4): 10 20 40 80
+suart_rx_cb(flags=00): 10 20 40 80
+test_tx_rx_exec_one(n_bits_total=44): 00000100001 00000010001 00000001001 00000000101
+suart_tx_cb(len=0/4):
+test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111
+======== testing 6-N-1
+suart_tx_cb(len=4/4): de ad be ef
+suart_rx_cb(flags=00): 1e 2d 3e 2f
+test_tx_rx_exec_one(n_bits_total=32): 00111101 01011011 00111111 01111011
+suart_tx_cb(len=4/4): 00 aa 55 ff
+suart_rx_cb(flags=00): 00 2a 15 3f
+test_tx_rx_exec_one(n_bits_total=32): 00000001 00101011 01010101 01111111
+suart_tx_cb(len=4/4): 01 02 04 08
+suart_rx_cb(flags=00): 01 02 04 08
+test_tx_rx_exec_one(n_bits_total=32): 01000001 00100001 00010001 00001001
+suart_tx_cb(len=4/4): 10 20 40 80
+suart_rx_cb(flags=00): 10 20 00 00
+test_tx_rx_exec_one(n_bits_total=32): 00000101 00000011 00000001 00000001
+suart_tx_cb(len=0/4):
+test_tx_rx_exec_one(n_bits_total=32): 11111111 11111111 11111111 11111111
+
+Executing test_tx_rx_pull_n
+======== pulling 32 bits (1 at a time)
+suart_tx_cb(len=1/1): 55
+suart_tx_cb(len=1/1): 55
+suart_tx_cb(len=1/1): 55
+suart_tx_cb(len=1/1): 55
+01010101010101010101010101010101
+======== feeding 32 bits into the receiver
+suart_rx_cb(flags=00): 55 55 55
+
+Executing test_tx_rx_pull_n
+======== pulling 32 bits (2 at a time)
+suart_tx_cb(len=1/1): 55
+suart_tx_cb(len=1/1): 55
+suart_tx_cb(len=1/1): 55
+suart_tx_cb(len=1/1): 55
+01010101010101010101010101010101
+======== feeding 32 bits into the receiver
+suart_rx_cb(flags=00): 55 55 55
+
+Executing test_tx_rx_pull_n
+======== pulling 32 bits (4 at a time)
+suart_tx_cb(len=1/1): 55
+suart_tx_cb(len=1/1): 55
+suart_tx_cb(len=1/1): 55
+01010101011101010101011101010101
+======== feeding 32 bits into the receiver
+suart_rx_cb(flags=00): 55 55
+
+Executing test_tx_rx_pull_n
+======== pulling 32 bits (8 at a time)
+suart_tx_cb(len=1/1): 55
+suart_tx_cb(len=1/1): 55
+01010101011111110101010101111111
+======== feeding 32 bits into the receiver
+suart_rx_cb(flags=00): 55 55
+
+Executing test_tx_pull
+pulling 25 bits (first time) out of the transmitter
+suart_tx_cb(len=2/2): 42 42
+pulling 25 bits (second time) out of the transmitter
+suart_tx_cb(len=2/2): 42 42
+
+Executing test_modem_status
+initial status=0x00000000
+de-asserting DCD, which was not asserted
+asserting both RI and DCD, expecting the callback to be called twice
+suart_status_change_cb(status=0x00000008)
+suart_status_change_cb(status=0x0000000a)
+de-asserting RI, expecting the callback to be called
+suart_status_change_cb(status=0x00000002)
+resetting to 0x00, expecting the callback to be called
+suart_status_change_cb(status=0x00000000)
+
+Executing test_flow_control_dtr_dsr
+initial status=0x00000000
+expecting osmo_soft_uart_tx_ubits() to yield nothing
+expecting osmo_soft_uart_rx_ubits() to yield nothing
+======== asserting both DTR and DSR
+suart_status_change_cb(status=0x00000001)
+suart_status_change_cb(status=0x00000005)
+expecting osmo_soft_uart_tx_ubits() to yield 40 bits (requesting 40 bits)
+suart_tx_cb(len=4/4): 42 42 42 42
+0010000101001000010100100001010010000101
+expecting osmo_soft_uart_rx_ubits() to consume 40 bits and yield 4 chars
+suart_rx_cb(flags=00): 42 42 42 42
+expecting osmo_soft_uart_tx_ubits() to yield 2 bits (requesting 2 bits)
+suart_tx_cb(len=1/1): 42
+======== de-asserting DSR
+suart_status_change_cb(status=0x00000001)
+expecting osmo_soft_uart_tx_ubits() to yield 8 bits (requesting 40 bits)
+expecting osmo_soft_uart_rx_ubits() to consume 40 bits and yield a pending char
+suart_rx_cb(flags=00): 42
+
+Executing test_flow_control_rts_cts
+initial status=0x00000000
+expecting osmo_soft_uart_tx_ubits() to yield nothing
+expecting osmo_soft_uart_rx_ubits() to yield nothing
+======== asserting both CTS and RTS/RTR
+suart_status_change_cb(status=0x00000020)
+suart_status_change_cb(status=0x00000030)
+expecting osmo_soft_uart_tx_ubits() to yield 40 bits (requesting 40 bits)
+suart_tx_cb(len=4/4): 42 42 42 42
+0010000101001000010100100001010010000101
+expecting osmo_soft_uart_rx_ubits() to consume 40 bits and yield 4 chars
+suart_rx_cb(flags=00): 42 42 42 42
+expecting osmo_soft_uart_tx_ubits() to yield 2 bits (requesting 2 bits)
+suart_tx_cb(len=1/1): 42
+======== de-asserting CTS
+suart_status_change_cb(status=0x00000010)
+expecting osmo_soft_uart_tx_ubits() to yield 8 bits (requesting 40 bits)
+expecting osmo_soft_uart_rx_ubits() to consume 40 bits and yield a pending char
+suart_rx_cb(flags=00): 42