yaffs Fixed some more bugs in quick tests.
authorTimothy Manning <tfhmanning@gmail.com>
Wed, 17 Nov 2010 03:12:03 +0000 (16:12 +1300)
committerTimothy Manning <tfhmanning@gmail.com>
Wed, 17 Nov 2010 03:12:03 +0000 (16:12 +1300)
Signed-off-by: Timothy Manning <tfhmanning@gmail.com>
direct/timothy_tests/quick_tests/quick_tests.c
direct/timothy_tests/quick_tests/quick_tests.h
direct/timothy_tests/quick_tests/test_yaffs_write_big_file.c

index 9fcc0374de5d6804243fac26a85d012ed08fdb7b..a943f4d3bce1938c0e7406779721326351f76b67 100644 (file)
@@ -35,7 +35,10 @@ int main(int argc, char *argv[]){
        print_message("\n\nrunning quick tests for yaffs\n\n", 0);
 
        for (x=0;x<total_number_of_tests;x++){
-               yaffs_set_error(0);     /*reset the last error to 0 */
+       /*      output=yaffs_open(FILE_PATH,O_CREAT | O_RDWR, FILE_MODE);
+               printf("yaffs_open %d \n",output);
+               printf("yaffs_close %d \n",yaffs_close(output));
+       */      yaffs_set_error(0);     /*reset the last error to 0 */
                sprintf(message,"\nrunning test: %s \n",test_list[x].name_of_test);
                print_message(message,3);
                output=test_list[x].p_function();       /*run test*/
@@ -88,7 +91,7 @@ void quit_quick_tests(int exit_code)
        if (num_of_tests_pass==total_number_of_tests &&  num_of_tests_failed==0){
                printf("\t OK \n");
        }
-       printf("out of %d tests: %d passed %d failed\n\n\n",total_number_of_tests,num_of_tests_pass,num_of_tests_failed);
+       printf("out of %d tests, %d ran: %d passed and %d failed\n\n\n", total_number_of_tests,(num_of_tests_pass+num_of_tests_failed) ,num_of_tests_pass,num_of_tests_failed);
        yaffs_unmount(YAFFS_MOUNT_POINT);
        exit(exit_code);
 }
index 14d7dbc6d13bde1813624899c950fb71accedcff..5d41e806c20b31b48f674aacf072b38ace771905 100644 (file)
@@ -175,7 +175,7 @@ test_template test_list[]={
 
        {test_yaffs_write,test_yaffs_write_clean,"test_yaffs_write"},
        {test_yaffs_write_EBADF,test_yaffs_write_EBADF_clean,"test_yaffs_write_EBADF"},
-//     {test_yaffs_write_big_file,test_yaffs_write_big_file_clean,"test_yaffs_write_big_file"},
+       {test_yaffs_write_big_file,test_yaffs_write_big_file_clean,"test_yaffs_write_big_file"},
 
        {test_yaffs_read,test_yaffs_read_clean,"test_yaffs_read"},
        {test_yaffs_read_EBADF,test_yaffs_read_EBADF_clean,"test_yaffs_read_EBADF"},
index 6d5033151374f497ef430b931683e5eac53a0d39..829204c78fd9c94aef467bd89c5b45d97852defa 100644 (file)
@@ -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)
 {
@@ -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;