2 * YAFFS: Yet another FFS. A NAND-flash specific file system.
4 * Copyright (C) 2002-2011 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 "thread_function.h"
18 int number_of_tests=2;
21 void * init(int threadId, const char *baseDir, int bovver_type)
23 struct bovver_context *bc = malloc(sizeof(struct bovver_context));
26 memset(bc,0,sizeof(*bc));
27 bc->threadId = threadId;
28 strncpy(bc->baseDir,baseDir,200);
29 bc->bovverType = bovver_type;
31 printf("bovver_init %d \"%s\"\n",threadId,baseDir);
38 void (*p_function)(void *); /*pointer to test function*/
39 /*char pass_message[50]; will not need a pass message*/
40 char *name_of_test; /*pointer to fail message, needs to include name of test*/
44 test_template test_list[]={
45 //{dummy_test,dummy_test_clean,"dummy_test"},
50 int thread_function(void *thread_id_ptr)
52 int thread_id = (int) thread_id_ptr;
55 printf("Starting thread %d, id %d\n", pthread_self(),thread_id);
56 void *x=init(thread_id,"/yaffs2/",0);
59 //set_counter(thread_id,y);
60 test_id=(rand()%(number_of_tests-1));
61 test_list[test_id].p_function(x);
62 //printf("thread: %d. ran test: %d\n",thread_id,y);
63 //printf("counter before %d\n",get_counter(thread_id));
64 set_counter(thread_id,y);
65 //printf("counter after setting %d\n",get_counter(thread_id));
67 //select random file name from a list.
68 //run a random function on the file.