From dd37a782a8637bdee703a13c949b222b9ba8b95d Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Mon, 1 Sep 2014 18:23:54 +0200 Subject: Add initial set of PD tests. This is a slightly modified version of the PD test suite that was part of libsigrokdecode previously. --- decoder/test/nrf24l01/nrf24l01_activate_cmd.output | 2 + .../test/nrf24l01/nrf24l01_activate_warning.output | 1 + .../test/nrf24l01/nrf24l01_communication_rx.output | 6 ++ .../test/nrf24l01/nrf24l01_communication_tx.output | 10 +++ .../nrf24l01/nrf24l01_excess_bytes_warning.output | 7 ++ decoder/test/nrf24l01/nrf24l01_misc_cmd.output | 5 ++ .../test/nrf24l01/nrf24l01_misc_register.output | 7 ++ decoder/test/nrf24l01/nrf24l01_misc_tx_data.output | 1 + decoder/test/nrf24l01/nrf24l01_misc_warning.output | 2 + .../nrf24l01/nrf24l01_missing_bytes_warning.output | 2 + .../nrf24l01/nrf24l01_no_command_register.output | 4 ++ decoder/test/nrf24l01/nrf24l01_rx.output | 1 + .../nrf24l01_unknown_command_warning.output | 2 + .../nrf24l01_unknown_register_warning.output | 1 + decoder/test/nrf24l01/test.conf | 80 ++++++++++++++++++++++ 15 files changed, 131 insertions(+) create mode 100644 decoder/test/nrf24l01/nrf24l01_activate_cmd.output create mode 100644 decoder/test/nrf24l01/nrf24l01_activate_warning.output create mode 100644 decoder/test/nrf24l01/nrf24l01_communication_rx.output create mode 100644 decoder/test/nrf24l01/nrf24l01_communication_tx.output create mode 100644 decoder/test/nrf24l01/nrf24l01_excess_bytes_warning.output create mode 100644 decoder/test/nrf24l01/nrf24l01_misc_cmd.output create mode 100644 decoder/test/nrf24l01/nrf24l01_misc_register.output create mode 100644 decoder/test/nrf24l01/nrf24l01_misc_tx_data.output create mode 100644 decoder/test/nrf24l01/nrf24l01_misc_warning.output create mode 100644 decoder/test/nrf24l01/nrf24l01_missing_bytes_warning.output create mode 100644 decoder/test/nrf24l01/nrf24l01_no_command_register.output create mode 100644 decoder/test/nrf24l01/nrf24l01_rx.output create mode 100644 decoder/test/nrf24l01/nrf24l01_unknown_command_warning.output create mode 100644 decoder/test/nrf24l01/nrf24l01_unknown_register_warning.output create mode 100644 decoder/test/nrf24l01/test.conf (limited to 'decoder/test/nrf24l01') diff --git a/decoder/test/nrf24l01/nrf24l01_activate_cmd.output b/decoder/test/nrf24l01/nrf24l01_activate_cmd.output new file mode 100644 index 0000000..0a4ea21 --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_activate_cmd.output @@ -0,0 +1,2 @@ +3-36 nrf24l01: cmd: "Cmd ACTIVATE" +41-74 nrf24l01: cmd: "Cmd ACTIVATE" diff --git a/decoder/test/nrf24l01/nrf24l01_activate_warning.output b/decoder/test/nrf24l01/nrf24l01_activate_warning.output new file mode 100644 index 0000000..64451ff --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_activate_warning.output @@ -0,0 +1 @@ +41-74 nrf24l01: warning: "wrong data for "ACTIVATE" command" diff --git a/decoder/test/nrf24l01/nrf24l01_communication_rx.output b/decoder/test/nrf24l01/nrf24l01_communication_rx.output new file mode 100644 index 0000000..4de4875 --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_communication_rx.output @@ -0,0 +1,6 @@ +378689-378962 nrf24l01: rx-data: "RX payload = "message #0"" +499905-500178 nrf24l01: rx-data: "RX payload = "message #1"" +621693-621966 nrf24l01: rx-data: "RX payload = "message #2"" +738358-738631 nrf24l01: rx-data: "RX payload = "message #3"" +867005-867279 nrf24l01: rx-data: "RX payload = "message #4"" +986889-987163 nrf24l01: rx-data: "RX payload = "message #5"" diff --git a/decoder/test/nrf24l01/nrf24l01_communication_tx.output b/decoder/test/nrf24l01/nrf24l01_communication_tx.output new file mode 100644 index 0000000..45ac8d5 --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_communication_tx.output @@ -0,0 +1,10 @@ +366098-366374 nrf24l01: tx-data: "TX payload = "message #0"" +488110-488387 nrf24l01: tx-data: "TX payload = "message #1"" +610131-610408 nrf24l01: tx-data: "TX payload = "message #2"" +732181-732458 nrf24l01: tx-data: "TX payload = "message #3"" +854221-854498 nrf24l01: tx-data: "TX payload = "message #4"" +976255-976531 nrf24l01: tx-data: "TX payload = "message #5"" +1098294-1098570 nrf24l01: tx-data: "TX payload = "message #6"" +1220322-1220597 nrf24l01: tx-data: "TX payload = "message #7"" +1342302-1342579 nrf24l01: tx-data: "TX payload = "message #8"" +1464309-1464586 nrf24l01: tx-data: "TX payload = "message #9"" diff --git a/decoder/test/nrf24l01/nrf24l01_excess_bytes_warning.output b/decoder/test/nrf24l01/nrf24l01_excess_bytes_warning.output new file mode 100644 index 0000000..7f7b9bd --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_excess_bytes_warning.output @@ -0,0 +1,7 @@ +75-91 nrf24l01: warning: "excess byte" +130-146 nrf24l01: warning: "excess byte" +185-201 nrf24l01: warning: "excess byte" +202-218 nrf24l01: warning: "excess byte" +325-341 nrf24l01: warning: "excess byte" +380-396 nrf24l01: warning: "excess byte" +962-978 nrf24l01: warning: "excess byte" diff --git a/decoder/test/nrf24l01/nrf24l01_misc_cmd.output b/decoder/test/nrf24l01/nrf24l01_misc_cmd.output new file mode 100644 index 0000000..041c365 --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_misc_cmd.output @@ -0,0 +1,5 @@ +3-19 nrf24l01: cmd: "Cmd REUSE_TX_PL" +24-40 nrf24l01: cmd: "Cmd R_RX_PL_WID" +62-78 nrf24l01: cmd: "Cmd R_RX_PL_WID" +83-99 nrf24l01: cmd: "Cmd R_RX_PL_WID" +138-154 nrf24l01: cmd: "Cmd W_ACK_PAYLOAD" diff --git a/decoder/test/nrf24l01/nrf24l01_misc_register.output b/decoder/test/nrf24l01/nrf24l01_misc_register.output new file mode 100644 index 0000000..a3d38de --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_misc_register.output @@ -0,0 +1,7 @@ +3-19 nrf24l01: register: "Reg STATUS = "00"" +24-40 nrf24l01: register: "Reg STATUS = "00"" +41-57 nrf24l01: register: "Payload width = 9" +62-78 nrf24l01: register: "Reg STATUS = "00"" +83-99 nrf24l01: register: "Reg STATUS = "00"" +100-116 nrf24l01: register: "Payload width = 9" +138-154 nrf24l01: register: "Reg STATUS = "00"" diff --git a/decoder/test/nrf24l01/nrf24l01_misc_tx_data.output b/decoder/test/nrf24l01/nrf24l01_misc_tx_data.output new file mode 100644 index 0000000..e28d662 --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_misc_tx_data.output @@ -0,0 +1 @@ +155-426 nrf24l01: tx-data: "ACK payload for pipe 1 = "\x00\x01\x02\x03\x04abcdef\x00\x01\x02\x03\x04"" diff --git a/decoder/test/nrf24l01/nrf24l01_misc_warning.output b/decoder/test/nrf24l01/nrf24l01_misc_warning.output new file mode 100644 index 0000000..4ec511e --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_misc_warning.output @@ -0,0 +1,2 @@ +79-79 nrf24l01: warning: "missing data bytes" +117-133 nrf24l01: warning: "excess byte" diff --git a/decoder/test/nrf24l01/nrf24l01_missing_bytes_warning.output b/decoder/test/nrf24l01/nrf24l01_missing_bytes_warning.output new file mode 100644 index 0000000..e1b6344 --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_missing_bytes_warning.output @@ -0,0 +1,2 @@ +20-20 nrf24l01: warning: "missing data bytes" +41-41 nrf24l01: warning: "missing data bytes" diff --git a/decoder/test/nrf24l01/nrf24l01_no_command_register.output b/decoder/test/nrf24l01/nrf24l01_no_command_register.output new file mode 100644 index 0000000..5e97b3e --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_no_command_register.output @@ -0,0 +1,4 @@ +11-27 nrf24l01: register: "Reg STATUS = "00"" +28-44 nrf24l01: register: "Reg CONFIG = "00"" +53-69 nrf24l01: register: "Reg STATUS = "00"" +70-86 nrf24l01: register: "Reg CONFIG = "00"" diff --git a/decoder/test/nrf24l01/nrf24l01_rx.output b/decoder/test/nrf24l01/nrf24l01_rx.output new file mode 100644 index 0000000..e04132e --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_rx.output @@ -0,0 +1 @@ +378689-378962 nrf24l01: rx-data: "RX payload = "message #0"" diff --git a/decoder/test/nrf24l01/nrf24l01_unknown_command_warning.output b/decoder/test/nrf24l01/nrf24l01_unknown_command_warning.output new file mode 100644 index 0000000..e229fe8 --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_unknown_command_warning.output @@ -0,0 +1,2 @@ +41-57 nrf24l01: warning: "unknown command" +58-74 nrf24l01: warning: "excess byte" diff --git a/decoder/test/nrf24l01/nrf24l01_unknown_register_warning.output b/decoder/test/nrf24l01/nrf24l01_unknown_register_warning.output new file mode 100644 index 0000000..fcb1d89 --- /dev/null +++ b/decoder/test/nrf24l01/nrf24l01_unknown_register_warning.output @@ -0,0 +1 @@ +20-36 nrf24l01: warning: "unknown register" diff --git a/decoder/test/nrf24l01/test.conf b/decoder/test/nrf24l01/test.conf new file mode 100644 index 0000000..986d30d --- /dev/null +++ b/decoder/test/nrf24l01/test.conf @@ -0,0 +1,80 @@ +test activate + protocol-decoder spi channel cs=0 channel clk=1 channel mosi=2 channel miso=3 + protocol-decoder nrf24l01 + stack spi nrf24l01 + input spi/nrf24l01/nrf24l01-test-activate.sr + output nrf24l01 annotation class cmd match nrf24l01_activate_cmd.output + output nrf24l01 annotation class warning match nrf24l01_activate_warning.output + +test communication-rx + protocol-decoder spi channel cs=0 channel clk=1 channel mosi=2 channel miso=3 + protocol-decoder nrf24l01 + stack spi nrf24l01 + input spi/nrf24l01/nrf24l01-communication-rx.sr + output nrf24l01 annotation class rx-data match nrf24l01_communication_rx.output + +test communication-tx + protocol-decoder spi channel cs=0 channel clk=1 channel mosi=2 channel miso=3 + protocol-decoder nrf24l01 + stack spi nrf24l01 + input spi/nrf24l01/nrf24l01-communication-tx.sr + output nrf24l01 annotation class tx-data match nrf24l01_communication_tx.output + +test excess-bytes + protocol-decoder spi channel cs=0 channel clk=1 channel mosi=2 channel miso=3 + protocol-decoder nrf24l01 + stack spi nrf24l01 + input spi/nrf24l01/nrf24l01-test-excess-bytes.sr + output nrf24l01 annotation class warning match nrf24l01_excess_bytes_warning.output + +test misc + protocol-decoder spi channel cs=0 channel clk=1 channel mosi=2 channel miso=3 + protocol-decoder nrf24l01 + stack spi nrf24l01 + input spi/nrf24l01/nrf24l01-test-misc.sr + output nrf24l01 annotation class cmd match nrf24l01_misc_cmd.output + output nrf24l01 annotation class tx-data match nrf24l01_misc_tx_data.output + output nrf24l01 annotation class register match nrf24l01_misc_register.output + output nrf24l01 annotation class warning match nrf24l01_misc_warning.output + +test missing-bytes + protocol-decoder spi channel cs=0 channel clk=1 channel mosi=2 channel miso=3 + protocol-decoder nrf24l01 + stack spi nrf24l01 + input spi/nrf24l01/nrf24l01-test-missing-bytes.sr + output nrf24l01 annotation class warning match nrf24l01_missing_bytes_warning.output + +test no-command + protocol-decoder spi channel cs=0 channel clk=1 channel mosi=2 channel miso=3 + protocol-decoder nrf24l01 + stack spi nrf24l01 + input spi/nrf24l01/nrf24l01-test-no-command.sr + output nrf24l01 annotation class register match nrf24l01_no_command_register.output + +test no-mosi + protocol-decoder spi channel cs=0 channel clk=1 channel miso=3 + protocol-decoder nrf24l01 + stack spi nrf24l01 + input spi/nrf24l01/nrf24l01-test-no-command.sr + output nrf24l01 exception match ChannelError + +test no-miso + protocol-decoder spi channel cs=0 channel clk=1 channel mosi=2 + protocol-decoder nrf24l01 + stack spi nrf24l01 + input spi/nrf24l01/nrf24l01-test-no-command.sr + output nrf24l01 exception match ChannelError + +test unknown-command + protocol-decoder spi channel cs=0 channel clk=1 channel mosi=2 channel miso=3 + protocol-decoder nrf24l01 + stack spi nrf24l01 + input spi/nrf24l01/nrf24l01-test-unknown-command.sr + output nrf24l01 annotation class warning match nrf24l01_unknown_command_warning.output + +test unknown-register + protocol-decoder spi channel cs=0 channel clk=1 channel mosi=2 channel miso=3 + protocol-decoder nrf24l01 + stack spi nrf24l01 + input spi/nrf24l01/nrf24l01-test-unknown-register.sr + output nrf24l01 annotation class warning match nrf24l01_unknown_register_warning.output -- cgit v1.2.3-54-g00ecf