summaryrefslogtreecommitdiff
path: root/test_random.bash
diff options
context:
space:
mode:
Diffstat (limited to 'test_random.bash')
-rw-r--r--test_random.bash14
1 files changed, 11 insertions, 3 deletions
diff --git a/test_random.bash b/test_random.bash
index 81c8295..0939e24 100644
--- a/test_random.bash
+++ b/test_random.bash
@@ -20,6 +20,7 @@ mkdir -p ${TEST_DIR}
run_test_random() {
local pass_number=$1
+ local blocks_count=$2
local test_name_sanitized=${pass_number//[^a-zA-Z0-9_\-]/-}
local file_orig_bin=${TEST_DIR}/${test_name_sanitized}.orig.bin
local file_asm=${TEST_DIR}/${test_name_sanitized}.S
@@ -27,15 +28,18 @@ run_test_random() {
local file_as_elf=${TEST_DIR}/${test_name_sanitized}.as.elf
local file_as_bin=${TEST_DIR}/${test_name_sanitized}.as.bin
echo -ne "Test random, pass ${pass_number}... "
- dd if=/dev/urandom of=${file_orig_bin} bs=1024 count=1
+ dd if=/dev/urandom of=${file_orig_bin} bs=1024 count=${blocks_count} >/dev/null 2>&1
${DISASM} -o ${file_asm} ${file_orig_bin}
${AS} -o ${file_as_o} ${file_asm}
${LD} -o ${file_as_elf} ${file_as_o}
${OBJCOPY} ${file_as_elf} -O binary ${file_as_bin}
- if ! cmp ${file_orig_bin} ${file_as_bin} >/dev/null 2>&1; then
+ if ! cmp ${file_orig_bin} ${file_as_bin}; then
echo -e "${CRED}FAIL${CRST}: output and input binaries do not match"
+ hexdump -Cv ${file_orig_bin} >${file_orig_bin}.txt
+ hexdump -Cv ${file_as_bin} >${file_as_bin}.txt
echo ${file_orig_bin}
echo ${file_as_bin}
+ exit
else
echo -e "${CGREEN}OK${CRST}"
#cat ${file_asm}
@@ -43,5 +47,9 @@ run_test_random() {
}
for i in `seq 1 10`; do
- run_test_random $i
+ run_test_random huge$i 1024
+done
+
+for i in `seq 1 1000`; do
+ run_test_random tiny$i 1
done