2 Made by Timothy Manning <timothy@yaffs.net> on 04/11/2010
8 test_yaffs_access_EINVAL.c
9 test_yaffs_access_ENOENT2.c
10 test_yaffs_access_ENOENT.c
11 test_yaffs_access_ENOTDIR.c
14 test_yaffs_chmod_EINVAL.c
15 test_yaffs_chmod_ENOENT2.c
16 test_yaffs_chmod_ENOENT.c
17 test_yaffs_chmod_ENOTDIR.c
20 test_yaffs_close_EBADF.c
23 test_yaffs_fchmod_EBADF.c
24 test_yaffs_fchmod_EINVAL.c
26 test_yaffs_fdatasync.c
27 test_yaffs_fdatasync_EBADF.c
29 test_yaffs_freespace.c
30 test_yaffs_freespace_EINVAL.c
33 test_yaffs_fstat_EBADF.c
36 test_yaffs_fsync_EBADF.c
38 test_yaffs_ftruncate_big_file.c
39 test_yaffs_ftruncate.c
40 test_yaffs_ftruncate_EBADF.c
41 test_yaffs_ftruncate_EINVAL.c
43 test_yaffs_inodecount.c
44 test_yaffs_inodecount_EINVAL.c
47 test_yaffs_link_EEXIST.c
48 test_yaffs_link_ENOENT2.c
49 test_yaffs_link_ENOENT3.c
50 test_yaffs_link_ENOENT.c
51 test_yaffs_link_ENOTDIR2.c
52 test_yaffs_link_ENOTDIR.c
54 test_yaffs_lseek_big_file.c
56 test_yaffs_lseek_EBADF.c
57 test_yaffs_lseek_EINVAL.c
60 test_yaffs_mkdir_EEXIST.c
61 test_yaffs_mkdir_ENOENT.c
62 test_yaffs_mkdir_ENOTDIR.c
67 test_yaffs_mount2_ENODEV.c
70 test_yaffs_mount_EBUSY.c
71 test_yaffs_mount_ENAMETOOLONG.c
72 test_yaffs_mount_ENODEV.c
75 test_yaffs_open_EEXIST.c
76 test_yaffs_open_EINVAL2.c
77 test_yaffs_open_EINVAL.c
78 test_yaffs_open_EISDIR.c
79 test_yaffs_open_ENAMETOOLONG.c
80 test_yaffs_open_ENOENT.c
81 test_yaffs_open_ENOTDIR.c
84 test_yaffs_read_EBADF.c
85 test_yaffs_read_EINVAL.c
87 test_yaffs_remount_EINVAL.c
88 test_yaffs_remount_ENODEV.c
89 test_yaffs_remount_force_off_read_only_off.c
90 test_yaffs_remount_force_off_read_only_on.c
91 test_yaffs_remount_force_on_read_only_off.c
92 test_yaffs_remount_force_on_read_only_on.c
95 test_yaffs_rename_ENOENT
96 test_yaffs_rename_ENOTDIR
97 test_yaffs_rename_EINVAL
100 test_yaffs_rmdir_EBUSY
101 test_yaffs_rmdir_EINVAL
102 test_yaffs_rmdir_ENOENT
103 test_yaffs_rmdir_ENOTDIR
106 test_yaffs_stat_ENOENT2.c
107 test_yaffs_stat_ENOENT.c
108 test_yaffs_stat_ENOTDIR.c
111 test_yaffs_symlink_EEXIST.c
112 test_yaffs_symlink_ENOENT2.c
113 test_yaffs_symlink_ENOENT.c
114 test_yaffs_symlink_ENOTDIR.c
117 test_yaffs_sync_ENODEV.c
119 test_yaffs_totalspace.c
120 test_yaffs_totalspace_EINVAL.c
122 test_yaffs_truncate.c
123 test_yaffs_truncate_big_file.c
124 test_yaffs_truncate_EINVAL.c
125 test_yaffs_truncate_EISDIR.c
126 test_yaffs_truncate_ENOENT2.c
127 test_yaffs_truncate_ENOENT.c
128 test_yaffs_truncate_ENOTDIR.c
131 test_yaffs_unlink_EISDIR.c
132 test_yaffs_unlink_ENAMETOOLONG.c
133 test_yaffs_unlink_ENOENT2.c
134 test_yaffs_unlink_ENOENT.c
135 test_yaffs_unlink_ENOTDIR.c
137 test_yaffs_unmount2.c
138 test_yaffs_unmount2_EINVAL.c
139 test_yaffs_unmount2_ENODEV.c
140 test_yaffs_unmount2_with_handle_open_and_forced_mode_off.c
141 test_yaffs_unmount2_with_handle_open_and_forced_mode_on.c
144 test_yaffs_unmount_EBUSY.c
145 test_yaffs_unmount_ENAMETOOLONG.c
146 test_yaffs_unmount_ENODEV.c
149 test_yaffs_write_big_file.c
150 test_yaffs_write_EBADF.c
155 test_yaffs_fchmod_EACCES
157 test_yaffs_chmod_EACCES
158 test_yaffs_chmod_ELOOP
159 test_yaffs_chmod_ENAMETOOLONG
162 test_yaffs_lstat_EACCES
163 test_yaffs_lstat_ENOTDIR
164 test_yaffs_lstat_ENAMETOOLONG
165 test_yaffs_lstat_ENOENT
166 test_yaffs_lstat_ELOOP
169 test_yaffs_readlink_ENOENT
170 test_yaffs_readlink_ENOTDIR
171 test_yaffs_readlink_ELOOP
172 test_yaffs_readlink_ENAMETOOLONG
175 test_yaffs_mkdir_EACCES
176 test_yaffs_mkdir_ELOOP
177 test_yaffs_mkdir_ENAMETOOLONG
178 test_yaffs_mkdir_EROFS
181 test_yaffs_symlink_EACCES
182 test_yaffs_symlink_ELOOP
183 test_yaffs_symlink_ENAMETOOLONG
184 test_yaffs_symlink_EROFS
187 //the yaffs_mknod function does not exist in yaffsfs, so these tests will not be added.
189 test_yaffs_mknod_EACCES
190 test_yaffs_mknod_EEXIST
191 test_yaffs_mknod_EINVAL
192 test_yaffs_mknod_ELOOP
193 test_yaffs_mknod_ENAMETOOLONG
194 test_yaffs_mknod_ENOENT
195 test_yaffs_mknod_ENOTDIR
196 test_yaffs_mknod_EROFS
199 test_yaffs_mount2_EINVAL //cannot happen in yaffs since the mode is not checked.
200 test_yaffs_mount2_ENOTDIR //cannot be generated in yaffs.
201 test_yaffs_mount2_ENOENT //cannot be generated in yaffs.
202 test_yaffs_mount2_ENAMETOOLONG
203 test_yaffs_mount2_with read only set
207 test_yaffs_unmount2_ENOENT //cannot be generated in yaffs.
208 test_yaffs_unmount2_ENOTDIR //cannot be generated in yaffs.
209 test_yaffs_unmount2_ENAMETOOLONG
212 test_yaffs_remount_force_off_read_only_on
213 test_yaffs_remount_force_on_read_only_on
214 test_yaffs_remount_ENOENT //cannot be generated in yaffs
215 test_yaffs_remount_ENOTDIR //cannot be generated in yaffs
218 test_yaffs_freespace_ENAMETOOLONG
219 test_yaffs_totalspace_ENAMETOOLONG
220 test_yaffs_inodecount_ENAMETOOLONG
231 test_yaffs_link_EACCES
233 test_yaffs_link_ELOOP
234 test_yaffs_link_EMLINK //should not happen on yaffs
235 test_yaffs_link_ENAMETOOLONG
236 test_yaffs_link_EPERM
237 test_yaffs_link_EROFS
240 test_yaffs_rmdir_EACCES
241 test_yaffs_rmdir_ENOTEMPTY
242 test_yaffs_rmdir_EROFS
245 what happens if a file is renamed into a dir.
246 //need to do rename for directories.
247 //what happens if the dir or file is renamed over an existing dir or file
248 test_yaffs_rename_EACCES
249 test_yaffs_rename_ELOOP
250 test_yaffs_rename_EMLINK
251 test_yaffs_rename_EEXISTS or EPERM
252 test_yaffs_rename_EROFS
259 test_yaffs_flush_EBADF
261 test_yaffs_fchmod_EACCES
262 test_yaffs_fchmod_ELOOP
265 test_yaffs_open_EACCES
266 test_yaffs_open_ENOSPC
267 test_yaffs_open_ELOOP
268 test yaffs_open_running_out_of_handles error
270 test_yaffs_close //This function has already been called by the time this test is reached.
272 test_yaffs_stat_ELOOP
273 test_yaffs_stat_EACCES
274 test_yaffs_stat_ENAMETOOLONG
278 test_yaffs_read_big_file
279 test what happens if you read off the end of the file?
282 test_yaffs_pread_EBADF
283 test_yaffs_pread_EINVAL
284 test_yaffs_pread_big_file
286 test_yaffs_write_big_file
287 test_yaffs_write_EINVAL
288 What happens when you run out of space?
290 test_yaffs_write_EBADF
292 test_yaffs_pwrite_big_file
293 test_yaffs_pwrite_EINVAL
295 test_yaffs_unlink_EACCES
296 test_yaffs_unlink_ELOOP
297 test_yaffs_unlink_ENOMEM
299 test_yaffs_stat_EACCES
300 test_yaffs_stat_ELOOP
302 test_yaffs_access_EACCESS
303 test_yaffs_access_ELOOP
304 test_yaffs_access_ENAMETOOLONG
305 test_yaffs_access_ENOENT_generated_with_a_dangling_symbloic_link
307 test_yaffs_ftruncate_EACCES
310 test_yaffs_truncate_EACCES
311 test_yaffs_truncate_ELOOP
312 test_yaffs_truncate_ENAMETOOLONG
313 Add a truncate function for truncating a file size to -1.
315 What happens if a handle is opened to a file and the file is then deleted?
316 Check to see if yaffs generates an error code for no reason.
317 What happens when a file is opened with no modes set?
318 Add a test where a directory is moved. /fluffy/box. move "fluffy" to "/fluffy/frog".
319 What happens when yaffs is unmounted twice?
321 What happens when open a handle, unmount yaffs and then try to use the handle?
323 What happens when a mount point is mounted using mount2 with read only mode set and then a file is chmoded?
326 First create the test .c and .h file.
327 The file name and test function name should be the same.
328 This name should follow one of these formats:
329 Test_yaffs_[function of yaffs which is been tested]
330 Test_yaffs_[function of yaffs which is been tested]_[error trying to be generated]
332 The .c file needs to contain two functions.
333 The first function needs to contain the code for the main test and will
334 return -1 on a failure and 0 or greater on a success.
335 The second function needs contain the code for cleaning up after the test.
336 Cleaning up may include closing some open handles, recreating a file, ect.
337 This second function needs to return -1 on a failure and 0 or greater on success.
339 The name of first function needs to be called the same as the file
340 name (without the .c or .h)
341 The second function's name needs be the same as the first function but
342 with "_clean" added on the end.
344 So if a test is been created for the yaffs function yaffs_foo() then
347 Contains int test_yaffs_foo(void); int test_yaffs_foo_clean(void);
349 Which includes "lib.h", "yaffsfs.h" header files.
351 Next write the test code in these files then add these files to the Makefile.
353 Add the name of the test files' object file (test_yaffs_foo.o ) to the
354 TESTFILES tag around line 50 of the Makefile.
356 Now add the test functions to the test_list[] array in quick_tests.h
357 The order of the tests matters. The idea is to test each yaffs_function
358 individualy and only using tested yaffs_components before using this new
360 This array consists of:
361 {[test function], [the clean function], [name of the tests which will be printed when the test fails]},
363 So add this line to the test_list[]: {test_yaffs_foo, test_yaffs_foo_clean, "test_yaffs_foo"},
365 Also include the test's .h file in the quick_test.h file: #include "test_yaffs_foo.h"
367 The test file should now make and run(you may need to make clean first).
371 PS: yaffs_foo() is a made up function for this README (in case you want
372 to find this function in yaffs).