2 Made by Timothy Manning <timothy@yaffs.net> on 04/11/2010
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.
13 test_yaffs_access_ENIVAL
14 test_yaffs_access_ENOTDIR
15 test_yaffs_access_ENOENT
17 test_yaffs_close_EBADF
20 test_yaffs_ftruncate_EBADF
21 test_yaffs_ftruncate_ENIVAL
22 test_yaffs_ftruncate_EFBIG
25 test_yaffs_lseek_EBADF
26 test_yaffs_lseek_EINVAL
27 test_yaffs_lseek_EFBIG
30 test_yaffs_open_EEXIST
31 test_yaffs_open_EISDIR
32 test_yaffs_open_ENAMETOOLONG
33 test_yaffs_open_ENOENT
34 test_yaffs_open_ENOTDIR
35 test_yaffs_open_EINVAL
36 test_yaffs_open_EINVAL2 //the function open has two modes which can be set, so two tests modes are needed.
40 test_yaffs_read_EINVAL
44 test_yaffs_stat_ENOENT
45 test_yaffs_stat_ENOTDIR
48 test_yaffs_fstat_EBADF
51 test_yaffs_truncate_ENOTDIR
52 test_yaffs_truncate_EISDIR
53 test_yaffs_truncate_ENOENT
54 test_yaffs_truncate_ENIVAL
55 test_yaffs_truncate_EFBIG
58 test_yaffs_unlink_EISDIR
59 test_yaffs_unlink_ENAMETOOLONG
60 test_yaffs_unlink_ENOENT
61 test_yaffs_unlink_ENOTDIR
62 test_yaffs_unlink_ENOENT
65 test_yaffs_unmount_ENOENT
66 test_yaffs_unmount_ENAMETOOLONG
67 test_yaffs_umount_EBUSY //cause by having a file handle open and then trying to unmount yaffs.
70 test_yaffs_write_EBADF
75 test_yaffs_mount_EACCES //Cannot be generated with yaffs.
76 test_yaffs_mount_EINVAL //Cannot be generated with yaffs.
77 test_yaffs_mount_ELOOP //Cannot be generated with yaffs.
78 test_yaffs_mount_EMFILE //Cannot be generated with yaffs.
79 test_yaffs_mount_ENOTDIR //Cannot be generated with yaffs.
81 test_yaffs_umount_ENODEV //Cannot be generated with yaffs.
82 test_yaffs_umount_ENOENT //Cannot be generated with yaffs.
85 test_yaffs_open_EACCES
86 test_yaffs_open_ENOSPC
87 test_yaffs_open_ELOOP //Too many symbolic links were encountered in resolving pathname
88 test yaffs_open_running_out_of_handles error
90 test_yaffs_close //This function has already been called by the time this test is reached.
94 test_yaffs_stat_EACCES
95 test_yaffs_stat_ENAMETOOLONG
96 test_yaffs_stat_ENOTDIR
98 test_yaffs_read_EISDIR //Cannot be generated with yaffs.
100 test what happens if you read off the end of the file?
102 test_yaffs_write_EFBIG
103 test_yaffs_write_EINVAL
104 What happens when you run out of space?
106 test_yaffs_unlink_EACCES
107 test_yaffs_unlink_ELOOP
108 test_yaffs_unlink_ENOMEM
110 test_yaffs_stat_EACCES
111 test_yaffs_stat_ELOOP
113 test_yaffs_access_EACCESS
114 test_yaffs_access_ELOOP
115 test_yaffs_access_ENAMETOOLONG
116 test_yaffs_access_ENOENT_generated_with_a_dangling_symbloic_link
118 test_yaffs_ftruncate_EACCES
119 test_yaffs_ftruncate_EISDIR //Cannot be generated with yaffs.
120 test_yaffs_ftruncate_ELOOP //Cannot be generated with yaffs.
121 test_yaffs_ftruncate_ENOENT //Cannot be generated with yaffs.
122 test_yaffs_ftruncate_ENOTDIR //Cannot be generated with yaffs.
124 test_yaffs_truncate_EACCES
125 test_yaffs_truncate_ELOOP
126 test_yaffs_truncate_ENAMETOOLONG
127 Add a truncate function for truncating a file size to -1.
129 What happens if a handle is opened to a file and the file is then deleted?
130 Check to see if yaffs generates an error code for no reason.
131 What happens when a file is opened with no modes set?
132 Add a test where a directory is moved. /fluffy/box. move "fluffy" to "/fluffy/frog".
133 What happens when yaffs is unmounted twice?
135 What happens when open a handle, unmount yaffs and then try to use the handle?
138 First create the test .c and .h file.
139 The file name and test function name should be the same.
140 This name should follow one of these formats:
141 Test_yaffs_[function of yaffs which is been tested]
142 Test_yaffs_[function of yaffs which is been tested]_[error trying to be generated]
144 The .c file needs to contain two functions.
145 The first function needs to contain the code for the main test and will
146 return -1 on a failure and 0 or greater on a success.
147 The second function needs contain the code for cleaning up after the test.
148 Cleaning up may include closing some open handles, recreating a file, ect.
149 This second function needs to return -1 on a failure and 0 or greater on success.
151 The name of first function needs to be called the same as the file
152 name (without the .c or .h)
153 The second function's name needs be the same as the first function but
154 with "_clean" added on the end.
156 So if a test is been created for the yaffs function yaffs_foo() then
159 Contains int test_yaffs_foo(void); int test_yaffs_foo_clean(void);
161 Which includes "lib.h", "yaffsfs.h" header files.
163 Next write the test code in these files then add these files to the Makefile.
165 Add the name of the test files' object file (test_yaffs_foo.o ) to the
166 TESTFILES tag around line 50 of the Makefile.
168 Now add the test functions to the test_list[] array in quick_tests.h
169 The order of the tests matters. The idea is to test each yaffs_function
170 individualy and only using tested yaffs_components before using this new
172 This array consists of:
173 {[test function], [the clean function], [name of the tests which will be printed when the test fails]},
175 So add this line to the test_list[]: {test_yaffs_foo, test_yaffs_foo_clean, "test_yaffs_foo"},
177 Also include the test's .h file in the quick_test.h file: #include "test_yaffs_foo.h"
179 The test file should now make and run(you may need to make clean first).
183 PS: yaffs_foo() is a made up function for this README (in case you want
184 to find this function in yaffs).