X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=direct%2Ftest-framework%2Fstress_tests%2Fstress_tester%2Fyaffs_tester.h;fp=direct%2Ftest-framework%2Fstress_tests%2Fstress_tester%2Fyaffs_tester.h;h=2597be5b5f372c49457cf263104c8a9696ea6744;hb=a51c8b53c1d11f7c4690243c9685a9b337f51127;hp=0000000000000000000000000000000000000000;hpb=566822213e306533d20b3ca38fcadd0d3d8a633f;p=yaffs2.git diff --git a/direct/test-framework/stress_tests/stress_tester/yaffs_tester.h b/direct/test-framework/stress_tests/stress_tester/yaffs_tester.h new file mode 100644 index 0000000..2597be5 --- /dev/null +++ b/direct/test-framework/stress_tests/stress_tester/yaffs_tester.h @@ -0,0 +1,47 @@ +/* + * YAFFS: Yet another Flash File System . A NAND-flash specific file system. + * + * Copyright (C) 2002-2018 Aleph One Ltd. + * + * Created by Timothy Manning + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. + */ + +#ifndef __YAFFS_TESTER_H__ + #define __YAFFS_TESTER_H__ + +#include +#include +#include +#include + +#include "yaffsfs.h" /* it is in "yaffs2/direct/" link it in the Makefile */ +#include "message_buffer.h" +#include "error_handler.h" + +#define MAX_NUMBER_OF_OPENED_HANDLES 70 +#define MAX_FILE_NAME_SIZE 51 + +typedef struct handle_regster_template{ + int handle[MAX_NUMBER_OF_OPENED_HANDLES]; + char path[MAX_NUMBER_OF_OPENED_HANDLES][100]; + int number_of_open_handles; +}handle_regster; + + +void init(char *yaffs_test_dir,char *yaffs_mount_dir,int argc, char *argv[]); /*sets up yaffs and mounts yaffs */ +void test(char *yaffs_test_dir); /*contains the test code*/ +void generate_random_string(char *ptr,int length_of_str); /*generates a random string of letters to be used for a name*/ +void join_paths(char *path1,char *path2,char *newpath ); +void copy_array(char *from,char *to, unsigned int from_offset,unsigned int to_offset); +void stat_file(char *path); +void write_to_random_file(handle_regster *P_open_handles_array); +void close_random_file(handle_regster *P_open_handles_array); + +void truncate_random_file(handle_regster *P_open_handles_array); +#endif