yaffs more tests for quick tests.
[yaffs2.git] / direct / 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-2010 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
20 #include "test_yaffs_mount.h"
21 #include "test_yaffs_mount_ENODEV.h"
22 #include "test_yaffs_mount_ENAMETOOLONG.h"
23 #include "test_yaffs_mount_ENOENT.h"
24 #include "test_yaffs_mount_EBUSY.h"
25
26 #include "test_yaffs_unmount.h"
27 #include "test_yaffs_unmount_ENOENT.h"
28 #include "test_yaffs_unmount_ENAMETOOLONG.h"
29 #include "test_yaffs_unmount_EBUSY.h"
30
31 #include "test_yaffs_open.h"
32 #include "test_yaffs_open_EISDIR.h"
33 #include "test_yaffs_open_EEXIST.h"
34 #include "test_yaffs_open_ENOENT.h"
35 #include "test_yaffs_open_ENOTDIR.h"
36 #include "test_yaffs_open_ENAMETOOLONG.h"
37 #include "test_yaffs_open_EINVAL.h"
38 #include "test_yaffs_open_EINVAL2.h"
39
40 #include "test_yaffs_close_EBADF.h"
41
42
43 #include "test_yaffs_unlink.h"
44 #include "test_yaffs_unlink_EISDIR.h"
45 #include "test_yaffs_unlink_ENOENT.h"
46 #include "test_yaffs_unlink_ENAMETOOLONG.h"
47 #include "test_yaffs_unlink_ENOTDIR.h"
48 #include "test_yaffs_unlink_ENOENT.h"
49
50 #include "test_yaffs_ftruncate.h"
51 #include "test_yaffs_ftruncate_EBADF.h"
52 #include "test_yaffs_ftruncate_EINVAL.h"
53 #include "test_yaffs_ftruncate_EFBIG.h"
54
55
56 #include "test_yaffs_truncate.h"
57 #include "test_yaffs_truncate_ENOTDIR.h"
58 #include "test_yaffs_truncate_EISDIR.h"
59 #include "test_yaffs_truncate_ENOENT.h"
60 #include "test_yaffs_truncate_EINVAL.h"
61 #include "test_yaffs_truncate_EFBIG.h"
62
63 #include "test_yaffs_write.h"
64 #include "test_yaffs_write_EBADF.h"
65 #include "test_yaffs_write_EFBIG.h"
66
67 #include "test_yaffs_read.h"
68 #include "test_yaffs_read_EBADF.h"
69 #include "test_yaffs_read_EINVAL.h"
70
71 #include "test_yaffs_lseek.h"
72 #include "test_yaffs_lseek_EBADF.h"
73 #include "test_yaffs_lseek_EINVAL.h"
74 #include "test_yaffs_lseek_EFBIG.h"
75
76 #include "test_yaffs_access.h"
77 #include "test_yaffs_access_EINVAL.h"
78 #include "test_yaffs_access_ENOTDIR.h"
79 #include "test_yaffs_access_ENOENT.h"
80
81 #include "test_yaffs_stat.h"
82 #include "test_yaffs_stat_ENOENT.h"
83 #include "test_yaffs_stat_ENOTDIR.h"
84
85 #include "test_yaffs_fstat.h"
86 #include "test_yaffs_fstat_EBADF.h"
87
88 #include "yaffsfs.h"
89 #include "yaffs_error_converter.h"
90 #include "lib.h"
91
92
93 #define EXIT_ON_ERROR 0
94
95 typedef struct test {
96         int (*p_function)(void);        /*pointer to test function*/
97         int (*p_function_clean)(void);
98         /*char pass_message[50]; will not need a pass message*/
99         char *name_of_test;     /*pointer to fail message, needs to include name of test*/
100 }test_template;
101
102
103 test_template test_list[]={
104         {test_yaffs_mount,test_yaffs_mount_clean,"test_yaffs_mount"},
105         {test_yaffs_mount_ENODEV,test_yaffs_mount_ENODEV_clean,"test_yaffs_mount_ENODEV"},
106         {test_yaffs_mount_ENAMETOOLONG,test_yaffs_mount_ENAMETOOLONG_clean,"test_yaffs_mount_ENAMETOOLONG"},
107         {test_yaffs_mount_ENOENT,test_yaffs_mount_ENOENT_clean,"test_yaffs_mount_ENOENT"},
108         {test_yaffs_mount_EBUSY,test_yaffs_mount_EBUSY_clean,"test_yaffs_mount_EBUSY"},
109
110         {test_yaffs_unmount,test_yaffs_unmount_clean,"test_yaffs_unmount"},
111         {test_yaffs_unmount_ENOENT,test_yaffs_unmount_ENOENT_clean,"test_yaffs_unmount_ENOENT"},
112         {test_yaffs_unmount_ENAMETOOLONG,test_yaffs_unmount_ENAMETOOLONG_clean,"test_yaffs_unmount_ENAMETOOLONG"},
113         {test_yaffs_unmount_EBUSY,test_yaffs_unmount_EBUSY_clean,"test_yaffs_unmount_EBUSY"},
114
115         {test_yaffs_open,test_yaffs_open_clean,"test_yaffs_open"},
116         {test_yaffs_open_EISDIR,test_yaffs_open_EISDIR_clean,"test_yaffs_open_EISDIR"},
117         {test_yaffs_open_EEXIST,test_yaffs_open_EEXIST_clean,"test_yaffs_open_EEXIST"},
118         {test_yaffs_open_ENOTDIR,test_yaffs_open_ENOTDIR_clean,"test_yaffs_open_ENOTDIR"},
119         {test_yaffs_open_ENOENT,test_yaffs_open_ENOENT_clean,"test_yaffs_open_ENOENT"},
120         {test_yaffs_open_ENAMETOOLONG,test_yaffs_open_ENAMETOOLONG_clean,"test_yaffs_open_ENAMETOOLONG"},
121         {test_yaffs_open_EINVAL,test_yaffs_open_EINVAL_clean,"test_yaffs_open_EINVAL"},
122         {test_yaffs_open_EINVAL2,test_yaffs_open_EINVAL2_clean,"test_yaffs_open_EINVAL2"},
123         
124         {test_yaffs_close_EBADF,test_yaffs_close_EBADF_clean,"test_yaffs_close_EBADF"},
125
126         {test_yaffs_access,test_yaffs_access_clean,"test_yaffs_access"},
127         {test_yaffs_access_EINVAL,test_yaffs_access_EINVAL_clean,"test_yaffs_access_EINVAL"},
128         {test_yaffs_access_ENOTDIR,test_yaffs_access_ENOTDIR_clean,"test_yaffs_access_ENOTDIR"},
129         {test_yaffs_access_ENOENT,test_yaffs_access_ENOENT_clean,"test_yaffs_access_ENOENT"},
130
131         {test_yaffs_unlink, test_yaffs_unlink_clean,"test_yaffs_unlink"},
132         {test_yaffs_unlink_EISDIR,test_yaffs_unlink_EISDIR_clean,"test_yaffs_unlink_EISDIR"},
133         {test_yaffs_unlink_ENOENT,test_yaffs_unlink_ENOENT_clean,"test_yaffs_unlink_ENOENT"},
134         {test_yaffs_unlink_ENAMETOOLONG,test_yaffs_unlink_ENAMETOOLONG_clean,"test_yaffs_unlink_ENAMETOOLONG"},
135         {test_yaffs_unlink_ENOTDIR,test_yaffs_unlink_ENOTDIR_clean,"test_yaffs_unlink_ENOTDIR"},
136         {test_yaffs_unlink_ENOENT,test_yaffs_unlink_ENOENT_clean,"test_yaffs_unlink_ENOENT"},
137
138
139         {test_yaffs_lseek,test_yaffs_lseek_clean,"test_yaffs_lseek"},
140         {test_yaffs_lseek_EBADF,test_yaffs_lseek_EBADF_clean,"test_yaffs_lseek_EBADF"},
141         {test_yaffs_lseek_EINVAL,test_yaffs_lseek_EINVAL_clean,"test_yaffs_lseek_EINVAL"},
142         {test_yaffs_lseek_EFBIG,test_yaffs_lseek_EFBIG_clean,"test_yaffs_lseek_EFBIG"},
143
144         {test_yaffs_write,test_yaffs_write_clean,"test_yaffs_write"},
145         {test_yaffs_write_EBADF,test_yaffs_write_EBADF_clean,"test_yaffs_write_EBADF"},
146         {test_yaffs_write_EFBIG,test_yaffs_write_EFBIG_clean,"test_yaffs_write_EFBIG"},
147
148         {test_yaffs_read,test_yaffs_read_clean,"test_yaffs_read"},
149         {test_yaffs_read_EBADF,test_yaffs_read_EBADF_clean,"test_yaffs_read_EBADF"},
150         {test_yaffs_read_EINVAL,test_yaffs_read_EINVAL_clean,"test_yaffs_read_EINVAL"},
151
152         {test_yaffs_stat,test_yaffs_stat_clean,"test_yaffs_stat"},
153         {test_yaffs_stat_ENOENT,test_yaffs_stat_ENOENT_clean,"test_yaffs_stat_ENOENT"},
154         {test_yaffs_stat_ENOTDIR,test_yaffs_stat_ENOTDIR_clean,"test_yaffs_stat_ENOTDIR"},
155
156         {test_yaffs_fstat,test_yaffs_fstat_clean,"test_yaffs_fstat"},
157         {test_yaffs_fstat_EBADF,test_yaffs_fstat_EBADF_clean,"test_yaffs_fstat_EBADF"},
158
159         {test_yaffs_ftruncate,test_yaffs_ftruncate_clean,"test_yaffs_ftruncate"},
160         {test_yaffs_ftruncate_EBADF,test_yaffs_ftruncate_EBADF_clean,"test_yaffs_ftruncate_EBADF"},
161         {test_yaffs_ftruncate_EINVAL,test_yaffs_ftruncate_EINVAL_clean,"test_yaffs_ftruncate_EINVAL"},
162         {test_yaffs_ftruncate_EFBIG,test_yaffs_ftruncate_EFBIG_clean,"test_yaffs_ftruncate_EFBIG"},
163
164         {test_yaffs_truncate,test_yaffs_truncate_clean,"test_yaffs_truncate"},
165         {test_yaffs_truncate_ENOTDIR,test_yaffs_truncate_ENOTDIR_clean,"test_yaffs_truncate_ENOTDIR"},
166         {test_yaffs_truncate_EISDIR,test_yaffs_truncate_EISDIR_clean,"test_yaffs_truncate_EISDIR"},
167         {test_yaffs_truncate_EINVAL,test_yaffs_truncate_EINVAL_clean,"test_yaffs_truncate_EINVAL"},
168         {test_yaffs_truncate_ENOENT,test_yaffs_truncate_ENOENT_clean,"test_yaffs_truncate_ENOENT"},
169         {test_yaffs_truncate_EFBIG,test_yaffs_truncate_EFBIG_clean,"test_yaffs_truncate_EFBIG"}
170         };
171
172 void init_quick_tests(void);
173 void quit_quick_tests(int exit_code);
174 void get_error(void);
175 #endif