test_bin2fex_corner_cases.sh 497 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
#
# === Test errors / corner cases of "bin2fex", improving on code coverage ===
#
BIN2FEX=../bin2fex
TESTFILE=sunxi-boards/sys_config/a10/a10-olinuxino-lime
# use sunxi-fexc in "fex2bin" mode, testing explicit parameters at the same time
FEX2BIN="../sunxi-fexc -v -q -I fex -O bin"

${FEX2BIN} ${TESTFILE}.fex ${TESTFILE}.bin
# have bin2fex explicitly read /dev/stdin, to force use of fexc.c's "read_all()"
cat ${TESTFILE}.bin | ${BIN2FEX} /dev/stdin > /dev/null
rm -f ${TESTFILE}.bin