summaryrefslogtreecommitdiff
path: root/firmware/test/fat
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/test/fat')
-rw-r--r--firmware/test/fat/main.c22
-rw-r--r--firmware/test/fat/test.sh23
2 files changed, 44 insertions, 1 deletions
diff --git a/firmware/test/fat/main.c b/firmware/test/fat/main.c
index 9c1b983925..37ea2f49be 100644
--- a/firmware/test/fat/main.c
+++ b/firmware/test/fat/main.c
@@ -486,6 +486,21 @@ int dbg_trunc(char* name, int size)
486 return close(fd); 486 return close(fd);
487} 487}
488 488
489int dbg_mkdir(char* name)
490{
491 char text[BUFSIZE+1];
492 int i;
493 int fd;
494 int x=0;
495 bool stop = false;
496
497 fd = mkdir(name);
498 if (fd<0) {
499 DEBUGF("Failed creating directory\n");
500 return -1;
501 }
502}
503
489int dbg_cmd(int argc, char *argv[]) 504int dbg_cmd(int argc, char *argv[])
490{ 505{
491 char* cmd = NULL; 506 char* cmd = NULL;
@@ -577,6 +592,13 @@ int dbg_cmd(int argc, char *argv[])
577 } 592 }
578 } 593 }
579 594
595 if (!strcasecmp(cmd, "mkdir"))
596 {
597 if (arg1) {
598 return dbg_mkdir(arg1);
599 }
600 }
601
580 if (!strcasecmp(cmd, "del")) 602 if (!strcasecmp(cmd, "del"))
581 { 603 {
582 if (arg1) 604 if (arg1)
diff --git a/firmware/test/fat/test.sh b/firmware/test/fat/test.sh
index 44ff6bb849..9b1036b69c 100644
--- a/firmware/test/fat/test.sh
+++ b/firmware/test/fat/test.sh
@@ -38,9 +38,20 @@ buildimage() {
38runtests() { 38runtests() {
39 rm $RESULT 39 rm $RESULT
40 40
41 echo ---Test: create a long name directory in the root
42 try mkdir "/very long subdir name"
43 check
44 try mkdir "/very long subdir name/apa.monkey.me.now"
45 check
46
47 echo ---Test: create a directory called "dir"
48 try mkdir "/dir"
49 check
50
41 echo ---Test: create a 10K file 51 echo ---Test: create a 10K file
42 try mkfile "/really long filenames rock" 10 52 try mkfile "/really long filenames rock" 10
43 check 53 check
54
44 try mkfile /dir/apa.monkey.me.now 10 55 try mkfile /dir/apa.monkey.me.now 10
45 check 56 check
46 try chkfile "/really long filenames rock" 10 57 try chkfile "/really long filenames rock" 10
@@ -100,24 +111,34 @@ runtests() {
100 111
101} 112}
102 113
114echo "--------------------------------------"
103echo "Building test image (4 sector/cluster)" 115echo "Building test image (4 sector/cluster)"
116echo "--------------------------------------"
104buildimage 4 117buildimage 4
105runtests 118runtests
106 119
120echo "---------------------------------------"
107echo "Building test image (32 sectors/cluster)" 121echo "Building test image (32 sectors/cluster)"
122echo "---------------------------------------"
108buildimage 32 123buildimage 32
109runtests 124runtests
110 125
126echo "--------------------------------------"
111echo "Building test image (1 sector/cluster)" 127echo "Building test image (1 sector/cluster)"
128echo "--------------------------------------"
112buildimage 1 129buildimage 1
113runtests 130runtests
114 131
132echo "--------------------------------------"
115echo "Building test image (8 sectors/cluster)" 133echo "Building test image (8 sectors/cluster)"
134echo "--------------------------------------"
116buildimage 8 135buildimage 8
117runtests 136runtests
118 137
138echo "----------------------------------------"
119echo "Building test image (128 sectors/cluster)" 139echo "Building test image (128 sectors/cluster)"
140echo "----------------------------------------"
120buildimage 128 141buildimage 128
121runtests 142runtests
122 143
123echo "== Test completed sucessfully ==" 144echo "== Test completed successfully =="