summaryrefslogtreecommitdiff
path: root/firmware/test
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/test')
-rw-r--r--firmware/test/fat/ata-sim.c2
-rw-r--r--firmware/test/fat/main.c12
-rw-r--r--firmware/test/fat/test.sh19
3 files changed, 27 insertions, 6 deletions
diff --git a/firmware/test/fat/ata-sim.c b/firmware/test/fat/ata-sim.c
index 04cdadb6ce..63abc58084 100644
--- a/firmware/test/fat/ata-sim.c
+++ b/firmware/test/fat/ata-sim.c
@@ -14,7 +14,7 @@ int ata_read_sectors(unsigned long start, unsigned char count, void* buf)
DEBUGF("[Reading %d blocks: 0x%lx to 0x%lx]\n",
count, start, start+count-1);
else
- DEBUGF("[Reading block 0x%lx, %d]\n", start, count);
+ DEBUGF("[Reading block 0x%lx]\n", start);
if(fseek(file,start*BLOCK_SIZE,SEEK_SET)) {
perror("fseek");
diff --git a/firmware/test/fat/main.c b/firmware/test/fat/main.c
index 68cef1f08c..58f83f45dc 100644
--- a/firmware/test/fat/main.c
+++ b/firmware/test/fat/main.c
@@ -267,6 +267,11 @@ void dbg_head(char* name)
close(fd);
}
+int dbg_del(char* name)
+{
+ return remove(name);
+}
+
char current_directory[256] = "\\";
int last_secnum = 0;
@@ -300,6 +305,7 @@ int dbg_cmd(int argc, char *argv[])
" tail <file>\n"
" mkfile <file> <size (KB)>\n"
" chkfile <file>\n"
+ " del <file>\n"
);
return -1;
}
@@ -358,6 +364,12 @@ int dbg_cmd(int argc, char *argv[])
}
}
+ if (!strcasecmp(cmd, "del"))
+ {
+ if (arg1)
+ return dbg_del(arg1);
+ }
+
return 0;
}
diff --git a/firmware/test/fat/test.sh b/firmware/test/fat/test.sh
index f723f69ec3..7d9435b85d 100644
--- a/firmware/test/fat/test.sh
+++ b/firmware/test/fat/test.sh
@@ -15,6 +15,7 @@ check() {
}
try() {
+ echo COMMAND: fat $1 $2 $3 >> $RESULT
./fat $1 $2 $3 2>> $RESULT
RETVAL=$?
[ $RETVAL -ne 0 ] && fail
@@ -25,6 +26,7 @@ buildimage() {
mount -o loop $IMAGE $MOUNT
echo "Filling it with /etc files"
find /etc -type f -maxdepth 1 -exec cp {} $MOUNT \;
+ mkdir $MOUNT/dir
umount $MOUNT
}
@@ -33,8 +35,10 @@ runtests() {
echo ---Test: create a 10K file
try mkfile /apa.txt 10
+ try mkfile /dir/apa.txt 10
check
try chkfile /apa.txt 10
+ try chkfile /dir/apa.txt 8
echo ---Test: create a 1K file
try mkfile /bpa.txt 1
@@ -64,7 +68,7 @@ runtests() {
try chkfile /bpa.txt
LOOP=50
- SIZE=50
+ SIZE=70
echo ---Test: create $LOOP $SIZE k files
for i in `seq 1 $LOOP`;
@@ -73,10 +77,19 @@ runtests() {
try mkfile /rockbox.$i $SIZE
check
try chkfile /rockbox.$i $SIZE
+ check
+ try del /rockbox.$i
+ check
+ try mkfile /rockbox.$i $SIZE
+ check
done
}
+echo "Building test image (4 sector/cluster)"
+buildimage 4
+runtests
+
echo "Building test image (128 sectors/cluster)"
buildimage 128
runtests
@@ -89,10 +102,6 @@ echo "Building test image (8 sectors/cluster)"
buildimage 8
runtests
-echo "Building test image (4 sector/cluster)"
-buildimage 4
-runtests
-
echo "Building test image (1 sector/cluster)"
buildimage 1
runtests