324d3c4139a99574861bea1e6418fd2e8c378689
[yaffs2.git] / direct / test-framework / timothy_tests / quick_tests / quick_tests.h
1 /*
2  * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
3  *
4  * Copyright (C) 2002-2011 Aleph One Ltd.
5  *   for Toby Churchill Ltd and Brightstar Engineering
6  *
7  * Created by Timothy Manning <timothy@yaffs.net>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU Lesser General Public License version 2.1 as
11  * published by the Free Software Foundation.
12  *
13  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
14  */
15
16 #ifndef __quick_tests_h__
17 #define __quick_tests_h__
18 #include <stdio.h>
19 #include <getopt.h>
20
21 #include "test_yaffs_mount.h"
22 #include "test_yaffs_mount_ENODEV.h"
23 #include "test_yaffs_mount_ENAMETOOLONG.h"
24 #include "test_yaffs_mount_EBUSY.h"
25 #include "test_yaffs_mount_NULL.h"
26
27 #include "test_yaffs_unmount.h"
28 #include "test_yaffs_unmount_ENODEV.h"
29 #include "test_yaffs_unmount_ENAMETOOLONG.h"
30 #include "test_yaffs_unmount_EBUSY.h"
31
32 #include "test_yaffs_open.h"
33 #include "test_yaffs_open_EISDIR.h"
34 #include "test_yaffs_open_EEXIST.h"
35 #include "test_yaffs_open_ENOENT.h"
36 #include "test_yaffs_open_ENOTDIR.h"
37 #include "test_yaffs_open_ENAMETOOLONG.h"
38 #include "test_yaffs_open_EINVAL.h"
39 #include "test_yaffs_open_EINVAL2.h"
40 #include "test_yaffs_open_ELOOP.h"
41 #include "test_yaffs_open_ELOOP_dir.h"
42 #include "test_yaffs_open_EROFS.h"
43 #include "test_yaffs_open_EACCES.h"
44 #include "test_yaffs_open_NULL.h"
45
46 #include "test_yaffs_close_EBADF.h"
47 #include "test_yaffs_close_NULL.h"
48
49 #include "test_yaffs_unlink.h"
50 #include "test_yaffs_unlink_EISDIR.h"
51 #include "test_yaffs_unlink_ENOENT.h"
52 #include "test_yaffs_unlink_ENAMETOOLONG.h"
53 #include "test_yaffs_unlink_ENOTDIR.h"
54 #include "test_yaffs_unlink_ENOENT.h"
55 #include "test_yaffs_unlink_ENOENT2.h"
56 #include "test_yaffs_unlink_ELOOP_dir.h"
57 #include "test_yaffs_unlink_EROFS.h"
58 #include "test_yaffs_unlink_NULL.h"
59
60 #include "test_yaffs_ftruncate.h"
61 #include "test_yaffs_ftruncate_EBADF.h"
62 #include "test_yaffs_ftruncate_EINVAL.h"
63 #include "test_yaffs_ftruncate_big_file.h"
64 #include "test_yaffs_ftruncate_EROFS.h"
65
66
67 #include "test_yaffs_truncate.h"
68 #include "test_yaffs_truncate_ENOTDIR.h"
69 #include "test_yaffs_truncate_EISDIR.h"
70 #include "test_yaffs_truncate_ENOENT.h"
71 #include "test_yaffs_truncate_EINVAL.h"
72 #include "test_yaffs_truncate_big_file.h"
73 #include "test_yaffs_truncate_ENOENT2.h"
74 #include "test_yaffs_truncate_ELOOP.h"
75 #include "test_yaffs_truncate_ELOOP_dir.h"
76 #include "test_yaffs_truncate_EROFS.h"
77 #include "test_yaffs_truncate_ENAMETOOLONG.h"
78 #include "test_yaffs_truncate_NULL.h"
79
80 #include "test_yaffs_write.h"
81 #include "test_yaffs_write_EBADF.h"
82 #include "test_yaffs_write_big_file.h"
83 #include "test_yaffs_write_EROFS.h"
84
85 #include "test_yaffs_read.h"
86 #include "test_yaffs_read_EBADF.h"
87 //#include "test_yaffs_read_EINVAL.h"
88
89 #include "test_yaffs_lseek.h"
90 #include "test_yaffs_lseek_EBADF.h"
91 #include "test_yaffs_lseek_EINVAL.h"
92 #include "test_yaffs_lseek_big_file.h"
93
94 #include "test_yaffs_access.h"
95 #include "test_yaffs_access_EINVAL.h"
96 #include "test_yaffs_access_ENOTDIR.h"
97 #include "test_yaffs_access_ENOENT.h"
98 #include "test_yaffs_access_ENOENT2.h"
99 #include "test_yaffs_access_ELOOP_dir.h"
100 #include "test_yaffs_access_ELOOP.h"
101 #include "test_yaffs_access_EROFS.h"
102 #include "test_yaffs_access_EACCES.h"
103 #include "test_yaffs_access_ENAMETOOLONG.h"
104 #include "test_yaffs_access_NULL.h"
105
106 #include "test_yaffs_stat.h"
107 #include "test_yaffs_stat_ENOENT.h"
108 #include "test_yaffs_stat_ENOTDIR.h"
109 #include "test_yaffs_stat_ENOENT2.h"
110 #include "test_yaffs_stat_ELOOP.h"
111 #include "test_yaffs_stat_ELOOP_dir.h"
112 #include "test_yaffs_stat_ENAMETOOLONG.h"
113 #include "test_yaffs_stat_NULL.h"
114
115 #include "test_yaffs_fstat.h"
116 #include "test_yaffs_fstat_EBADF.h"
117
118
119 #include "test_yaffs_chmod.h"
120 #include "test_yaffs_chmod_ENOENT.h"
121 #include "test_yaffs_chmod_ENOTDIR.h"
122 #include "test_yaffs_chmod_EINVAL.h"
123 #include "test_yaffs_chmod_ENOENT2.h"
124 #include "test_yaffs_chmod_ELOOP_dir.h"
125 #include "test_yaffs_chmod_ELOOP.h"
126 #include "test_yaffs_chmod_EROFS.h"
127 #include "test_yaffs_chmod_ENAMETOOLONG.h"
128 #include "test_yaffs_chmod_NULL.h"
129
130 #include "test_yaffs_fchmod.h"
131 #include "test_yaffs_fchmod_EBADF.h"
132 #include "test_yaffs_fchmod_EINVAL.h"
133 #include "test_yaffs_fchmod_EROFS.h"
134 #include "test_yaffs_fchmod_NULL.h"
135
136 #include "test_yaffs_fsync.h"
137 #include "test_yaffs_fsync_EBADF.h"
138 #include "test_yaffs_fsync_EROFS.h"
139
140 #include "test_yaffs_fdatasync.h"
141 #include "test_yaffs_fdatasync_EBADF.h"
142 #include "test_yaffs_fdatasync_EROFS.h"
143 #include "test_yaffs_fdatasync_NULL.h"
144
145 #include "test_yaffs_mkdir.h"
146 #include "test_yaffs_mkdir_EEXIST.h"
147 #include "test_yaffs_mkdir_ENOTDIR.h"
148 #include "test_yaffs_mkdir_ENOENT.h"
149 #include "test_yaffs_mkdir_ELOOP_dir.h"
150 #include "test_yaffs_mkdir_EROFS.h"
151 #include "test_yaffs_mkdir_ENAMETOOLONG.h"
152 #include "test_yaffs_mkdir_NULL.h"
153
154 #include "test_yaffs_symlink.h"
155 #include "test_yaffs_symlink_ENOTDIR.h"
156 #include "test_yaffs_symlink_EEXIST.h"
157 #include "test_yaffs_symlink_ENOENT.h"
158 #include "test_yaffs_symlink_ENOENT2.h"
159 #include "test_yaffs_symlink_ELOOP_dir.h"
160 #include "test_yaffs_symlink_EROFS.h"
161 #include "test_yaffs_symlink_ENAMETOOLONG.h"
162 #include "test_yaffs_symlink_NULL.h"
163 #include "test_yaffs_symlink_NULL2.h"
164
165 #include "test_yaffs_mount2.h"
166 #include "test_yaffs_mount2_ENODEV.h"
167
168 #include "test_yaffs_unmount2.h"
169 #include "test_yaffs_unmount2_ENODEV.h"
170 #include "test_yaffs_unmount2_EINVAL.h"
171 #include "test_yaffs_unmount2_with_handle_open_and_forced_mode_on.h"
172 #include "test_yaffs_unmount2_with_handle_open_and_forced_mode_off.h"
173 #include "test_yaffs_unmount_NULL.h"
174
175 #include "test_yaffs_sync.h"
176 #include "test_yaffs_sync_ENODEV.h"
177 #include "test_yaffs_sync_EROFS.h"
178 #include "test_yaffs_sync_ENAMETOOLONG.h"
179 #include "test_yaffs_sync_NULL.h"
180
181 #include "test_yaffs_remount_force_off_read_only_off.h"
182 #include "test_yaffs_remount_force_on_read_only_off.h"
183 #include "test_yaffs_remount_ENODEV.h"
184 #include "test_yaffs_remount_EINVAL.h"
185 #include "test_yaffs_remount_ENAMETOOLONG.h"
186 #include "test_yaffs_remount_NULL.h"
187
188 #include "test_yaffs_freespace.h"
189 #include "test_yaffs_freespace_EINVAL.h"
190 #include "test_yaffs_freespace_ENAMETOOLONG.h"
191 #include "test_yaffs_freespace_NULL.h"
192
193 #include "test_yaffs_totalspace.h"
194 #include "test_yaffs_totalspace_EINVAL.h"
195 #include "test_yaffs_totalspace_ENAMETOOLONG.h"
196 #include "test_yaffs_totalspace_NULL.h"
197
198 #include "test_yaffs_inodecount.h"
199 #include "test_yaffs_inodecount_EINVAL.h"
200 #include "test_yaffs_inodecount_ENAMETOOLONG.h"
201 #include "test_yaffs_inodecount_NULL.h"
202
203 #include "test_yaffs_link.h"
204 #include "test_yaffs_link_ENOENT.h"
205 #include "test_yaffs_link_EEXIST.h"
206 #include "test_yaffs_link_ENOTDIR.h"
207 #include "test_yaffs_link_ENOTDIR2.h"
208 #include "test_yaffs_link_ENOENT2.h"
209 #include "test_yaffs_link_ENOENT3.h"
210 #include "test_yaffs_link_ENOENT4.h"
211 #include "test_yaffs_link_ELOOP_dir.h"
212 #include "test_yaffs_link_EROFS.h"
213 #include "test_yaffs_link_ENAMETOOLONG.h"
214 #include "test_yaffs_link_ENAMETOOLONG2.h"
215 #include "test_yaffs_link_NULL.h"
216 #include "test_yaffs_link_NULL2.h"
217
218 #include "test_yaffs_rmdir.h"
219 #include "test_yaffs_rmdir_EBUSY.h"
220 #include "test_yaffs_rmdir_EINVAL.h"
221 #include "test_yaffs_rmdir_ENOENT.h"
222 #include "test_yaffs_rmdir_ENOTDIR.h"
223 #include "test_yaffs_rmdir_ELOOP_dir.h"
224 #include "test_yaffs_rmdir_EROFS.h"
225 #include "test_yaffs_rmdir_ENAMETOOLONG.h"
226 #include "test_yaffs_rmdir_ENOTEMPTY.h"
227
228 #include "test_yaffs_rename.h"
229 #include "test_yaffs_rename_ENOENT.h"
230 #include "test_yaffs_rename_ENOTDIR.h"
231 #include "test_yaffs_rename_EINVAL.h"
232 #include "test_yaffs_rename_dir.h"
233 #include "test_yaffs_rename_dir_ENOENT.h"
234 #include "test_yaffs_rename_dir_ENOENT2.h"
235 #include "test_yaffs_rename_dir_to_file.h"
236 #include "test_yaffs_rename_file_to_dir.h"
237 #include "test_yaffs_rename_EEXISTS.h"
238 #include "test_yaffs_rename_ELOOP_dir.h"
239 #include "test_yaffs_rename_EROFS.h"
240 #include "test_yaffs_rename_ENAMETOOLONG.h"
241 #include "test_yaffs_rename_ENAMETOOLONG2.h"
242 #include "test_yaffs_rename_NULL.h"
243 #include "test_yaffs_rename_NULL2.h"
244 #include "test_yaffs_rename_file_over_file.h"
245 #include "test_yaffs_rename_dir_over_dir.h"
246 #include "test_yaffs_rename_to_null_file.h"
247 #include "test_yaffs_rename_full_dir_over_dir.h"
248 #include "test_yaffs_rename_ENOTEMPTY.h"
249
250 #include "test_yaffs_lstat.h"
251 #include "test_yaffs_lstat_ENOENT.h"
252 #include "test_yaffs_lstat_ENOTDIR.h"
253 #include "test_yaffs_lstat_ENAMETOOLONG.h"
254 #include "test_yaffs_lstat_NULL.h"
255
256 #include "test_yaffs_flush.h"
257 #include "test_yaffs_flush_EBADF.h"
258 #include "test_yaffs_flush_EROFS.h"
259
260 #include "test_yaffs_dup.h"
261 #include "test_yaffs_dup_EBADF.h"
262
263 #include "yaffsfs.h"
264 #include "lib.h"
265
266
267
268
269 typedef struct test {
270         int (*p_function)(void);        /*pointer to test function*/
271         int (*p_function_clean)(void);
272         /*char pass_message[50]; will not need a pass message*/
273         char *name_of_test;     /*pointer to fail message, needs to include name of test*/
274 }test_template;
275
276
277 test_template test_list[]={
278         {test_yaffs_mount,test_yaffs_mount_clean,"test_yaffs_mount"},
279         {test_yaffs_mount_ENODEV,test_yaffs_mount_ENODEV_clean,"test_yaffs_mount_ENODEV"},
280         {test_yaffs_mount_ENAMETOOLONG,test_yaffs_mount_ENAMETOOLONG_clean,"test_yaffs_mount_ENAMETOOLONG"},
281         {test_yaffs_mount_EBUSY,test_yaffs_mount_EBUSY_clean,"test_yaffs_mount_EBUSY"},
282         {test_yaffs_mount_NULL,test_yaffs_mount_NULL_clean,"test_yaffs_mount_NULL"},
283
284         {test_yaffs_unmount,test_yaffs_unmount_clean,"test_yaffs_unmount"},
285         {test_yaffs_unmount_ENODEV,test_yaffs_unmount_ENODEV_clean,"test_yaffs_unmount_ENODEV"},
286         {test_yaffs_unmount_ENAMETOOLONG,test_yaffs_unmount_ENAMETOOLONG_clean,"test_yaffs_unmount_ENAMETOOLONG"},
287         {test_yaffs_unmount_EBUSY,test_yaffs_unmount_EBUSY_clean,"test_yaffs_unmount_EBUSY"},
288
289         {test_yaffs_open,test_yaffs_open_clean,"test_yaffs_open"},
290         {test_yaffs_open_EISDIR,test_yaffs_open_EISDIR_clean,"test_yaffs_open_EISDIR"},
291         {test_yaffs_open_EEXIST,test_yaffs_open_EEXIST_clean,"test_yaffs_open_EEXIST"},
292         {test_yaffs_open_ENOTDIR,test_yaffs_open_ENOTDIR_clean,"test_yaffs_open_ENOTDIR"},
293         {test_yaffs_open_ENOENT,test_yaffs_open_ENOENT_clean,"test_yaffs_open_ENOENT"},
294         {test_yaffs_open_ENAMETOOLONG,test_yaffs_open_ENAMETOOLONG_clean,"test_yaffs_open_ENAMETOOLONG"},
295         {test_yaffs_open_EINVAL,test_yaffs_open_EINVAL_clean,"test_yaffs_open_EINVAL"},
296         {test_yaffs_open_EINVAL2,test_yaffs_open_EINVAL2_clean,"test_yaffs_open_EINVAL2"},
297         {test_yaffs_open_ELOOP,test_yaffs_open_ELOOP_clean,"test_yaffs_open_ELOOP"},
298         {test_yaffs_open_ELOOP_dir,test_yaffs_open_ELOOP_dir_clean,"test_yaffs_open_ELOOP_dir"},
299         {test_yaffs_open_EROFS,test_yaffs_open_EROFS_clean,"test_yaffs_open_EROFS"},
300         {test_yaffs_open_EACCES,test_yaffs_open_EACCES_clean,"test_yaffs_open_EACCES"},
301         {test_yaffs_open_NULL,test_yaffs_open_NULL_clean,"test_yaffs_open_NULL"},
302
303
304         {test_yaffs_close_EBADF,test_yaffs_close_EBADF_clean,"test_yaffs_close_EBADF"},
305         {test_yaffs_close_NULL,test_yaffs_close_NULL_clean,"test_yaffs_close_NULL"},
306
307         {test_yaffs_access,test_yaffs_access_clean,"test_yaffs_access"},
308         {test_yaffs_access_EINVAL,test_yaffs_access_EINVAL_clean,"test_yaffs_access_EINVAL"},
309         {test_yaffs_access_ENOTDIR,test_yaffs_access_ENOTDIR_clean,"test_yaffs_access_ENOTDIR"},
310         {test_yaffs_access_ENOENT,test_yaffs_access_ENOENT_clean,"test_yaffs_access_ENOENT"},
311         {test_yaffs_access_ENOENT2,test_yaffs_access_ENOENT2_clean,"test_yaffs_access_ENOENT2"},
312         {test_yaffs_access_ELOOP_dir,test_yaffs_access_ELOOP_dir_clean,"test_yaffs_access_ELOOP_dir"},
313         {test_yaffs_access_ELOOP,test_yaffs_access_ELOOP_clean,"test_yaffs_access_ELOOP"},
314         {test_yaffs_access_EROFS,test_yaffs_access_EROFS_clean,"test_yaffs_access_EROFS"},
315         {test_yaffs_access_EACCES,test_yaffs_access_EACCES_clean,"test_yaffs_access_EACCES"},
316         {test_yaffs_access_ENAMETOOLONG,test_yaffs_access_ENAMETOOLONG_clean,"test_yaffs_access_ENAMETOOLONG"},
317         {test_yaffs_access_NULL,test_yaffs_access_NULL_clean,"test_yaffs_access_NULL"},
318
319         {test_yaffs_unlink, test_yaffs_unlink_clean,"test_yaffs_unlink"},
320         {test_yaffs_unlink_EISDIR,test_yaffs_unlink_EISDIR_clean,"test_yaffs_unlink_EISDIR"},
321         {test_yaffs_unlink_ENOENT,test_yaffs_unlink_ENOENT_clean,"test_yaffs_unlink_ENOENT"},
322         {test_yaffs_unlink_ENAMETOOLONG,test_yaffs_unlink_ENAMETOOLONG_clean,"test_yaffs_unlink_ENAMETOOLONG"},
323         {test_yaffs_unlink_ENOTDIR,test_yaffs_unlink_ENOTDIR_clean,"test_yaffs_unlink_ENOTDIR"},
324         {test_yaffs_unlink_ENOENT,test_yaffs_unlink_ENOENT_clean,"test_yaffs_unlink_ENOENT"},
325         {test_yaffs_unlink_ENOENT2,test_yaffs_unlink_ENOENT2_clean,"test_yaffs_unlink_ENOENT2"},
326         {test_yaffs_unlink_ELOOP_dir,test_yaffs_unlink_ELOOP_dir_clean,"test_yaffs_unlink_ELOOP_dir"},
327         {test_yaffs_unlink_EROFS,test_yaffs_unlink_EROFS_clean,"test_yaffs_unlink_EROFS"},
328         {test_yaffs_unlink_NULL,test_yaffs_unlink_NULL_clean,"test_yaffs_unlink_NULL"},
329
330         {test_yaffs_lseek,test_yaffs_lseek_clean,"test_yaffs_lseek"},
331         {test_yaffs_lseek_EBADF,test_yaffs_lseek_EBADF_clean,"test_yaffs_lseek_EBADF"},
332         {test_yaffs_lseek_EINVAL,test_yaffs_lseek_EINVAL_clean,"test_yaffs_lseek_EINVAL"},
333 //      {test_yaffs_lseek_big_file,test_yaffs_lseek_big_file_clean,"test_yaffs_lseek_big_file"}, //this test does not work because the large number becomes 0 when the file is compiled.
334
335         {test_yaffs_write,test_yaffs_write_clean,"test_yaffs_write"},
336         {test_yaffs_write_EBADF,test_yaffs_write_EBADF_clean,"test_yaffs_write_EBADF"},
337 //      {test_yaffs_write_big_file,test_yaffs_write_big_file_clean,"test_yaffs_write_big_file"},
338         {test_yaffs_write_EROFS,test_yaffs_write_EROFS_clean,"test_yaffs_write_EROFS"},
339
340         {test_yaffs_read,test_yaffs_read_clean,"test_yaffs_read"},
341         {test_yaffs_read_EBADF,test_yaffs_read_EBADF_clean,"test_yaffs_read_EBADF"},
342 //      {test_yaffs_read_EINVAL,test_yaffs_read_EINVAL_clean,"test_yaffs_read_EINVAL"},
343
344         {test_yaffs_stat,test_yaffs_stat_clean,"test_yaffs_stat"},
345         {test_yaffs_stat_ENOENT,test_yaffs_stat_ENOENT_clean,"test_yaffs_stat_ENOENT"},
346         {test_yaffs_stat_ENOTDIR,test_yaffs_stat_ENOTDIR_clean,"test_yaffs_stat_ENOTDIR"},
347         {test_yaffs_stat_ENOENT2,test_yaffs_stat_ENOENT2_clean,"test_yaffs_stat_ENOENT2"},
348         {test_yaffs_stat_ELOOP,test_yaffs_stat_ELOOP_clean,"test_yaffs_stat_ELOOP"},
349         {test_yaffs_stat_ENAMETOOLONG,test_yaffs_stat_ENAMETOOLONG_clean,"test_yaffs_stat_ENAMETOOLONG"},
350         {test_yaffs_stat_NULL,test_yaffs_stat_NULL_clean,"test_yaffs_stat_NULL"},
351
352         {test_yaffs_fstat,test_yaffs_fstat_clean,"test_yaffs_fstat"},
353         {test_yaffs_fstat_EBADF,test_yaffs_fstat_EBADF_clean,"test_yaffs_fstat_EBADF"},
354
355         {test_yaffs_ftruncate,test_yaffs_ftruncate_clean,"test_yaffs_ftruncate"},
356         {test_yaffs_ftruncate_EBADF,test_yaffs_ftruncate_EBADF_clean,"test_yaffs_ftruncate_EBADF"},
357         {test_yaffs_ftruncate_EINVAL,test_yaffs_ftruncate_EINVAL_clean,"test_yaffs_ftruncate_EINVAL"},
358         {test_yaffs_ftruncate_big_file,test_yaffs_ftruncate_big_file_clean,"test_yaffs_ftruncate_big_file"},
359         {test_yaffs_ftruncate_EROFS,test_yaffs_ftruncate_EROFS_clean,"test_yaffs_ftruncate_EROFS"},
360
361         {test_yaffs_truncate,test_yaffs_truncate_clean,"test_yaffs_truncate"},
362         {test_yaffs_truncate_ENOTDIR,test_yaffs_truncate_ENOTDIR_clean,"test_yaffs_truncate_ENOTDIR"},
363         {test_yaffs_truncate_EISDIR,test_yaffs_truncate_EISDIR_clean,"test_yaffs_truncate_EISDIR"},
364         {test_yaffs_truncate_EINVAL,test_yaffs_truncate_EINVAL_clean,"test_yaffs_truncate_EINVAL"},
365         {test_yaffs_truncate_ENOENT,test_yaffs_truncate_ENOENT_clean,"test_yaffs_truncate_ENOENT"},
366         {test_yaffs_truncate_ENOENT2,test_yaffs_truncate_ENOENT2_clean,"test_yaffs_truncate_ENOENT2"},
367         {test_yaffs_truncate_ELOOP,test_yaffs_truncate_ELOOP_clean,"test_yaffs_truncate_ELOOP"},
368         {test_yaffs_truncate_ELOOP_dir,test_yaffs_truncate_ELOOP_dir_clean,"test_yaffs_truncate_ELOOP_dir"},
369         {test_yaffs_truncate_EROFS,test_yaffs_truncate_EROFS_clean,"test_yaffs_truncate_EROFS"},
370         {test_yaffs_truncate_ENAMETOOLONG,test_yaffs_truncate_ENAMETOOLONG_clean,"test_yaffs_truncate_ENAMETOOLONG"},
371         {test_yaffs_truncate_NULL,test_yaffs_truncate_NULL_clean,"test_yaffs_truncate_NULL"},
372 //      {test_yaffs_truncate_big_file,test_yaffs_truncate_big_file_clean,"test_yaffs_truncate_big_file"}, //this test does not work because the large number becomes 0 when the file is compiled.
373
374         {test_yaffs_chmod,test_yaffs_chmod_clean,"test_yaffs_chmod"},
375         {test_yaffs_chmod_ENOENT,test_yaffs_chmod_ENOENT_clean,"test_yaffs_chmod_ENOENT"},
376         {test_yaffs_chmod_ENOTDIR,test_yaffs_chmod_ENOTDIR_clean,"test_yaffs_chmod_ENOTDIR"},
377         {test_yaffs_chmod_EINVAL,test_yaffs_chmod_EINVAL_clean,"test_yaffs_chmod_EINVAL"},
378         {test_yaffs_chmod_ELOOP_dir,test_yaffs_chmod_ELOOP_dir_clean,"test_yaffs_chmod_ELOOP_dir"},
379         {test_yaffs_chmod_ELOOP,test_yaffs_chmod_ELOOP_clean,"test_yaffs_chmod_ELOOP"},
380         {test_yaffs_chmod_EROFS,test_yaffs_chmod_EROFS_clean,"test_yaffs_chmod_EROFS"},
381         {test_yaffs_chmod_ENAMETOOLONG,test_yaffs_chmod_ENAMETOOLONG_clean,"test_yaffs_chmod_ENAMETOOLONG"},
382         {test_yaffs_chmod_NULL,test_yaffs_chmod_NULL_clean,"test_yaffs_chmod_NULL"},
383
384         {test_yaffs_fchmod,test_yaffs_fchmod_clean,"test_yaffs_fchmod"},
385         {test_yaffs_fchmod_EBADF,test_yaffs_fchmod_EBADF_clean,"test_yaffs_fchmod_EBADF"},
386         {test_yaffs_fchmod_EINVAL,test_yaffs_fchmod_EINVAL_clean,"test_yaffs_fchmod_EINVAL"},
387         {test_yaffs_fchmod_EROFS,test_yaffs_fchmod_EROFS_clean,"test_yaffs_fchmod_EROFS"},
388         {test_yaffs_fchmod_NULL,test_yaffs_fchmod_NULL_clean,"test_yaffs_fchmod_NULL"},
389
390         {test_yaffs_fsync,test_yaffs_fsync_clean,"test_yaffs_fsync"},
391         {test_yaffs_fsync_EBADF,test_yaffs_fsync_EBADF_clean,"test_yaffs_fsync_EBADF"},
392         {test_yaffs_fsync_EROFS,test_yaffs_fsync_EROFS_clean,"test_yaffs_fsync_EROFS"},
393
394         {test_yaffs_fdatasync,test_yaffs_fdatasync_clean,"test_yaffs_fdatasync"},
395         {test_yaffs_fdatasync_EBADF,test_yaffs_fdatasync_EBADF_clean,"test_yaffs_fdatasync_EBADF"},
396         {test_yaffs_fdatasync_EROFS,test_yaffs_fdatasync_EROFS_clean,"test_yaffs_fdatasync_EROFS"},
397         {test_yaffs_fdatasync_NULL,test_yaffs_fdatasync_NULL_clean,"test_yaffs_fdatasync_NULL"},
398
399         {test_yaffs_mkdir,test_yaffs_mkdir_clean,"test_yaffs_mkdir"},
400         {test_yaffs_mkdir_EEXIST,test_yaffs_mkdir_EEXIST_clean,"test_yaffs_mkdir_EEXIST"},
401         {test_yaffs_mkdir_ENOTDIR,test_yaffs_mkdir_ENOTDIR_clean,"test_yaffs_mkdir_ENOTDIR"},
402         {test_yaffs_mkdir_ENOENT,test_yaffs_mkdir_ENOENT_clean,"test_yaffs_mkdir_ENOENT"},
403         {test_yaffs_mkdir_ELOOP_dir,test_yaffs_mkdir_ELOOP_dir_clean,"test_yaffs_mkdir_ELOOP_dir"},
404         {test_yaffs_mkdir_EROFS,test_yaffs_mkdir_EROFS_clean,"test_yaffs_mkdir_EROFS"},
405         {test_yaffs_mkdir_ENAMETOOLONG,test_yaffs_mkdir_ENAMETOOLONG_clean,"test_yaffs_mkdir_ENAMETOOLONG"},
406         {test_yaffs_mkdir_NULL,test_yaffs_mkdir_NULL_clean,"test_yaffs_mkdir_NULL"},
407
408
409         {test_yaffs_symlink,test_yaffs_symlink_clean,"test_yaffs_symlink"},
410         {test_yaffs_symlink_ENOTDIR,test_yaffs_symlink_ENOTDIR_clean,"test_yaffs_symlink_ENOTDIR"},
411         {test_yaffs_symlink_EEXIST,test_yaffs_symlink_EEXIST_clean,"test_yaffs_symlink_EEXIST"},
412         {test_yaffs_symlink_ENOENT,test_yaffs_symlink_ENOENT_clean,"test_yaffs_symlink_ENOENT"},
413         {test_yaffs_symlink_ENOENT2,test_yaffs_symlink_ENOENT2_clean,"test_yaffs_symlink_ENOENT2"},
414         {test_yaffs_symlink_ELOOP_dir,test_yaffs_symlink_ELOOP_dir_clean,"test_yaffs_symlink_ELOOP_dir"},
415         {test_yaffs_symlink_EROFS,test_yaffs_symlink_EROFS_clean,"test_yaffs_symlink_EROFS"},
416         {test_yaffs_symlink_ENAMETOOLONG,test_yaffs_symlink_ENAMETOOLONG_clean,"test_yaffs_symlink_ENAMETOOLONG"},
417         {test_yaffs_symlink_NULL,test_yaffs_symlink_NULL_clean,"test_yaffs_symlink_NULL"},
418         {test_yaffs_symlink_NULL2,test_yaffs_symlink_NULL2_clean,"test_yaffs_symlink_NULL2"},
419
420         {test_yaffs_mount2,test_yaffs_mount2_clean,"test_yaffs_mount2"},
421         {test_yaffs_mount2_ENODEV,test_yaffs_mount2_ENODEV_clean,"test_yaffs_mount2_ENODEV"},
422         
423
424         {test_yaffs_unmount2,test_yaffs_unmount2_clean,"test_yaffs_unmount2"},
425         {test_yaffs_unmount2_ENODEV,test_yaffs_unmount2_ENODEV_clean,"test_yaffs_unmount2_ENODEV"},
426         {test_yaffs_unmount2_EINVAL,test_yaffs_unmount2_EINVAL_clean,"test_yaffs_unmount2_EINVAL"},
427 {test_yaffs_unmount2_with_handle_open_and_forced_mode_on,test_yaffs_unmount2_with_handle_open_and_forced_mode_on_clean,"test_yaffs_unmount2_with_handle_open_and_forced_mode_on"},
428 {test_yaffs_unmount2_with_handle_open_and_forced_mode_off,test_yaffs_unmount2_with_handle_open_and_forced_mode_off_clean,"test_yaffs_unmount2_with_handle_open_and_forced_mode_off"},
429         {test_yaffs_unmount_NULL,test_yaffs_unmount_NULL_clean,"test_yaffs_unmount_NULL"},
430
431         {test_yaffs_sync,test_yaffs_sync_clean,"test_yaffs_sync"},
432         {test_yaffs_sync_ENODEV,test_yaffs_sync_ENODEV_clean,"test_yaffs_sync_ENODEV"},
433         {test_yaffs_sync_EROFS,test_yaffs_sync_EROFS_clean,"test_yaffs_sync_EROFS"},
434         {test_yaffs_sync_ENAMETOOLONG,test_yaffs_sync_ENAMETOOLONG_clean,"test_yaffs_sync_ENAMETOOLONG"},
435         {test_yaffs_sync_NULL,test_yaffs_sync_NULL_clean,"test_yaffs_sync_NULL"},
436
437
438         {test_yaffs_remount_force_off_read_only_off,test_yaffs_remount_force_off_read_only_off_clean,"test_yaffs_remount_force_off_read_only_off"},
439 {test_yaffs_remount_force_on_read_only_off,test_yaffs_remount_force_on_read_only_off_clean,"test_yaffs_remount_force_on_read_only_off"},
440         {test_yaffs_remount_ENODEV,test_yaffs_remount_ENODEV_clean,"test_yaffs_remount_ENODEV"},
441         {test_yaffs_remount_EINVAL,test_yaffs_remount_EINVAL_clean,"test_yaffs_remount_EINVAL"},
442         {test_yaffs_remount_ENAMETOOLONG,test_yaffs_remount_ENAMETOOLONG_clean,"test_yaffs_remount_ENAMETOOLONG"},
443         {test_yaffs_remount_NULL,test_yaffs_remount_NULL_clean,"test_yaffs_remount_NULL"},
444
445         {test_yaffs_freespace,test_yaffs_freespace_clean,"test_yaffs_freespace"},
446         {test_yaffs_freespace_EINVAL,test_yaffs_freespace_EINVAL_clean,"test_yaffs_freespace_EINVAL"},
447         {test_yaffs_freespace_ENAMETOOLONG,test_yaffs_freespace_ENAMETOOLONG_clean,"test_yaffs_freespace_ENAMETOOLONG"},
448         {test_yaffs_freespace_NULL,test_yaffs_freespace_NULL_clean,"test_yaffs_freespace_NULL"},
449
450         {test_yaffs_totalspace,test_yaffs_totalspace_clean,"test_yaffs_totalspace"},
451         {test_yaffs_totalspace_EINVAL,test_yaffs_totalspace_EINVAL_clean,"test_yaffs_totalspace_EINVAL"},
452         {test_yaffs_totalspace_ENAMETOOLONG,test_yaffs_totalspace_ENAMETOOLONG_clean,"test_yaffs_totalspace_ENAMETOOLONG"},
453         {test_yaffs_totalspace_NULL,test_yaffs_totalspace_NULL_clean,"test_yaffs_totalspace_NULL"},
454
455         {test_yaffs_inodecount,test_yaffs_inodecount_clean,"test_yaffs_inodecount"},
456         {test_yaffs_inodecount_EINVAL,test_yaffs_inodecount_EINVAL_clean,"test_yaffs_inodecount_EINVAL"},
457         {test_yaffs_inodecount_ENAMETOOLONG,test_yaffs_inodecount_ENAMETOOLONG_clean,"test_yaffs_inodecount_ENAMETOOLONG"},
458         {test_yaffs_inodecount_NULL,test_yaffs_inodecount_NULL_clean,"test_yaffs_inodecount_NULL"},
459
460         {test_yaffs_link,test_yaffs_link_clean,"test_yaffs_link"},
461         {test_yaffs_link_ENOENT,test_yaffs_link_ENOENT_clean,"test_yaffs_link_ENOENT"},
462         {test_yaffs_link_EEXIST,test_yaffs_link_EEXIST_clean,"test_yaffs_link_EEXIST"},
463         {test_yaffs_link_ENOTDIR,test_yaffs_link_ENOTDIR_clean,"test_yaffs_link_ENOTDIR"},
464         {test_yaffs_link_ENOTDIR2,test_yaffs_link_ENOTDIR2_clean,"test_yaffs_link_ENOTDIR2"},
465         {test_yaffs_link_ENOENT2,test_yaffs_link_ENOENT2_clean,"test_yaffs_link_ENOENT2"},
466         {test_yaffs_link_ENOENT3,test_yaffs_link_ENOENT3_clean,"test_yaffs_link_ENOENT3"},
467         {test_yaffs_link_ENOENT4,test_yaffs_link_ENOENT4_clean,"test_yaffs_link_ENOENT4"},
468         {test_yaffs_link_ELOOP_dir,test_yaffs_link_ELOOP_dir_clean,"test_yaffs_link_ELOOP_dir"},
469         {test_yaffs_link_EROFS,test_yaffs_link_EROFS_clean,"test_yaffs_link_EROFS"},
470         {test_yaffs_link_ENAMETOOLONG,test_yaffs_link_ENAMETOOLONG_clean,"test_yaffs_link_ENAMETOOLONG"},
471         {test_yaffs_link_ENAMETOOLONG2,test_yaffs_link_ENAMETOOLONG2_clean,"test_yaffs_link_ENAMETOOLONG2"},
472         {test_yaffs_link_NULL,test_yaffs_link_NULL_clean,"test_yaffs_link_NULL"},
473         {test_yaffs_link_NULL2,test_yaffs_link_NULL2_clean,"test_yaffs_link_NULL2"},
474
475         {test_yaffs_rmdir,test_yaffs_rmdir_clean,"test_yaffs_rmdir"},
476         {test_yaffs_rmdir_EBUSY,test_yaffs_rmdir_EBUSY_clean,"test_yaffs_rmdir_EBUSY"},
477         {test_yaffs_rmdir_EINVAL,test_yaffs_rmdir_EINVAL_clean,"test_yaffs_rmdir_EINVAL"},
478         {test_yaffs_rmdir_ENOENT,test_yaffs_rmdir_ENOENT_clean,"test_yaffs_rmdir_ENOENT"},
479         {test_yaffs_rmdir_ENOTDIR,test_yaffs_rmdir_ENOTDIR_clean,"test_yaffs_rmdir_ENOTDIR"},
480         {test_yaffs_rmdir_ELOOP_dir,test_yaffs_rmdir_ELOOP_dir_clean,"test_yaffs_rmdir_ELOOP_dir"},
481         {test_yaffs_rmdir_EROFS,test_yaffs_rmdir_EROFS_clean,"test_yaffs_rmdir_EROFS"},
482         {test_yaffs_rmdir_ENAMETOOLONG,test_yaffs_rmdir_ENAMETOOLONG_clean,"test_yaffs_rmdir_ENAMETOOLONG"},
483         {test_yaffs_rmdir_ENOTEMPTY,test_yaffs_rmdir_ENOTEMPTY_clean,"test_yaffs_rmdir_ENOTEMPTY"},
484
485         {test_yaffs_stat_ELOOP_dir,test_yaffs_stat_ELOOP_dir_clean,"test_yaffs_stat_ELOOP_dir"},
486
487         {test_yaffs_rename,test_yaffs_rename_clean,"test_yaffs_rename"},
488         {test_yaffs_rename_ENOENT,test_yaffs_rename_ENOENT_clean,"test_yaffs_rename_ENOENT"},
489         {test_yaffs_rename_ENOTDIR,test_yaffs_rename_ENOTDIR_clean,"test_yaffs_rename_ENOTDIR"},
490         {test_yaffs_rename_EINVAL,test_yaffs_rename_EINVAL_clean,"test_yaffs_rename_EINVAL"},
491         {test_yaffs_rename_dir,test_yaffs_rename_dir_clean,"test_yaffs_rename_dir"},
492         {test_yaffs_rename_dir_ENOENT,test_yaffs_rename_dir_ENOENT_clean,"test_yaffs_rename_dir_ENOENT"},
493         {test_yaffs_rename_dir_ENOENT2,test_yaffs_rename_dir_ENOENT2_clean,"test_yaffs_rename_dir_ENOENT2"},
494         {test_yaffs_rename_dir_to_file,test_yaffs_rename_dir_to_file_clean,"test_yaffs_rename_dir_to_file"},
495         {test_yaffs_rename_file_to_dir,test_yaffs_rename_file_to_dir_clean,"test_yaffs_rename_file_to_dir"},
496         {test_yaffs_rename_EEXISTS,test_yaffs_rename_EEXISTS_clean,"test_yaffs_rename_EEXISTS"},
497         {test_yaffs_rename_ELOOP_dir,test_yaffs_rename_ELOOP_dir_clean,"test_yaffs_rename_ELOOP_dir"},
498         {test_yaffs_rename_EROFS,test_yaffs_rename_EROFS_clean,"test_yaffs_rename_EROFS"},
499         {test_yaffs_rename_ENAMETOOLONG,test_yaffs_rename_ENAMETOOLONG_clean,"test_yaffs_rename_ENAMETOOLONG"},
500         {test_yaffs_rename_ENAMETOOLONG2,test_yaffs_rename_ENAMETOOLONG2_clean,"test_yaffs_rename_ENAMETOOLONG2"},
501         {test_yaffs_rename_NULL,test_yaffs_rename_NULL_clean,"test_yaffs_rename_NULL"},
502         {test_yaffs_rename_NULL2,test_yaffs_rename_NULL2_clean,"test_yaffs_rename_NULL2"},
503         {test_yaffs_rename_to_null_file,test_yaffs_rename_to_null_file_clean,"test_yaffs_rename_to_null_file"},
504         {test_yaffs_rename_file_over_file,test_yaffs_rename_file_over_file_clean,"test_yaffs_rename_file_over_file"},
505         {test_yaffs_rename_dir_over_dir,test_yaffs_rename_dir_over_dir_clean,"test_yaffs_rename_dir_over_dir"},
506         {test_yaffs_rename_full_dir_over_dir,test_yaffs_rename_full_dir_over_dir_clean,"test_yaffs_rename_full_dir_over_dir"},
507         {test_yaffs_rename_ENOTEMPTY,test_yaffs_rename_ENOTEMPTY_clean,"test_yaffs_rename_ENOTEMPTY"},
508
509         {test_yaffs_lstat,test_yaffs_lstat_clean,"test_yaffs_lstat"},
510         {test_yaffs_lstat_ENOENT,test_yaffs_lstat_ENOENT_clean,"test_yaffs_lstat_ENOENT"},
511         {test_yaffs_lstat_ENOTDIR,test_yaffs_lstat_ENOTDIR_clean,"test_yaffs_lstat_ENOTDIR"},
512         {test_yaffs_lstat_ENAMETOOLONG,test_yaffs_lstat_ENAMETOOLONG_clean,"test_yaffs_lstat_ENAMETOOLONG"},
513         {test_yaffs_lstat_NULL,test_yaffs_lstat_NULL_clean,"test_yaffs_lstat_NULL"},
514
515         {test_yaffs_flush,test_yaffs_flush_clean,"test_yaffs_flush"},
516         {test_yaffs_flush_EBADF,test_yaffs_flush_EBADF_clean,"test_yaffs_flush_EBADF"},
517         {test_yaffs_flush_EROFS,test_yaffs_flush_EROFS_clean,"test_yaffs_flush_EROFS"},
518
519         {test_yaffs_dup,test_yaffs_dup_clean,"test_yaffs_dup"},
520         {test_yaffs_dup_EBADF,test_yaffs_dup_EBADF_clean,"test_yaffs_dup_EBADF"},
521
522         };
523
524 void logical_run_of_tests(void);
525 void init_quick_tests(int argc, char *argv[]);
526 void quit_quick_tests(int exit_code);
527 void get_error(void);
528 void run_random_test_loop(void);
529 void run_test(int x);
530 #endif