yaffs Pulled the bugs section out of the README.txt and put it into current_bugs.txt
[yaffs2.git] / direct / timothy_tests / quick_tests / README.txt
1
2 Made by Timothy Manning <timothy@yaffs.net> on 04/11/2010
3
4
5 tests made
6         test_yaffs_mount
7         test_yaffs_mount_ENODEV
8         test_yaffs_mount_ENAMETOOLONG
9         test_yaffs_mount_ENOENT
10         test_yaffs_mount_EBUSY          //called when trying to mount a new mount point with a mount point already mounted.
11         test_yaffs_access
12         test_yaffs_close_EBADF
13         test_yaffs_ftruncate
14         test_yaffs_lseek
15         test_yaffs_open
16         test_yaffs_open_EEXIST
17         test_yaffs_open_EISDIR
18         test_yaffs_open_ENAMETOOLONG
19         test_yaffs_open_ENOENT
20         test_yaffs_open_ENOTDIR
21         test_yaffs_read
22         test_yaffs_stat
23         test_yaffs_truncate
24         test_yaffs_unlink
25         test_yaffs_unlink_EISDIR
26         test_yaffs_unlink_ENAMETOOLONG
27         test_yaffs_unlink_ENOENT
28         test_yaffs_unlink_ENOTDIR
29         test_yaffs_unlink_ENOENT
30         test_yaffs_unmount
31         test_yaffs_write
32
33
34 tests to add
35         test_yaffs_mount_EACCES         //Cannot be generated with yaffs.
36         test_yaffs_mount_EINVAL         //Cannot be generated with yaffs.
37         test_yaffs_mount_ELOOP          //Cannot be generated with yaffs.
38         test_yaffs_mount_EMFILE         //Cannot be generated with yaffs.
39         test_yaffs_mount_ENOTDIR        //Cannot be generated with yaffs.
40
41         test_yaffs_umount_ENODEV
42         test_yaffs_umount_ENAMETOOLONG
43         test_yaffs_umount_ENOENT
44         test_yaffs_umount_EBUSY
45
46         test_yaffs_open_EACCES
47         test_yaffs_open_ENOSPC
48         test_yaffs_open_ELOOP   //Too many symbolic links were encountered in resolving pathname
49         test yaffs_open_running_out_of_handles error
50
51         test_yaffs_close        //This function has already been called by the time this test is reached. 
52
53         test_yaffs_unlink_EACCES
54         test_yaffs_unlink_ELOOP
55         test_yaffs_unlink_ENOMEM
56
57         test_yaffs_access_EACCESS
58         test_yaffs_access_ELOOP
59         test_yaffs_access_ENAMETOOLONG
60         test_yaffs_access_ENOENT
61         test_yaffs_access_ENOTDIR
62         test_yaffs_access_ENIVAL        //mode is incorrect.
63
64         test_yaffs_ftruncate_EACCES
65         test_yaffs_ftruncate_EFBIG
66         test_yaffs_ftruncate_ENIVAL
67         test_yaffs_ftruncate_EISDIR
68         test_yaffs_ftruncate_ELOOP
69         test_yaffs_ftruncate_ENOENT
70         test_yaffs_ftruncate_ENOTDIR
71         test_yaffs_ftruncate_EPERM
72
73         test_yaffs_truncate_EACCES
74         test_yaffs_truncate_EFBIG
75         test_yaffs_truncate_ENIVAL
76         test_yaffs_truncate_EISDIR
77         test_yaffs_truncate_ELOOP
78         test_yaffs_truncate_ENAMETOOLONG
79         test_yaffs_truncate_ENOENT
80         test_yaffs_truncate_ENOTDIR
81         test_yaffs_truncate_EPERM
82
83         check to see if an error code is generated when there isn't an error.
84
85
86 How to add a test
87         First create the test .c and .h file.
88         The file name and test function name should be the same. 
89         This name should follow one of these formats: 
90         Test_yaffs_[function of yaffs which is been tested]
91         Test_yaffs_[function of yaffs which is been tested]_[error trying to be generated]
92         
93         The .c file needs to contain two functions.
94         The first function needs to contain the code for the main test and will return -1 on a failure and 0 or greater on a success.
95         The second function needs contain the code for cleaning up after the test. Cleaning up may include closing some open handles, recreating a file, ect. 
96         This second function needs to return -1 on a failure and 0 or greater on success.
97
98         The name of first function needs to be called the same as the file name (without the .c or .h)
99         The second function's name needs be the same as the first function but with "_clean" added on the end.
100         
101         So if a test is been created for the yaffs function yaffs_foo() then create these files
102         test_yaffs_foo.c
103                 Contains int test_yaffs_foo(void); int test_yaffs_foo_clean(void);
104         test_yaffs_foo.h
105                 Which includes "lib.h", "yaffsfs.h" header files.
106
107         Next write the test code in these files then add these files to the Makefile.
108
109         Add the name of the test files' object file (test_yaffs_foo.o ) to the TESTFILES tag around line 50 of the Makefile.    
110
111         Now add the test functions to the test_list[] array in quick_tests.h
112         The order of the tests matters. The idea is to test each yaffs_function individualy and only using tested yaffs_components before using this new yaffs_function. 
113         This array consists of: {[test function], [the clean function], [name of the tests which will be printed when the test fails]}, 
114         
115         So add this line to the test_list[]: {test_yaffs_foo, test_yaffs_foo_clean, "test_yaffs_foo"},
116
117         Also include the test's .h file in the quick_test.h file: #include "test_yaffs_foo.h"
118         
119         The test file should now make and run(you may need to make clean first). 
120
121
122
123         PS: yaffs_foo() is a made up function for this README (in case you want to find this function in yaffs). 
124
125
126
127
128
129