2 * YAFFS: Yet another FFS. A NAND-flash specific file system.
4 * Copyright (C) 2002-2010 Aleph One Ltd.
5 * for Toby Churchill Ltd and Brightstar Engineering
7 * Created by Timothy Manning <timothy@yaffs.net>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include "quick_tests.h"
18 int simulate_power_failure = 0;
24 static unsigned int num_of_tests_pass=0;
25 static unsigned int num_of_tests_failed=0;
26 static unsigned int total_number_of_tests=(sizeof(test_list)/sizeof(test_template));
34 printf("\n\nrunning quick tests for yaffs\n\n");
35 //printf("testing yaffs\n");
37 //printf("len function %d",(sizeof(test_list)/sizeof(test_template)));
38 for (x=0;x<total_number_of_tests;x++){
40 yaffs_set_error(0); /*reset the last error to 0 */
41 output=test_list[x].p_function(); /*run test*/
47 /*test is assumed to have failed*/
48 //printf("test failed\n");
49 printf("test: %s failed\n",test_list[x].name_of_test);
50 num_of_tests_failed ++;
62 output=test_list[x].p_function_clean(); /*clean the test*/
64 /* if the test failed to clean it's self then */
65 printf("test: %s failed to clean\n",test_list[x].name_of_test);
66 num_of_tests_failed ++;
72 /*this is where the loop should break to*/
74 /* the progame should never get here*/
78 void quit_quick_tests(int exit_code){
80 if (num_of_tests_pass==total_number_of_tests && num_of_tests_failed==0){
83 printf("tests: %d passed %d failed\n\n\n",num_of_tests_pass,num_of_tests_failed);
84 yaffs_unmount(YAFFS_MOUNT_POINT);
90 error_code=yaffs_get_error();
91 printf("yaffs_error code %d\n",error_code);
92 printf("error is : %s\n",yaffs_error_to_str(error_code));
95 void init_quick_tests(void){