X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fmirror_tests%2Fmirror_tests.c;fp=direct%2Ftimothy_tests%2Fmirror_tests%2Fmirror_tests.c;h=aa9cd5bbf36be46ab30e761172a6ed56c611a25a;hb=05f5305b2d17b0e2889338724b864cf80f309437;hp=8c7574e4a2269267c43fe03ed7b02adb7d86d410;hpb=1fff83304b27b26ff765c6ffef9d6f354eada46d;p=yaffs2.git diff --git a/direct/timothy_tests/mirror_tests/mirror_tests.c b/direct/timothy_tests/mirror_tests/mirror_tests.c index 8c7574e..aa9cd5b 100644 --- a/direct/timothy_tests/mirror_tests/mirror_tests.c +++ b/direct/timothy_tests/mirror_tests/mirror_tests.c @@ -48,11 +48,26 @@ test_temp linux_tests={ } }; +const struct option long_options[]={ + {"help", 0,NULL,'h'}, + {"yaffs_path", 1,NULL,'y'}, + {"linux_path", 1,NULL,'l'}, + {"print_level", 1,NULL,'p'}, + {"quiet", 0,NULL,'q'}, + {"number", 1,NULL,'n'}, + {"seed", 1,NULL,'s'}, + {"trace", 1,NULL,'t'}, + {"clean", 0,NULL,'c'}, + {"verbose", 0,NULL,'v'} +}; + +const char short_options[]="hy:l:p:qn:s:t:cv"; + int main(int argc, char *argv[]) { char message[100]; - int x; + // yaffs_tests.num_of_tests=(sizeof(yaffs_tests)/sizeof(test_temp)); // linux_tests.num_of_tests=(sizeof(linux_tests)/sizeof(test_temp)); @@ -79,6 +94,7 @@ void init(int argc, char *argv[]) dir[0]='\0'; int x=-1; char message[100]; + int new_option; x=(unsigned)time(NULL); sprintf(message,"seeding srand with: %d\n",x); @@ -98,8 +114,9 @@ void init(int argc, char *argv[]) strcpy(yaffs_struct.root_path,"yaffs2/test/"); - for (x=0;xd_name); - sprintf(message,"unlinking file %d\n",linux_current_file->d_name); + sprintf(message,"unlinking file %s\n",file); print_message(3,message); - unlink(file); + print_message(3,"chmoding file\n"); + output=chmod(file,(S_IRUSR|S_IWUSR)); + if (output<0) { + get_error_linux(); + } + print_message(3,"unlinking file\n"); + output=unlink(file); + if (output<0) { + get_error_linux(); + } } - } + } while(linux_current_file); closedir(linux_open_dir); rmdir(linux_struct.root_path); }