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 115525b..9fcc037 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 52728b7..8bf856d 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 2688860..f073d20 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 27120b2..57f47fb 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);