806699b57fbd8f71bce1306b83148e0be20f4054
[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                 return yaffs_lseek(handle, 0, SEEK_SET);
9                 /*
10                 if (output>0){
11                         if (text==FILE_TEXT){
12                                 return 1;
13                         }
14                         else {
15                                 printf("text does not match the the text that should be in the file\n");
16                         }
17                 }
18                 else{
19                         printf("error reading file");
20                 } */
21         }
22         else {
23                 printf("error opening file\n");
24                 return -1;
25         }
26         
27 }
28
29 int test_yaffs_lseek_clean(void){
30         /* need to reset the seek position*/
31         return test_yaffs_lseek_to_beginning(); 
32 }
33 int test_yaffs_lseek_to_beginning(void){
34         int handle=test_open_file();
35         if (handle>0){
36                 return yaffs_lseek(handle, 0, SEEK_SET);
37         }
38         else {
39                 printf("error opening file\n");
40                 return -1;
41         }
42 }