yaffs Fixed some bigs in quick tests.
authorTimothy Manning <tfhmanning@gmail.com>
Mon, 15 Nov 2010 03:04:24 +0000 (16:04 +1300)
committerTimothy Manning <tfhmanning@gmail.com>
Mon, 15 Nov 2010 03:04:24 +0000 (16:04 +1300)
Signed-off-by: Timothy Manning <tfhmanning@gmail.com>
direct/timothy_tests/quick_tests/lib.c
direct/timothy_tests/quick_tests/quick_tests.c
direct/timothy_tests/quick_tests/test_yaffs_close_EBADF.c
direct/timothy_tests/quick_tests/test_yaffs_fchmod.c
direct/timothy_tests/quick_tests/test_yaffs_fchmod_EBADF.c

index 8c7608e..1c3ca68 100644 (file)
@@ -14,7 +14,7 @@
 #include "lib.h"
 
 static int EXIT_ON_ERROR = 1;
-static int  PRINT_LEVEL = 1;   //This sets the level of detail which is printed. There are 3 levels 0,1,2 and 3  
+static int  PRINT_LEVEL = 2;   //This sets the level of detail which is printed. There are 3 levels 0,1,2 and 3  
                        //0 just prints the number of tests passed and failed.
                        //1 is the basic print level. it will print the details of a failed test.
                        //2 will print if a test passes and cleans. 
index fcf312d..0dfe000 100644 (file)
@@ -40,12 +40,12 @@ int main(int argc, char *argv[]){
                //printf("x %d\n",x);
                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,2);
+               print_message(message,3);
                output=test_list[x].p_function();       /*run test*/
                if (output>=0){
                        /*test has passed*/
                        sprintf(message,"\ttest %s passed\n",test_list[x].name_of_test);
-                       print_message(message,2); 
+                       print_message(message,3); 
                        num_of_tests_pass++;
                } else {
                        /*test is assumed to have failed*/
@@ -77,7 +77,7 @@ int main(int argc, char *argv[]){
                        
                } else {
                        sprintf(message,"\ttest clean: %s passed\n",test_list[x].name_of_test);
-                       print_message(message,2);
+                       print_message(message,3);
                }
        }
        /*this is where the loop should break to*/
index 7a0184d..a058d98 100644 (file)
@@ -30,6 +30,7 @@ int test_yaffs_close_EBADF(void)
                        if (output < 0){
                                error_code = yaffs_get_error();
                                if (abs(error_code) == EBADF){
+                                       handle =-1;
                                        return 1;
                                } else {
                                        print_message("different error than expected\n",2);
@@ -53,7 +54,8 @@ int test_yaffs_close_EBADF(void)
 
 int test_yaffs_close_EBADF_clean(void)
 {
-       if (handle <= 0){
+       if (handle >= 0){
+               printf("handle %d\n",handle);
                return yaffs_close(handle);
        } else {
                return 1;
index 896a33b..ff924be 100644 (file)
@@ -26,7 +26,7 @@ int test_yaffs_fchmod(void)
                return -1;
        }
 
-       output = yaffs_fchmod(handle,S_IREAD||S_IWRITE);
+       output = yaffs_fchmod(handle,S_IREAD|S_IWRITE);
 
        if (output>=0){
                /* there were no errors */
index 9e19636..ce31a4c 100644 (file)
@@ -19,7 +19,7 @@ int test_yaffs_fchmod_EBADF(void)
        int error = 0;
        int output = 0;
 
-       output = yaffs_fchmod(-1,S_IREAD||S_IWRITE);
+       output = yaffs_fchmod(-1,S_IREAD|S_IWRITE);
 
        if (output<0){
                error=yaffs_get_error();