X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fhandle_tests%2Fhandle_test.c;fp=direct%2Ftimothy_tests%2Fhandle_tests%2Fhandle_test.c;h=0000000000000000000000000000000000000000;hp=4d6e33dd205c7f73ed546b90554079e2e304eb5e;hb=e5daa72b0083831ab762a650860687fe7d25d6b3;hpb=a78bce6f4a7042fa153ab32d2bb263ecf7d27b66 diff --git a/direct/timothy_tests/handle_tests/handle_test.c b/direct/timothy_tests/handle_tests/handle_test.c deleted file mode 100644 index 4d6e33d..0000000 --- a/direct/timothy_tests/handle_tests/handle_test.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * YAFFS: Yet another FFS. A NAND-flash specific file system. - * - * Copyright (C) 2002-2011 Aleph One Ltd. - * for Toby Churchill Ltd and Brightstar Engineering - * - * Created by Timothy Manning - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include "handle_test.h" - -int random_seed; -int simulate_power_failure = 0; - -int main() -{ - - int test_batch = 1000000; - int output =0; - unsigned int total_number_of_tests_run=0; - yaffs_start_up(); - yaffs_mount("yaffs2"); - - printf("running tests\n"); - - output=dup_test(); - printf("dup test: %d\n ",output); - - while (1){ - output = open_close_handle_test(test_batch); - if (output>=0){ - total_number_of_tests_run ++; - } else { - get_error(); - return -1; - } - printf("total number of tests = %d\n",(total_number_of_tests_run*test_batch)); - } - - - return 0; -} -int dup_test(void){ - int handle = -1; - int handle2 = -1; - int output =-1; - - handle =open_handle(); - if (handle<0){ - printf("error: failed to open handle\n"); - return -1; - } - handle2=yaffs_dup(handle); - if (handle2<0){ - printf("error: failed to open handle2\n"); - return -1; - } - - output=yaffs_lseek(handle,20,SEEK_SET); - if (output >= 0) { - output = yaffs_lseek(handle,0,SEEK_CUR); - if (output = 20){ - printf("dup is working\n"); - return 1; - } else if (output <0){ - printf("failed to lseek the second time\n"); - return -1; - } else { - printf("lseek position is diffrent than expected\n"); - return -1; - } - } else { - printf("failed to lseek the first time\n"); - return -1; - } - -} - -int open_close_handle_test(int num_of_tests) -{ - int handle_number=open_handle(); - int handle=0; - int x =0; - int output=0; - yaffs_close(handle_number); - for (x=0;x