Fix unmatched temporary buffer allocations
[yaffs2.git] / direct / test-framework / timothy_tests / stress_tester / yaffs_tester.h
1 /*
2  * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
3  *
4  * Copyright (C) 2002-2018 Aleph One Ltd.
5  *
6  * Created by Timothy Manning <timothy@yaffs.net>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License version 2.1 as
10  * published by the Free Software Foundation.
11  *
12  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
13  */
14
15 #ifndef __YAFFS_TESTER_H__
16         #define __YAFFS_TESTER_H__
17
18 #include <string.h>
19 #include <stdio.h>
20 #include <time.h>
21 #include <stdlib.h>
22
23 #include "yaffsfs.h"    /* it is in "yaffs2/direct/" link it in the Makefile */
24 #include "message_buffer.h"
25 #include "error_handler.h"
26         
27 #define MAX_NUMBER_OF_OPENED_HANDLES 70
28 #define MAX_FILE_NAME_SIZE 51
29
30 typedef struct handle_regster_template{
31         int handle[MAX_NUMBER_OF_OPENED_HANDLES];
32         char path[MAX_NUMBER_OF_OPENED_HANDLES][100];
33         int number_of_open_handles;
34 }handle_regster;
35
36
37 void init(char *yaffs_test_dir,char *yaffs_mount_dir,int argc, char *argv[]);   /*sets up yaffs and mounts yaffs */
38 void test(char *yaffs_test_dir);                                /*contains the test code*/
39 void generate_random_string(char *ptr,int length_of_str);                               /*generates a random string of letters to be used for a name*/
40 void join_paths(char *path1,char *path2,char *newpath );
41 void copy_array(char *from,char *to, unsigned int from_offset,unsigned int to_offset);
42 void stat_file(char *path);
43 void write_to_random_file(handle_regster *P_open_handles_array);
44 void close_random_file(handle_regster *P_open_handles_array);
45 void quit_program();
46 void truncate_random_file(handle_regster *P_open_handles_array);
47 #endif