yaffs Are trapping a suspeced bug in quick_tests.
[yaffs2.git] / direct / timothy_tests / quick_tests / test_yaffs_lseek.c
1 #include "test_yaffs_lseek.h"
2
3 int test_yaffs_lseek(void){
4         int handle=test_open_file();
5         char text[20]="\0";
6         int output=0;
7         if (handle>0){
8                 if (0==yaffs_lseek(handle, 0, SEEK_SET)){
9                         return 1;
10                 }
11                 else {
12                         printf("lseek returned a different position to the expeced position\n");
13                 }
14         }
15         else {
16                 printf("error opening file\n");
17                 return -1;
18         }
19         
20 }
21
22 int test_yaffs_lseek_clean(void){
23         /* need to reset the seek position*/
24         return test_yaffs_lseek_to_beginning(); 
25 }
26 int test_yaffs_lseek_to_beginning(void){
27         int handle=test_open_file();
28         if (handle>0){
29                 if (0==yaffs_lseek(handle, 0, SEEK_SET)){       /*lseek returns the position of the seeker */
30                         return 1;
31                 }
32                 else {
33                         printf("lseek returned a different position to the expeced position\n");
34                 } 
35         }
36         else {
37                 printf("error opening file\n");
38                 return -1;
39         }
40 }