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 //when the mode is incorrect.
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
26 test_yaffs_open_EEXIST
27 test_yaffs_open_EISDIR
28 test_yaffs_open_ENAMETOOLONG
29 test_yaffs_open_ENOENT
30 test_yaffs_open_ENOTDIR
31 test_yaffs_open_EINVAL
32 test_yaffs_open_EINVAL2 //the function open has to modes which can be set, so two modes are needed.
38 test_yaffs_truncate_ENOTDIR
39 test_yaffs_truncate_EISDIR
40 test_yaffs_truncate_ENOENT
41 test_yaffs_truncate_ENIVAL
42 test_yaffs_truncate_EFBIG
45 test_yaffs_unlink_EISDIR
46 test_yaffs_unlink_ENAMETOOLONG
47 test_yaffs_unlink_ENOENT
48 test_yaffs_unlink_ENOTDIR
49 test_yaffs_unlink_ENOENT
54 add a test where a directory is moved. /fluffy/box. move "fluffy" to "/fluffy/frog".
57 test_yaffs_mount_EACCES //Cannot be generated with yaffs.
58 test_yaffs_mount_EINVAL //Cannot be generated with yaffs.
59 test_yaffs_mount_ELOOP //Cannot be generated with yaffs.
60 test_yaffs_mount_EMFILE //Cannot be generated with yaffs.
61 test_yaffs_mount_ENOTDIR //Cannot be generated with yaffs.
63 test_yaffs_umount_ENODEV
64 test_yaffs_umount_ENAMETOOLONG
65 test_yaffs_umount_ENOENT
66 test_yaffs_umount_EBUSY
68 test_yaffs_open_EACCES
69 test_yaffs_open_ENOSPC
70 test_yaffs_open_ELOOP //Too many symbolic links were encountered in resolving pathname
71 test yaffs_open_running_out_of_handles error
73 test_yaffs_close //This function has already been called by the time this test is reached.
75 test_yaffs_unlink_EACCES
76 test_yaffs_unlink_ELOOP
77 test_yaffs_unlink_ENOMEM
79 test_yaffs_access_EACCESS
80 test_yaffs_access_ELOOP
81 test_yaffs_access_ENAMETOOLONG
82 test_yaffs_access_ENOENT_generated_with_a_dangling_symbloic_link
84 test_yaffs_ftruncate_EACCES
85 test_yaffs_ftruncate_EFBIG
86 test_yaffs_ftruncate_EISDIR
87 test_yaffs_ftruncate_ELOOP
88 test_yaffs_ftruncate_ENOENT
89 test_yaffs_ftruncate_ENOTDIR
91 test_yaffs_truncate_EACCES
92 test_yaffs_truncate_ELOOP
93 test_yaffs_truncate_ENAMETOOLONG
94 add a truncate function for truncating a file size to -1.
97 check to see if an error code is generated when there isn't an error.
101 First create the test .c and .h file.
102 The file name and test function name should be the same.
103 This name should follow one of these formats:
104 Test_yaffs_[function of yaffs which is been tested]
105 Test_yaffs_[function of yaffs which is been tested]_[error trying to be generated]
107 The .c file needs to contain two functions.
108 The first function needs to contain the code for the main test and will
109 return -1 on a failure and 0 or greater on a success.
110 The second function needs contain the code for cleaning up after the test.
111 Cleaning up may include closing some open handles, recreating a file, ect.
112 This second function needs to return -1 on a failure and 0 or greater on success.
114 The name of first function needs to be called the same as the file
115 name (without the .c or .h)
116 The second function's name needs be the same as the first function but
117 with "_clean" added on the end.
119 So if a test is been created for the yaffs function yaffs_foo() then
122 Contains int test_yaffs_foo(void); int test_yaffs_foo_clean(void);
124 Which includes "lib.h", "yaffsfs.h" header files.
126 Next write the test code in these files then add these files to the Makefile.
128 Add the name of the test files' object file (test_yaffs_foo.o ) to the
129 TESTFILES tag around line 50 of the Makefile.
131 Now add the test functions to the test_list[] array in quick_tests.h
132 The order of the tests matters. The idea is to test each yaffs_function
133 individualy and only using tested yaffs_components before using this new
135 This array consists of:
136 {[test function], [the clean function], [name of the tests which will be printed when the test fails]},
138 So add this line to the test_list[]: {test_yaffs_foo, test_yaffs_foo_clean, "test_yaffs_foo"},
140 Also include the test's .h file in the quick_test.h file: #include "test_yaffs_foo.h"
142 The test file should now make and run(you may need to make clean first).
146 PS: yaffs_foo() is a made up function for this README (in case you want
147 to find this function in yaffs).