2009-08-02 17:45:31 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Copyright 2009 by Denys Vlasenko
|
2010-08-16 18:14:46 +00:00
|
|
|
# Licensed under GPLv2, see file LICENSE in this source tree.
|
2009-08-02 17:45:31 +00:00
|
|
|
|
2009-11-04 23:41:22 +00:00
|
|
|
. ./testing.sh
|
2009-08-02 17:45:31 +00:00
|
|
|
|
|
|
|
# testing "test name" "options" "expected result" "file input" "stdin"
|
|
|
|
|
|
|
|
# Simple one-block file transfer
|
|
|
|
# rx => 'C'
|
|
|
|
# rx <= SOH <blockno> <255-blockno> <128 byte padded with x1A> <crc> <crc>
|
|
|
|
# rx => ACK
|
|
|
|
# rx <= EOT
|
|
|
|
# rx => ACK
|
|
|
|
testing "rx" \
|
|
|
|
"rx rx.OUTFILE | hexdump -vC && cat rx.OUTFILE" \
|
|
|
|
"\
|
|
|
|
00000000 43 06 06 |C..|\n\
|
|
|
|
00000003\n\
|
|
|
|
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????" \
|
2010-05-12 13:59:32 +00:00
|
|
|
"" "\01\01\0376\
|
2009-08-02 17:45:31 +00:00
|
|
|
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????\
|
2010-05-12 13:59:32 +00:00
|
|
|
\x1A\x1A\x1A\x1A\x1A\x4B\xB0\04"
|
2009-08-02 17:45:31 +00:00
|
|
|
|
|
|
|
rm -f rx.OUTFILE 2>/dev/null
|
|
|
|
|
|
|
|
exit $FAILCOUNT
|