yaffs Trying to find a bug in timothy quick tests.
[yaffs2.git] / direct / timothy_tests / quick_tests / README.txt
1
2 Made by Timothy Manning <timothy@yaffs.net> on 04/11/2010
3
4
5 the yaffs_open function has been covered by tests
6 the yaffs_close function has been covered by tests
7
8 tests made
9         test_yaffs_mount
10         test_yaffs_access
11         test_yaffs_close
12         test_yaffs_close_EBADF
13         test_yaffs_ftruncate
14         test_yaffs_lseek
15         test_yaffs_open
16         test_yaffs_open_EEXIST
17         test_yaffs_open_EISDIR
18         test_yaffs_open_ENAMETOOLONG
19         test_yaffs_open_ENOENT
20         test_yaffs_open_ENOTDIR
21         test_yaffs_read
22         test_yaffs_stat
23         test_yaffs_truncate
24         test_yaffs_unlink_EISDIR
25         test_yaffs_unlink_ENAMETOOLONG
26         test_yaffs_unlink_ENOENT
27         test_yaffs_unlink_ENOTDIR
28         test_yaffs_write
29 tests to add
30         test_yaffs_mount_EACCES
31         test_yaffs_mount_EINVAL
32         test_yaffs_mount_ELOOP
33         test_yaffs_mount_EMFILE
34         test_yaffs_mount_ENAMETOOLONG
35         test_yaffs_mount_ENOENT
36         test_yaffs_mount_ENOTDIR
37         test_yaffs_open_EACCES
38         test_yaffs_open_ENOSPC
39         test_yaffs_open_ELOOP   Too many symbolic links were encountered in resolving pathname
40         test_yaffs_close
41         test yaffs_open_running_out_of_handles error
42         test_yaffs_unlink_EACCES
43         test_yaffs_unlink_ELOOP
44         test_yaffs_unlink_ENOENT
45         test_yaffs_unlink_ENOMEM
46         check to see if an error code is generated when there isn't an error
47         test_yaffs_access_EACCESS
48         test_yaffs_access_ELOOP
49         test_yaffs_access_ENAMETOOLONG
50         test_yaffs_access_ENOENT
51         test_yaffs_access_ENOTDIR
52         test_yaffs_access_ENIVAL        //mode is incorrect.
53
54
55 How to add a test
56         First create the test .c and .h file.
57         The file name and test function name should be the same. 
58         This name should follow one of these formats: 
59         Test_yaffs_[function of yaffs which is been tested]
60         Test_yaffs_[function of yaffs which is been tested]_[error trying to be generated]
61         
62         The .c file needs to contain two functions.
63         The first function needs to contain the code for the main test and will return -1 on a failure and 0 or greater on a success.
64         The second function needs contain the code for cleaning up after the test. Cleaning up may include closing some open handles, recreating a file, ect. 
65         This second function needs to return -1 on a failure and 0 or greater on success.
66
67         The name of first function needs to be called the same as the file name (without the .c or .h)
68         The second function's name needs be the same as the first function but with "_clean" added on the end.
69         
70         So if a test is been created for the yaffs function yaffs_fish() then create these files
71         Test_yaffs_fish.c
72                 Contains int test_yaffs_fish(void); int test_yaffs_fish_clean(void);
73         Test_yaffs_fish.h
74                 Which includes "lib.h", "yaffsfs.h" header files.
75
76         Next write the test code in these files then add these files to the Makefile.
77
78         Add the name of the test files' object file (test_yaffs_fish.o ) to the TESTFILES tag around line 50 of the Makefile.   
79
80
81
82         Now add the test functions to the test_list[] array in quick_tests.h
83         The order of the tests matters. The idea is to test each yaffs_function individualy and only using tested yaffs_components before using this new yaffs_function. 
84         This array consists of: {[test function], [the clean function], [name of the tests which will be printed when the test fails]}, 
85         
86         So add this line to the test_list[]: {test_yaffs_fish, test_yaffs_fish_clean, "test_yaffs_fish"},
87
88         Also include the test's .h file in the quick_test.h file: #include "test_yaffs_fish.h"
89
90         The test file should now make and run. 
91         
92         
93         
94
95
96
97         PS: yaffs_fish() is a made up function for this README (in case you want to try and find this function in yaffs). 
98
99
100 BUGS
101         Needing to include int random_seed; and int simulate_power_failure = 0; in any main program using yaffsfs.h
102         bug with opening a file with a name of 1,000,000 char long with no errors.
103         bug with unlinking a file with 1,000,000 get the error ENOENT but should be geting ENAMETOOLONG. 
104         
105         FIXED-ENOSPC error in programs test_yaffs_open_ENOTDIR and test_yaffs_open_ENOENT.
106         FIXED-ENOENT been returned by yaffs_read but the handle is good and the yaffs_open function does not return an error.
107
108
109
110