yaffs Found the bug.
authorTimothy Manning <tfhmanning@gmail.com>
Wed, 17 Nov 2010 02:31:12 +0000 (15:31 +1300)
committerTimothy Manning <tfhmanning@gmail.com>
Wed, 17 Nov 2010 02:31:12 +0000 (15:31 +1300)
Signed-off-by: Timothy Manning <tfhmanning@gmail.com>
direct/timothy_tests/quick_tests/quick_tests.c
direct/timothy_tests/quick_tests/test_yaffs_mount2.c
direct/timothy_tests/quick_tests/test_yaffs_mount_ENODEV.c
direct/timothy_tests/quick_tests/test_yaffs_read_EINVAL.c

index 115525b476a802e82770b550e3b40383408757c8..9fcc0374de5d6804243fac26a85d012ed08fdb7b 100644 (file)
@@ -35,10 +35,6 @@ 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++){
-               output=test_yaffs_open();
-               printf("yaffs_open = %d\n",output);
-               printf("yaffs_close handle 0 = %d\n",yaffs_close(output));
-               //printf("yaffs_close handle 1#################################### =%d\n",yaffs_close(1));
                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);
index 52728b71f6a0b0be207d9e1cfff3f50276d08ca1..8bf856d6e953e7dc4f55af5df1c249d1dd8105e9 100644 (file)
@@ -16,7 +16,6 @@
 int test_yaffs_mount2(void)
 {
        int output = -1;
-       printf("closing handle again %d\n",yaffs_close(0));
        output= yaffs_unmount(YAFFS_MOUNT_POINT);
        if (output < 0) {
                print_message("failed to unmount current_mountpoint\n",2);
index 2688860992a1d94673eb3fad506ef49d310ef263..f073d2067145f98ef3454d5b018efbc5e143e317 100644 (file)
 
 #include "test_yaffs_mount_ENODEV.h"
 
-static int handle = 0;
+
 
 int test_yaffs_mount_ENODEV(void)
 {
        int output=0;
        int error_code=0;
 
-       handle = yaffs_mount("/nonexisting_mount_point/");
-       if (handle==-1){
+       output = yaffs_mount("/nonexisting_mount_point/");
+       if (output<0){
                error_code = yaffs_get_error();
                if (abs(error_code) == ENODEV){
                        return 1;
@@ -29,7 +29,7 @@ int test_yaffs_mount_ENODEV(void)
                        print_message("different error than expected\n",2);
                        return -1;
                }
-       } else if (output >=0){
+       } else {
                print_message("non existant directory opened.(which is a bad thing)\n",2);
                return -1;
        }
index 27120b21c313a8074ea5a7e594522c7819558887..57f47fb8db34f42aadb3cdb6084c68f1c177e86e 100644 (file)
@@ -20,7 +20,6 @@ int test_yaffs_read_EINVAL(void)
 {
        int error_code = 0;
        handle=yaffs_open(FILE_PATH,O_CREAT | O_RDWR, FILE_MODE);
-       printf("newly opend handle = %d handle\n",handle);
        char text[2000000]="\0";
        int output=0;   
        
@@ -86,7 +85,6 @@ int test_yaffs_read_EINVAL_clean(void)
                if(output>=0){
                        output=yaffs_close(handle);
                        if (output>=0){
-                               printf("closed the file, handle %d\n",handle);
                                return 1;
                        } else {
                                print_message("could not close the handle\n",2);