X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fquick_tests%2Flib.c;h=e29764565337d63412b29e24768985b74c8930d8;hp=1c3ca689381db7bf0fbb71379b1efb15f293e31d;hb=dd93a8090e78af3a429a55349cb05a4bf6fb2c39;hpb=aed1065488d0c27e1654091636e4cfe5fb8e6951 diff --git a/direct/timothy_tests/quick_tests/lib.c b/direct/timothy_tests/quick_tests/lib.c index 1c3ca68..e297645 100644 --- a/direct/timothy_tests/quick_tests/lib.c +++ b/direct/timothy_tests/quick_tests/lib.c @@ -33,6 +33,61 @@ int get_exit_on_error(void) return EXIT_ON_ERROR; } + +int EROFS_setup(void) +{ + int output= -1; + output=yaffs_remount(YAFFS_MOUNT_POINT,1,1); + if (output<0){ + print_message("failed to remount yaffs\n",2); + return -1; + } + return 1; +} + +int EROFS_clean(void) +{ + int output=-1; + output= yaffs_remount(YAFFS_MOUNT_POINT,1,0); + if (output<0){ + print_message("failed to remount yaffs\n",2); + return -1; + } + return 1; +} + + +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 ) {