+void get_error(void)
+{
+ int error_code=0;
+ char message[30];
+ message[0]='\0';
+
+ error_code=yaffs_get_error();
+ sprintf(message,"yaffs_error code %d\n",error_code);
+ print_message(message,1);
+ sprintf(message,"error is : %s\n",yaffs_error_to_str(error_code));
+ print_message(message,1);
+}
+
+void init_quick_tests(int argc, char *argv[])
+{
+ int trace=0;
+ int new_option;
+ int x=0;
+ do{
+ new_option=getopt_long(argc,argv,short_options,long_options,NULL);
+ if (new_option=='h'){
+ printf("help\n");
+ printf("-h will print the commands available\n");
+ printf("-c will continue after a test fails else the program will exit\n");
+ printf("-v will print all messages\n");
+ printf("-q quiet mode only the number of tests passed and failed will be printed\n");
+ printf("-t [number] set yaffs_trace to number\n");
+ printf("-n [number] sets the number of random loops to run after the the test has run\n");
+ exit(0);
+ } else if (new_option=='c') {
+ set_exit_on_error(0);
+ } else if (new_option=='q') {
+ set_print_level(-3);
+ } else if (new_option=='t') {
+ trace = atoi(optarg);
+ } else if (new_option=='v') {
+ set_print_level(5);
+ } else if (new_option=='n') {
+ number_of_random_tests=atoi(optarg);
+ }
+
+ }while (new_option!=-1);
+ yaffs_start_up();
+ yaffs_set_trace(trace);