Some fixes and add NOR integrity code
[yaffs2.git] / direct / yaffs_test.c
1 /*
2  * YAFFS: Yet another FFS. A NAND-flash specific file system. 
3  *
4  * Copyright (C) 2002 Aleph One Ltd.
5  *   for Toby Churchill Ltd and Brightstar Engineering
6  *
7  * Created by Charles Manning <charles@aleph1.co.uk>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  *
13  */
14
15
16
17
18 #include <stdio.h>
19 #include <string.h>
20 #include <unistd.h>
21 #include <fcntl.h>
22
23 #include "yaffsfs.h"
24
25 #include "nor_stress.h"
26
27
28
29 void BadUsage(void)
30 {
31         printf("usage root_dir test_id\n");
32         printf(" test_id: fw_update fw_update_init\n");
33         exit(2);
34 }
35 int main(int argc, const char *argv[])
36 {
37         yaffs_StartUp();
38         if(argc == 3) {
39                 if(!strcmp(argv[2],"fw_update_init")){
40                         NorStressTestInitialise(argv[1]);
41                 }
42                 else if(!strcmp(argv[2],"fw_update")){
43                         NorStressTestRun(argv[1]);
44                 }
45                 else 
46                         BadUsage();
47         }
48         else
49                 BadUsage();
50         return 0;
51 }