yaffs update to quick tests.
[yaffs2.git] / direct / timothy_tests / quick_tests / test_yaffs_read.c
1 #include "test_yaffs_write.h"
2
3 int test_yaffs_read(void){
4         int handle=test_open_file();
5         char text[20]="\0";
6         int output=0;
7         if (handle>0){
8                 output=yaffs_read(handle, text, FILE_TEXT_NBYTES);
9                 if (output>0){
10                         if (text==FILE_TEXT){
11                                 return 1;
12                         }
13                         else {
14                                 printf("text does not match the the text that should be in the file\n");
15                         }
16                 }
17                 else{
18                         printf("error reading file");
19                 }
20         }
21         else {
22                 printf("error opening file\n");
23                 return -1;
24         }
25         
26 }
27
28 int test_yaffs_read_clean(void){
29         /* need to reset the seek position*/
30         
31         return test_yaffs_lseek_to_beginning();
32 }