blob: 37fa02e5e39bd627c581eba984566d938b5cda5b [file] [log] [blame]
Denys Vlasenkodc9495d2009-08-02 19:45:31 +02001#!/bin/sh
2# Copyright 2009 by Denys Vlasenko
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02003# Licensed under GPLv2, see file LICENSE in this source tree.
Denys Vlasenkodc9495d2009-08-02 19:45:31 +02004
Mike Frysingercaa79402009-11-04 18:41:22 -05005. ./testing.sh
Denys Vlasenkodc9495d2009-08-02 19:45:31 +02006
7# testing "test name" "options" "expected result" "file input" "stdin"
8
9# Simple one-block file transfer
10# rx => 'C'
11# rx <= SOH <blockno> <255-blockno> <128 byte padded with x1A> <crc> <crc>
12# rx => ACK
13# rx <= EOT
14# rx => ACK
15testing "rx" \
16 "rx rx.OUTFILE | hexdump -vC && cat rx.OUTFILE" \
17"\
1800000000 43 06 06 |C..|\n\
1900000003\n\
20???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????" \
Denys Vlasenkoe82cf332010-05-12 15:59:32 +020021 "" "\01\01\0376\
Denys Vlasenkodc9495d2009-08-02 19:45:31 +020022???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????\
Denys Vlasenkoe82cf332010-05-12 15:59:32 +020023\x1A\x1A\x1A\x1A\x1A\x4B\xB0\04"
Denys Vlasenkodc9495d2009-08-02 19:45:31 +020024
25rm -f rx.OUTFILE 2>/dev/null
26
27exit $FAILCOUNT