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");
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].fail_message);
50 num_of_tests_failed ++;
54 output=test_list[x].p_function_clean(); /*clean the test*/
56 /* if the test failed to clean it's self then */
57 printf("test: %s failed to clean\n",test_list[x].fail_message);
58 num_of_tests_failed ++;
64 /*this is where the loop should break to*/
66 /* the progame should never get here*/
70 void quit_quick_tests(int exit_code){
72 if (num_of_tests_pass==total_number_of_tests && num_of_tests_failed==0){
76 error_code=yaffs_get_error();
77 printf("yaffs_error code %d\n",error_code);
78 printf("error is : %s\n",yaffs_error_to_str(error_code));
80 printf("tests: %d passed %d failed\n\n\n",num_of_tests_pass,num_of_tests_failed);
81 yaffs_unmount(YAFFS_MOUNT_POINT);
85 void init_quick_tests(void){