forked from ghidraninja/game-and-watch-flashloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·31 lines (27 loc) · 798 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
if [[ "$VERBOSE" == "1" ]]; then
set -ex
else
set -e
fi
TMPFILE=$(mktemp /tmp/flash_test.XXXXXX)
if [[ ! -e $TMPFILE ]]; then
echo "Can't create tempfile!"
exit 1
fi
sizes="1 2 3 4 5 6"
for exp in $(seq 3 24); do
sizes="$sizes $(( 2**exp - 1 )) $(( 2**exp )) $(( 2**exp + 1 ))"
done
for size in $sizes ; do
echo "----------------------------------------"
echo "----------------------------------------"
echo "----------------------------------------"
echo "Testing with size = $size"
echo "----------------------------------------"
echo "----------------------------------------"
echo "----------------------------------------"
rm -f $TMPFILE
dd if=/dev/urandom of=$TMPFILE bs=1 count=$size
./flash_multi.sh $TMPFILE
done