Merge branch 'master' of ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
[yaffs2.git] / direct / timothy_tests / quick_tests / test_yaffs_write_big_file.c
index 6d5033151374f497ef430b931683e5eac53a0d39..99994660cba9dae57ad7814e27c94ce3c562d273 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * YAFFS: Yet another FFS. A NAND-flash specific file system.
  *
- * Copyright (C) 2002-2010 Aleph One Ltd.
+ * Copyright (C) 2002-2011 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
  *
  * Created by Timothy Manning <timothy@yaffs.net>
@@ -13,7 +13,7 @@
 
 #include "test_yaffs_write_big_file.h"
 
-static int handle=0;
+static int handle=-1;
 static char *file_name = NULL;
 int test_yaffs_write_big_file(void)
 {
@@ -38,7 +38,7 @@ int test_yaffs_write_big_file(void)
                return -1;
        }
        
-       strcat(file_name,YAFFS_MOUNT_POINT);
+       strcpy(file_name,YAFFS_MOUNT_POINT);
        for (x=strlen(YAFFS_MOUNT_POINT); x<file_name_length -1; x++){
                file_name[x]='a';
        }
@@ -82,11 +82,11 @@ int test_yaffs_write_big_file_clean(void)
        }
 
        
-       output= test_yaffs_truncate_clean();    
+       output= yaffs_truncate(FILE_PATH,FILE_SIZE );   
        if (output>=0){
                output=test_yaffs_write();
                if (output>=0){
-                       return 1;
+                       return test_yaffs_write_clean();
                } else {
                        printf("failed to write to file\n");
                        return -1;