yaffs Adding more error code test programs to quick tests. note the bugs are still...
[yaffs2.git] / direct / timothy_tests / quick_tests / test_yaffs_truncate.c
1 #include "test_yaffs_truncate.h"
2 static int handle=0;
3
4 int test_yaffs_truncate(void){
5         handle=test_yaffs_open();
6         if (handle>0){
7                 return yaffs_truncate(FILE_PATH,FILE_SIZE_TRUNCATED );
8         }
9         else {
10                 printf("error opening file");
11                 return -1;
12         }
13 }
14
15 int test_yaffs_truncate_clean(void){
16         /* change file size back to orignal size */
17         int handle=test_yaffs_open();
18         int output=0;
19         if (handle>0){
20                 output= yaffs_truncate(FILE_PATH,FILE_SIZE );
21                 if (output>=0){
22                         return yaffs_close(handle);
23                 }
24         }
25         else {
26                 printf("error opening file in clean function");
27                 return -1;
28         }
29
30 }