2 Made by Timothy Manning <timothy@yaffs.net> on 04/11/2010
7 test_yaffs_chmod_ENOENT
8 test_yaffs_chmod_ENOTDIR
11 test_yaffs_fchmod_EBADF
14 test_yaffs_mount_ENODEV
15 test_yaffs_mount_ENAMETOOLONG
16 test_yaffs_mount_EBUSY //caused by trying to mount a new mount point with a mount point already mounted.
19 test_yaffs_access_ENIVAL
20 test_yaffs_access_ENOTDIR
21 test_yaffs_access_ENOENT
23 test_yaffs_close_EBADF
26 test_yaffs_fdatasync_EBADF
29 test_yaffs_fsync_EBADF
32 test_yaffs_ftruncate_EBADF
33 test_yaffs_ftruncate_ENIVAL
34 test_yaffs_ftruncate_EFBIG
37 test_yaffs_lseek_EBADF
38 test_yaffs_lseek_EINVAL
39 test_yaffs_lseek_EFBIG
42 test_yaffs_open_EEXIST
43 test_yaffs_open_EISDIR
44 test_yaffs_open_ENAMETOOLONG
45 test_yaffs_open_ENOENT
46 test_yaffs_open_ENOTDIR
47 test_yaffs_open_EINVAL
48 test_yaffs_open_EINVAL2 //the function open has two modes which can be set, so two tests are needed.
52 test_yaffs_read_EINVAL
56 test_yaffs_stat_ENOENT
57 test_yaffs_stat_ENOTDIR
60 test_yaffs_fstat_EBADF
63 test_yaffs_truncate_ENOTDIR
64 test_yaffs_truncate_EISDIR
65 test_yaffs_truncate_ENOENT
66 test_yaffs_truncate_ENIVAL
67 test_yaffs_truncate_EFBIG
70 test_yaffs_unlink_EISDIR
71 test_yaffs_unlink_ENAMETOOLONG
72 test_yaffs_unlink_ENOENT
73 test_yaffs_unlink_ENOTDIR
76 test_yaffs_unmount_ENODEV
77 test_yaffs_unmount_ENAMETOOLONG
78 test_yaffs_umount_EBUSY //cause by having a file handle open and then trying to unmount yaffs.
81 test_yaffs_write_EBADF
86 test_yaffs_fchmod_EACCES
87 test_yaffs_fchmod_EINVAL
90 test_yaffs_chmod_EACCES
91 test_yaffs_chmod_ELOOP
92 test_yaffs_chmod_ENAMETOOLONG
95 test_yaffs_lstat_EACCES
96 test_yaffs_lstat_ENOTDIR
97 test_yaffs_lstat_ENAMETOOLONG
98 test_yaffs_lstat_ENOENT
99 test_yaffs_lstat_ELOOP
102 test_yaffs_readlink_ENOENT
103 test_yaffs_readlink_ENOTDIR
104 test_yaffs_readlink_ELOOP
105 test_yaffs_readlink_ENAMETOOLONG
108 test_yaffs_mkdir_EACCES
109 test_yaffs_mkdir_EEXISTS
110 test_yaffs_mkdir_ELOOP
111 test_yaffs_mkdir_ENAMETOOLONG
112 test_yaffs_mkdir_ENOENT
113 test_yaffs_mkdir_ENOTDIR
114 test_yaffs_mkdir_EROFS
117 test_yaffs_symlink_EACCES
118 test_yaffs_symlink_EEXISTS
119 test_yaffs_symlink_ELOOP
120 test_yaffs_symlink_ENAMETOOLONG
121 test_yaffs_symlink_ENOENT
122 test_yaffs_symlink_ENOTDIR
123 test_yaffs_symlink_EROFS
126 test_yaffs_mknod_EACCES
127 test_yaffs_mknod_EEXIST
128 test_yaffs_mknod_EINVAL
129 test_yaffs_mknod_ELOOP
130 test_yaffs_mknod_ENAMETOOLONG
131 test_yaffs_mknod_ENOENT
132 test_yaffs_mknod_ENOTDIR
133 test_yaffs_mknod_EROFS
136 test_yaffs_mount2_EINVAL
137 test_yaffs_mount2_ENOTDIR
138 test_yaffs_mount2_ENOENT
139 test_yaffs_mount2_ENODEV
140 test_yaffs_mount2_ENAMETOOLONG
143 test_yaffs_unmount2_ENOENT
144 test_yaffs_unmount2_ENOTDIR
145 test_yaffs_unmount2_ENODEV
146 test_yaffs_unmount2_EINVAL
149 test_yaffs_remount2_ENOENT
150 test_yaffs_remount2_ENOTDIR
151 test_yaffs_remount2_ENODEV
152 test_yaffs_remount2_EINVAL
155 test_yaffs_sync_ENOENT
156 test_yaffs_sync_ENOTDIR
159 test_yaffs_freespace_ENOENT
160 test_yaffs_freespace_ENOTDIR
162 test_yaffs_totalspace
163 test_yaffs_totalspace_ENOTDIR
164 test_yaffs_totalspace_ENOENT
166 test_yaffs_inodecount
167 test_yaffs_inodecount_ENOTDIR
168 test_yaffs_inodecount_ENOENT
179 test_yaffs_link_EACCES
180 test_yaffs_link_EEXISTS
181 test_yaffs_link_ELOOP
182 test_yaffs_link_EMLINK //should not happen on yaffs
183 test_yaffs_link_ENAMETOOLONG
184 test_yaffs_link_ENOENT
185 test_yaffs_link_ENOTDIR
186 test_yaffs_link_EPERM
187 test_yaffs_link_EROFS
190 test_yaffs_rmdir_EACCES
191 test_yaffs_rmdir_EBUSY
192 test_yaffs_rmdir_ENVAL
193 test_yaffs_rmdir_ENOENT
194 test_yaffs_rmdir_ENOTDIR
195 test_yaffs_rmdir_ENOTEMPTY
196 test_yaffs_rmdir_EROFS
199 test_yaffs_rename_EACCES
200 test_yaffs_rename_EINVAL
201 test_yaffs_rename_ELOOP
202 test_yaffs_rename_EMLINK
203 test_yaffs_rename_ENOENT
204 test_yaffs_rename_ENOTDIR
205 test_yaffs_rename_EEXISTS or EPERM
206 test_yaffs_rename_EROFS
214 test_yaffs_flush_EBADF
216 test_yaffs_fchmod_EACCES
217 test_yaffs_fchmod_ELOOP
220 test_yaffs_open_EACCES
221 test_yaffs_open_ENOSPC
222 test_yaffs_open_ELOOP
223 test yaffs_open_running_out_of_handles error
225 test_yaffs_close //This function has already been called by the time this test is reached.
227 test_yaffs_stat_EBADF
228 test_yaffs_stat_ELOOP
229 test_yaffs_stat_EACCES
230 test_yaffs_stat_ENAMETOOLONG
231 test_yaffs_stat_ENOTDIR
234 test_yaffs_read_EFBIG
235 test what happens if you read off the end of the file?
238 test_yaffs_pread_EBADF
239 test_yaffs_pread_EINVAL
240 test_yaffs_pread_EFBIG
242 test_yaffs_write_EFBIG
243 test_yaffs_write_EINVAL
244 What happens when you run out of space?
246 test_yaffs_write_EBADF
248 test_yaffs_pwrite_EFBIG
249 test_yaffs_pwrite_EINVAL
251 test_yaffs_unlink_EACCES
252 test_yaffs_unlink_ELOOP
253 test_yaffs_unlink_ENOMEM
255 test_yaffs_stat_EACCES
256 test_yaffs_stat_ELOOP
258 test_yaffs_access_EACCESS
259 test_yaffs_access_ELOOP
260 test_yaffs_access_ENAMETOOLONG
261 test_yaffs_access_ENOENT_generated_with_a_dangling_symbloic_link
263 test_yaffs_ftruncate_EACCES
266 test_yaffs_truncate_EACCES
267 test_yaffs_truncate_ELOOP
268 test_yaffs_truncate_ENAMETOOLONG
269 Add a truncate function for truncating a file size to -1.
271 What happens if a handle is opened to a file and the file is then deleted?
272 Check to see if yaffs generates an error code for no reason.
273 What happens when a file is opened with no modes set?
274 Add a test where a directory is moved. /fluffy/box. move "fluffy" to "/fluffy/frog".
275 What happens when yaffs is unmounted twice?
277 What happens when open a handle, unmount yaffs and then try to use the handle?
279 What happens when a mount point is mounted using mount2 with read only mode set and then a file is chmoded?
282 First create the test .c and .h file.
283 The file name and test function name should be the same.
284 This name should follow one of these formats:
285 Test_yaffs_[function of yaffs which is been tested]
286 Test_yaffs_[function of yaffs which is been tested]_[error trying to be generated]
288 The .c file needs to contain two functions.
289 The first function needs to contain the code for the main test and will
290 return -1 on a failure and 0 or greater on a success.
291 The second function needs contain the code for cleaning up after the test.
292 Cleaning up may include closing some open handles, recreating a file, ect.
293 This second function needs to return -1 on a failure and 0 or greater on success.
295 The name of first function needs to be called the same as the file
296 name (without the .c or .h)
297 The second function's name needs be the same as the first function but
298 with "_clean" added on the end.
300 So if a test is been created for the yaffs function yaffs_foo() then
303 Contains int test_yaffs_foo(void); int test_yaffs_foo_clean(void);
305 Which includes "lib.h", "yaffsfs.h" header files.
307 Next write the test code in these files then add these files to the Makefile.
309 Add the name of the test files' object file (test_yaffs_foo.o ) to the
310 TESTFILES tag around line 50 of the Makefile.
312 Now add the test functions to the test_list[] array in quick_tests.h
313 The order of the tests matters. The idea is to test each yaffs_function
314 individualy and only using tested yaffs_components before using this new
316 This array consists of:
317 {[test function], [the clean function], [name of the tests which will be printed when the test fails]},
319 So add this line to the test_list[]: {test_yaffs_foo, test_yaffs_foo_clean, "test_yaffs_foo"},
321 Also include the test's .h file in the quick_test.h file: #include "test_yaffs_foo.h"
323 The test file should now make and run(you may need to make clean first).
327 PS: yaffs_foo() is a made up function for this README (in case you want
328 to find this function in yaffs).