yaffs Added more tests to direct/timothy_tests/quick_tests
[yaffs2.git] / direct / timothy_tests / quick_tests / lib.c
index 1c3ca689381db7bf0fbb71379b1efb15f293e31d..bc004043d11b33b87006fbe941feac8e220ac166 100644 (file)
@@ -33,6 +33,38 @@ int get_exit_on_error(void)
        return EXIT_ON_ERROR;
 }
 
+
+int set_up_ELOOP(void){
+       int output1=1;
+       int output2=1;
+       int error =0;
+       
+       output1=yaffs_symlink(ELOOP_PATH,ELOOP2_PATH);
+       if (output1 <0){
+               error=yaffs_get_error();
+               if (abs(error)==EEXIST){
+                       output1= 1;
+               } else {
+                       output1=-1;
+               }
+       }
+       
+       output2=yaffs_symlink(ELOOP2_PATH,ELOOP_PATH);
+
+       if (output2 <0){
+               error=yaffs_get_error();
+               if (abs(error)==EEXIST){
+                       output2= 1;
+               } else {
+                       output2=-1;
+               }
+       }
+       
+
+       yaffs_set_error(0);     /*reset the last error to 0 */
+       return (output1|output2);
+}
+
 void join_paths(char *path1,char *path2,char *new_path )
 {