3
0

rx.tests 852 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. # Copyright 2009 by Denys Vlasenko
  3. # Licensed under GPLv2, see file LICENSE in this source tree.
  4. . ./testing.sh
  5. # testing "test name" "options" "expected result" "file input" "stdin"
  6. # Simple one-block file transfer
  7. # rx => 'C'
  8. # rx <= SOH <blockno> <255-blockno> <128 byte padded with x1A> <crc> <crc>
  9. # rx => ACK
  10. # rx <= EOT
  11. # rx => ACK
  12. testing "rx" \
  13. "rx rx.OUTFILE | hexdump -vC && cat rx.OUTFILE" \
  14. "\
  15. 00000000 43 06 06 |C..|\n\
  16. 00000003\n\
  17. ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????" \
  18. "" "\01\01\0376\
  19. ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????\
  20. \x1A\x1A\x1A\x1A\x1A\x4B\xB0\04"
  21. rm -f rx.OUTFILE 2>/dev/null
  22. exit $FAILCOUNT