2 * YAFFS: Yet another FFS. A NAND-flash specific file system.
4 * Copyright (C) 2002-2018 Aleph One Ltd.
6 * Created by Timothy Manning <timothy@yaffs.net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include "thread_function.h"
17 int number_of_tests=2;
20 void * init(int threadId, const char *baseDir, int bovver_type)
22 struct bovver_context *bc = malloc(sizeof(struct bovver_context));
25 memset(bc,0,sizeof(*bc));
26 bc->threadId = threadId;
27 strncpy(bc->baseDir,baseDir,200);
28 bc->bovverType = bovver_type;
30 printf("bovver_init %d \"%s\"\n",threadId,baseDir);
37 void (*p_function)(void *); /*pointer to test function*/
38 /*char pass_message[50]; will not need a pass message*/
39 char *name_of_test; /*pointer to fail message, needs to include name of test*/
43 test_template test_list[]={
44 //{dummy_test,dummy_test_clean,"dummy_test"},
49 int thread_function(void *thread_id_ptr)
51 int thread_id = (int) thread_id_ptr;
54 printf("Starting thread %d, id %d\n", pthread_self(),thread_id);
55 void *x=init(thread_id,"/yaffs2/",0);
58 //set_counter(thread_id,y);
59 test_id=(rand()%(number_of_tests-1));
60 test_list[test_id].p_function(x);
61 //printf("thread: %d. ran test: %d\n",thread_id,y);
62 //printf("counter before %d\n",get_counter(thread_id));
63 set_counter(thread_id,y);
64 //printf("counter after setting %d\n",get_counter(thread_id));
66 //select random file name from a list.
67 //run a random function on the file.