yaffs Have revised and checked each test in quick tests.
[yaffs2.git] / direct / timothy_tests / quick_tests / test_yaffs_unlink_ENOENT.c
index 882125780431f55fe2a0f23f6a3d1191db1ecfea..113b14840fd045734db81907d27dcfc248465139 100644 (file)
 
 #include "test_yaffs_unlink_ENOENT.h"
 
-static int handle=0;
-int test_yaffs_unlink_ENOENT(void){
-       int output=0;
+static int handle=-1;
+
+int test_yaffs_unlink_ENOENT(void)
+{
        int error_code=0;
-       /*printf("path %s\n",path); */
+
        handle=yaffs_unlink("/yaffs2/non_existant_file");
        if (handle==-1){
                error_code=yaffs_get_error();
-               if (abs(error_code)==ENOENT){
+               if (abs(error_code) == ENOENT){
                        return 1;
-               }
-               else {
-                       printf("different error than expected\n");
+               } else {
+                       print_message("different error than expected\n",2);
                        return -1;
                }
-       }
-       else if (output >=0){
-               printf("non existant file unlinked.(which is a bad thing)\n");
+       } else {
+               print_message("non existant file unlinked.(which is a bad thing)\n",2);
                return -1;
        }
 
 }
-int test_yaffs_unlink_ENOENT_clean(void){
-       if (handle >=0){
+int test_yaffs_unlink_ENOENT_clean(void)
+{
+       if (handle >= 0){
                return test_yaffs_open();
-       }
-       else {
+       } else {
                return 1;       /* the file failed to open so there is no need to close it*/
        }
 }