8360e85ac718f91515482daaa091a515bdc0765c
[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
24 #include "test_yaffs_unmount.h"
25
26 #include "test_yaffs_open.h"
27 #include "test_yaffs_open_EISDIR.h"
28 #include "test_yaffs_open_EEXIST.h"
29 #include "test_yaffs_open_ENOENT.h"
30 #include "test_yaffs_open_ENOTDIR.h"
31 #include "test_yaffs_open_ENAMETOOLONG.h"
32
33 #include "test_yaffs_close_EBADF.h"
34
35
36 #include "test_yaffs_unlink.h"
37 #include "test_yaffs_unlink_EISDIR.h"
38 #include "test_yaffs_unlink_ENOENT.h"
39 #include "test_yaffs_unlink_ENAMETOOLONG.h"
40 #include "test_yaffs_unlink_ENOTDIR.h"
41
42 #include "test_yaffs_ftruncate.h"
43 #include "test_yaffs_truncate.h"
44 #include "test_yaffs_write.h"
45 #include "test_yaffs_read.h"
46 #include "test_yaffs_lseek.h"
47 #include "test_yaffs_access.h"
48 #include "test_yaffs_stat.h"
49 #include "yaffsfs.h"
50 #include "yaffs_error_converter.h"
51 #include "lib.h"
52
53
54 #define EXIT_ON_ERROR 0
55
56 typedef struct test {
57         int (*p_function)(void);        /*pointer to test function*/
58         int (*p_function_clean)(void);
59         /*char pass_message[50]; will not need a pass message*/
60         char *name_of_test;     /*pointer to fail message, needs to include name of test*/
61 }test_template;
62
63
64 test_template test_list[]={
65         {test_yaffs_mount,test_yaffs_mount_clean,"test_yaffs_mount"},
66         {test_yaffs_mount_ENODEV,test_yaffs_mount_ENODEV_clean,"test_yaffs_mount_ENODEV"},
67         {test_yaffs_mount_ENAMETOOLONG,test_yaffs_mount_ENAMETOOLONG_clean,"test_yaffs_mount_ENAMETOOLONG"},
68
69         {test_yaffs_unmount,test_yaffs_unmount_clean,"test_yaffs_unmount"},
70
71         {test_yaffs_open,test_yaffs_open_clean,"test_yaffs_open"},
72         {test_yaffs_open_EISDIR,test_yaffs_open_EISDIR_clean,"test_yaffs_open_EISDIR"},
73         {test_yaffs_open_EEXIST,test_yaffs_open_EEXIST_clean,"test_yaffs_open_EEXIST"},
74         {test_yaffs_open_ENOTDIR,test_yaffs_open_ENOTDIR_clean,"test_yaffs_open_ENOTDIR"},
75         {test_yaffs_open_ENOENT,test_yaffs_open_ENOENT_clean,"test_yaffs_open_ENOENT"},
76         {test_yaffs_open_ENAMETOOLONG,test_yaffs_open_ENAMETOOLONG_clean,"test_yaffs_open_ENAMETOOLONG"},
77         
78         {test_yaffs_close_EBADF,test_yaffs_close_EBADF_clean,"test_yaffs_close_EBADF"},
79
80         {test_yaffs_access,test_yaffs_access_clean,"test_yaffs_access"},
81
82         {test_yaffs_unlink, test_yaffs_unlink_clean,"test_yaffs_unlink"},
83         {test_yaffs_unlink_EISDIR,test_yaffs_unlink_EISDIR_clean,"test_yaffs_unlink_EISDIR"},
84         {test_yaffs_unlink_ENOENT,test_yaffs_unlink_ENOENT_clean,"test_yaffs_unlink_ENOENT"},
85         {test_yaffs_unlink_ENAMETOOLONG,test_yaffs_unlink_ENAMETOOLONG_clean,"test_yaffs_unlink_ENAMETOOLONG"},
86         {test_yaffs_unlink_ENOTDIR,test_yaffs_unlink_ENOTDIR_clean,"test_yaffs_unlink_ENOTDIR"},
87
88
89         {test_yaffs_lseek,test_yaffs_lseek_clean,"test_yaffs_lseek"},
90         {test_yaffs_write,test_yaffs_write_clean,"test_yaffs_write"},
91         {test_yaffs_read,test_yaffs_read_clean,"test_yaffs_read"},
92
93
94         {test_yaffs_stat,test_yaffs_stat_clean,"test_yaffs_stat"},
95         {test_yaffs_ftruncate,test_yaffs_ftruncate_clean,"test_yaffs_ftruncate"},
96         {test_yaffs_truncate,test_yaffs_truncate_clean,"test_yaffs_truncate"}
97
98         };
99
100 void init_quick_tests(void);
101 void quit_quick_tests(int exit_code);
102 void get_error(void);
103 #endif