851315c94697d7a34513df1d560a51a142b82c67
[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
7 test_yaffs_access.c
8 test_yaffs_access_EACCES.c
9 test_yaffs_access_EINVAL.c
10 test_yaffs_access_ELOOP.c
11 test_yaffs_access_ELOOP_dir.c
12 test_yaffs_access_ENAMETOOLONG.c
13 test_yaffs_access_ENOENT2.c
14 test_yaffs_access_ENOENT.c
15 test_yaffs_access_ENOTDIR.c
16 test_yaffs_access_EROFS.c
17 test_yaffs_access_NULL.c
18
19 test_yaffs_chmod.c
20 test_yaffs_chmod_EINVAL.c
21 test_yaffs_chmod_ELOOP.c
22 test_yaffs_chmod_ELOOP_dir.c
23 test_yaffs_chmod_ENAMETOOLONG.c
24 test_yaffs_chmod_ENOENT2.c
25 test_yaffs_chmod_ENOENT.c
26 test_yaffs_chmod_ENOTDIR.c
27 test_yaffs_chmod_EROFS.c
28 test_yaffs_chmod_NULL.c
29
30 test_yaffs_close.c
31 test_yaffs_close_EBADF.c
32 test_yaffs_close_NULL.c
33
34 test_yaffs_fchmod.c
35 test_yaffs_fchmod_EBADF.c
36 test_yaffs_fchmod_EINVAL.c
37 test_yaffs_fchmod_EROFS.c
38 test_yaffs_fchmod_NULL.c
39
40 test_yaffs_fdatasync.c
41 test_yaffs_fdatasync_EBADF.c
42 test_yaffs_fdatasync_EROFS.c
43 test_yaffs_fdatasync_NULL.c
44
45 test_yaffs_flush.c
46 test_yaffs_flush_EBADF.c
47 test_yaffs_flush_EROFS.c
48
49 test_yaffs_freespace.c
50 test_yaffs_freespace_EINVAL.c
51 test_yaffs_freespace_ENAMETOOLONG.c
52 test_yaffs_freespace_NULL.c
53
54 test_yaffs_fstat.c
55 test_yaffs_fstat_EBADF.c
56
57 test_yaffs_fsync.c
58 test_yaffs_fsync_EBADF.c
59 test_yaffs_fsync_EROFS.c
60
61 test_yaffs_ftruncate_big_file.c
62 test_yaffs_ftruncate.c
63 test_yaffs_ftruncate_EBADF.c
64 test_yaffs_ftruncate_EINVAL.c
65 test_yaffs_ftruncate_EROFS.c
66
67 test_yaffs_inodecount.c
68 test_yaffs_inodecount_EINVAL.c
69 test_yaffs_inodecount_ENAMETOOLONG.c
70 test_yaffs_inodecount_NULL.c
71
72 test_yaffs_link.c
73 test_yaffs_link_EEXIST.c
74 test_yaffs_link_ELOOP_dir.c
75 test_yaffs_link_ENAMETOOLONG2.c
76 test_yaffs_link_ENAMETOOLONG.c
77 test_yaffs_link_ENOENT2.c
78 test_yaffs_link_ENOENT3.c
79 test_yaffs_link_ENOENT4.c
80 test_yaffs_link_ENOENT.c
81 test_yaffs_link_ENOTDIR2.c
82 test_yaffs_link_ENOTDIR.c
83 test_yaffs_link_EROFS.c
84 test_yaffs_link_NULL2.c
85 test_yaffs_link_NULL.c
86
87 test_yaffs_lseek_big_file.c
88 test_yaffs_lseek.c
89 test_yaffs_lseek_EBADF.c
90 test_yaffs_lseek_EINVAL.c
91 test_yaffs_lseek_EROFS.c
92
93 test_yaffs_lstat.c
94 test_yaffs_lstat_ENAMETOOLONG.c
95 test_yaffs_lstat_ENOENT.c
96 test_yaffs_lstat_ENOTDIR.c
97 test_yaffs_lstat_NULL.c
98
99 test_yaffs_mkdir.c
100 test_yaffs_mkdir_EEXIST.c
101 test_yaffs_mkdir_ELOOP_dir.c
102 test_yaffs_mkdir_ENAMETOOLONG.c
103 test_yaffs_mkdir_ENOENT.c
104 test_yaffs_mkdir_ENOTDIR.c
105 test_yaffs_mkdir_EROFS.c
106 test_yaffs_mkdir_NULL.c
107
108 test_yaffs_mount2.c
109 test_yaffs_mount2_ENODEV.c
110
111 test_yaffs_mount.c
112 test_yaffs_mount_EBUSY.c
113 test_yaffs_mount_ENAMETOOLONG.c
114 test_yaffs_mount_ENODEV.c
115 test_yaffs_mount_NULL.c
116
117 test_yaffs_open.c
118 test_yaffs_open_EACCES.c
119 test_yaffs_open_EEXIST.c
120 test_yaffs_open_EINVAL2.c
121 test_yaffs_open_EINVAL.c
122 test_yaffs_open_EISDIR.c
123 test_yaffs_open_ELOOP.c
124 test_yaffs_open_ELOOP_dir.c
125 test_yaffs_open_ENAMETOOLONG.c
126 test_yaffs_open_ENOENT.c
127 test_yaffs_open_ENOTDIR.c
128 test_yaffs_open_EROFS.c
129 test_yaffs_open_NULL.c
130
131 test_yaffs_read.c
132 test_yaffs_read_EBADF.c
133 test_yaffs_read_EINVAL.c
134
135 test_yaffs_remount_EINVAL.c
136 test_yaffs_remount_ENAMETOOLONG.c
137 test_yaffs_remount_ENODEV.c
138 test_yaffs_remount_force_off_read_only_off.c
139 test_yaffs_remount_force_off_read_only_on.c
140 test_yaffs_remount_force_on_read_only_off.c
141 test_yaffs_remount_force_on_read_only_on.c
142 test_yaffs_remount_NULL.c
143
144 test_yaffs_rename.c
145 test_yaffs_rename_dir.c
146 test_yaffs_rename_dir_ENOENT2.c
147 test_yaffs_rename_dir_ENOENT.c
148 test_yaffs_rename_dir_not_empty.c
149 test_yaffs_rename_dir_to_file.c
150 test_yaffs_rename_EEXISTS.c
151 test_yaffs_rename_EINVAL.c
152 test_yaffs_rename_ELOOP_dir.c
153 test_yaffs_rename_ENAMETOOLONG2.c
154 test_yaffs_rename_ENAMETOOLONG.c
155 test_yaffs_rename_ENOENT.c
156 test_yaffs_rename_ENOTDIR.c
157 test_yaffs_rename_EROFS.c
158 test_yaffs_rename_file_to_dir.c
159 test_yaffs_rename_NULL2.c
160 test_yaffs_rename_NULL.c
161
162 test_yaffs_rmdir.c
163 test_yaffs_rmdir_EBUSY.c
164 test_yaffs_rmdir_EINVAL.c
165 test_yaffs_rmdir_ELOOP_dir.c
166 test_yaffs_rmdir_ENAMETOOLONG.c
167 test_yaffs_rmdir_ENOENT.c
168 test_yaffs_rmdir_ENOTDIR.c
169 test_yaffs_rmdir_EROFS.c
170 test_yaffs_rmdir_NULL.c
171
172 test_yaffs_stat.c
173 test_yaffs_stat_ELOOP.c
174 test_yaffs_stat_ELOOP_dir.c
175 test_yaffs_stat_ENAMETOOLONG.c
176 test_yaffs_stat_ENOENT2.c
177 test_yaffs_stat_ENOENT.c
178 test_yaffs_stat_ENOTDIR.c
179 test_yaffs_stat_NULL.c
180
181 test_yaffs_symlink.c
182 test_yaffs_symlink_EEXIST.c
183 test_yaffs_symlink_ELOOP_dir.c
184 test_yaffs_symlink_ENAMETOOLONG.c
185 test_yaffs_symlink_ENOENT2.c
186 test_yaffs_symlink_ENOENT.c
187 test_yaffs_symlink_ENOTDIR.c
188 test_yaffs_symlink_EROFS.c
189 test_yaffs_symlink_NULL2.c
190 test_yaffs_symlink_NULL.c
191
192 test_yaffs_sync.c
193 test_yaffs_sync_ENAMETOOLONG.c
194 test_yaffs_sync_ENODEV.c
195 test_yaffs_sync_EROFS.c
196 test_yaffs_sync_NULL.c
197
198 test_yaffs_totalspace.c
199 test_yaffs_totalspace_EINVAL.c
200 test_yaffs_totalspace_ENAMETOOLONG.c
201 test_yaffs_totalspace_NULL.c
202
203 test_yaffs_truncate_big_file.c
204 test_yaffs_truncate.c
205 test_yaffs_truncate_EINVAL.c
206 test_yaffs_truncate_EISDIR.c
207 test_yaffs_truncate_ELOOP.c
208 test_yaffs_truncate_ELOOP_dir.c
209 test_yaffs_truncate_ENAMETOOLONG.c
210 test_yaffs_truncate_ENOENT2.c
211 test_yaffs_truncate_ENOENT.c
212 test_yaffs_truncate_ENOTDIR.c
213 test_yaffs_truncate_EROFS.c
214 test_yaffs_truncate_NULL.c
215
216 test_yaffs_unlink.c
217 test_yaffs_unlink_EISDIR.c
218 test_yaffs_unlink_ELOOP_dir.c
219 test_yaffs_unlink_ENAMETOOLONG.c
220 test_yaffs_unlink_ENOENT2.c
221 test_yaffs_unlink_ENOENT.c
222 test_yaffs_unlink_ENOTDIR.c
223 test_yaffs_unlink_EROFS.c
224 test_yaffs_unlink_NULL.c
225
226 test_yaffs_unmount2.c
227 test_yaffs_unmount2_EINVAL.c
228 test_yaffs_unmount2_ENODEV.c
229 test_yaffs_unmount2_with_handle_open_and_forced_mode_off.c
230 test_yaffs_unmount2_with_handle_open_and_forced_mode_on.c
231 test_yaffs_unmount.c
232 test_yaffs_unmount_EBUSY.c
233 test_yaffs_unmount_ENAMETOOLONG.c
234 test_yaffs_unmount_ENODEV.c
235 test_yaffs_unmount_NULL.c
236
237 test_yaffs_write_big_file.c
238 test_yaffs_write.c
239 test_yaffs_write_EBADF.c
240 test_yaffs_write_EROFS.c
241
242
243
244 Tests to add
245
246
247
248         test_yaffs_readlink
249         test_yaffs_readlink_ENOENT
250         test_yaffs_readlink_ENOTDIR
251         test_yaffs_readlink_ELOOP
252
253
254         test_yaffs_mount2_with read only set
255
256
257
258         test_yaffs_remount_force_off_read_only_on
259         test_yaffs_remount_force_on_read_only_on
260
261         test_yaffs_opendir
262
263         test_yaffs_readdir
264
265         test_yaffs_rewinddir
266
267         test_yaffs_closedir
268
269
270         test_yaffs_link_EPERM
271
272         test_yaffs_rmdir_ENOTEMPTY
273
274         test_yaffs_rename_EMLINK
275         test_yaffs_rename_EEXISTS or EPERM
276
277         test_yaffs_dup
278         test_yaffs_dup_EBADF            
279
280         test_yaffs_open_ENOSPC
281
282         test yaffs_open_running_out_of_handles error
283
284
285
286         test_yaffs_read_big_file
287         test what happens if you read off the end of the file?
288
289         test_yaffs_pread
290         test_yaffs_pread_EBADF
291         test_yaffs_pread_EINVAL
292         test_yaffs_pread_big_file
293
294         test_yaffs_write_big_file
295         test_yaffs_write_EINVAL
296         What happens when you run out of space?
297         
298         test_yaffs_write_EBADF
299         test_yaffs_write
300         test_yaffs_pwrite_big_file
301         test_yaffs_pwrite_EINVAL
302
303         test_yaffs_unlink_ENOMEM
304
305
306         test_yaffs_access_ENOENT_generated_with_a_dangling_symbloic_link
307
308
309         Add a truncate function for truncating a file size to -1.
310
311         What happens if a handle is opened to a file and the file is then deleted?
312         Check to see if yaffs generates an error code for no reason.
313         What happens when a file is opened with no modes set?
314
315         What happens when yaffs is unmounted twice?
316
317         What happens when open a handle, unmount yaffs and then try to use the handle? 
318
319         What happens when a mount point is mounted using mount2 with read only mode set and then a file is chmoded? 
320
321         Try to remove lost and found dir and replace it with a file of the same name.
322
323         Change the mode of the lost and found dir to read only.
324
325 Tests which do not exist in yaffs:
326         test_yaffs_close        //This function has already been called by the time this test is reached, 
327                                 //so there is no point in testing it.
328
329         test_yaffs_link_EMLINK          //should not happen on yaffs
330         test_yaffs_link_ELOOP
331         
332         test_yaffs_lstat_ELOOP
333
334         test_yaffs_mkdir_ELOOP
335
336         //the yaffs_mknod function does not exist in yaffsfs, so these tests will not be added.
337         test_yaffs_mknod_EACCES
338         test_yaffs_mknod_EEXIST
339         test_yaffs_mknod_EINVAL
340         test_yaffs_mknod_ELOOP
341         test_yaffs_mknod_ENAMETOOLONG
342         test_yaffs_mknod_ENOENT
343         test_yaffs_mknod_ENOTDIR
344         test_yaffs_mknod_EROFS
345
346         teat_yaffs_mount_ELOOP
347
348         test_yaffs_mount2_EINVAL        //cannot happen in yaffs since the mode is not checked.
349         test_yaffs_mount2_ENOTDIR       //cannot be generated in yaffs.
350         test_yaffs_mount2_ENOENT        //cannot be generated in yaffs.
351         test_yaffs_mount2_ELOOP
352
353         test_yaffs_remount_ENOENT       //cannot be generated in yaffs
354         test_yaffs_remount_ENOTDIR      //cannot be generated in yaffs
355
356         test_yaffs_unmount2_ENOENT      //cannot be generated in yaffs.
357         test_yaffs_unmount2_ENOTDIR     //cannot be generated in yaffs.
358
359 How to add a test
360         First create the test .c and .h file.
361         The file name and test function name should be the same. 
362         This name should follow one of these formats: 
363         Test_yaffs_[function of yaffs which is been tested]
364         Test_yaffs_[function of yaffs which is been tested]_[error trying to be generated]
365         
366         The .c file needs to contain two functions.
367         The first function needs to contain the code for the main test and will 
368         return -1 on a failure and 0 or greater on a success.
369         The second function needs contain the code for cleaning up after the test. 
370         Cleaning up may include closing some open handles, recreating a file, ect. 
371         This second function needs to return -1 on a failure and 0 or greater on success.
372
373         The name of first function needs to be called the same as the file 
374         name (without the .c or .h)
375         The second function's name needs be the same as the first function but 
376         with "_clean" added on the end.
377         
378         So if a test is been created for the yaffs function yaffs_foo() then 
379         create these files
380         test_yaffs_foo.c
381                 Contains int test_yaffs_foo(void); int test_yaffs_foo_clean(void);
382         test_yaffs_foo.h
383                 Which includes "lib.h", "yaffsfs.h" header files.
384
385         Next write the test code in these files then add these files to the Makefile.
386
387         Add the name of the test files' object file (test_yaffs_foo.o ) to the 
388         TESTFILES tag around line 50 of the Makefile.   
389
390         Now add the test functions to the test_list[] array in quick_tests.h
391         The order of the tests matters. The idea is to test each yaffs_function 
392         individualy and only using tested yaffs_components before using this new 
393         yaffs_function. 
394         This array consists of: 
395         {[test function], [the clean function], [name of the tests which will be printed when the test fails]}, 
396         
397         So add this line to the test_list[]: {test_yaffs_foo, test_yaffs_foo_clean, "test_yaffs_foo"},
398
399         Also include the test's .h file in the quick_test.h file: #include "test_yaffs_foo.h"
400         
401         The test file should now make and run(you may need to make clean first). 
402
403
404
405         PS: yaffs_foo() is a made up function for this README (in case you want 
406         to find this function in yaffs). 
407
408
409
410
411
412