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 8c7608e563081c0a3e315803408cd02a430482a8..1c3ca689381db7bf0fbb71379b1efb15f293e31d 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 fcf312d671586664bfe6f3b777b249e0caa49aa4..0dfe000fdf7b9178282b3d60d32b9ca2a4ba5ba9 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 7a0184d9de29ac30e23dbf561cd6beef4e44d7ce..a058d98467a5f662da669021d004b0e30f5819c2 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 896a33b52603822ba545e48daba6d64becef0c2f..ff924be2d6ff8f7f9ffea12567d8773c060a3d10 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 9e196368345323f07430772e58035e445af3525a..ce31a4cb336fbf493ee8fbe687fdbf687a6f0e07 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();