yaffs Added more tests to direct/timothy_tests/quicktests
[yaffs2.git] / direct / timothy_tests / quick_tests / test_yaffs_link_EROFS.c
index 31c0900b19072c2b92dfe379d568876c94756934..bfbd48b0c22f8a8bb715b2cb35934f7d05f9de1c 100644 (file)
  * published by the Free Software Foundation.
  */
 
-#include "test_yaffs_link_ELOOP_dir.h"
+#include "test_yaffs_link_EROFS.h"
 
 
 
-int test_yaffs_link_ELOOP_dir(void)
+int test_yaffs_link_EROFS(void)
 {
        int output=0;   
        int error =0;
 
-       if (set_up_ELOOP()<0){
-               print_message("failed to setup symlinks\n",2);
-               return -1;
-       }
+       EROFS_setup();
 
-       output = yaffs_link(ELOOP_PATH "/file",HARD_LINK_PATH);
+       output = yaffs_link(FILE_PATH,HARD_LINK_PATH);
        if (output<0){
                error=yaffs_get_error();
-               if (abs(error)==ELOOP){
+               if (abs(error)==EROFS){
                        return 1;
                } else {
                        print_message("different error than expected\n",2);
                        return -1;
                }
        } else {
-               print_message("created a hard link to a non-existing-dir (which is a bad thing)\n",2);
+               print_message("created a hard link with EROFS set (which is a bad thing)\n",2);
                return -1;      
        }
 }
 
 
-int test_yaffs_link_ELOOP_dir_clean(void)
+int test_yaffs_link_EROFS_clean(void)
 {
        int output=0;   
        int error =0;
@@ -50,13 +47,13 @@ int test_yaffs_link_ELOOP_dir_clean(void)
                error=yaffs_get_error();
                if (abs(error)==ENOENT){
                        //if the file does not exist then the error should be ENOENT.
-                       return 1;
+                       return EROFS_clean();
                } else {
                        print_message("different error than expected\n",2);
                        return -1;
                }
        } else {
-               return 1;       /* the file failed to open so there is no need to close it */
+               return EROFS_clean();   /* the file failed to open so there is no need to close it */
        }
 }