summaryrefslogtreecommitdiff
path: root/direct
diff options
context:
space:
mode:
authorTimothy Manning <tfhmanning@gmail.com>2011-01-07 11:56:34 +1300
committerTimothy Manning <tfhmanning@gmail.com>2011-01-07 11:56:34 +1300
commitcaf4f0d199647715e398aa87ad4b35dd26413c92 (patch)
treec68f72b32c0b0ddc8cf37b2e8fd4a9bd5088f1cb /direct
parent5f61aa469fb4b46a5a1f4aacbe459323b5d13edd (diff)
yaffs Finsing up direct/timothy_tests/threading
Signed-off-by: Timothy Manning <tfhmanning@gmail.com>
Diffstat (limited to 'direct')
-rw-r--r--direct/timothy_tests/quick_tests/quick_tests.c6
-rw-r--r--direct/timothy_tests/threading/threading.c13
-rw-r--r--direct/timothy_tests/threading/threading.h2
3 files changed, 10 insertions, 11 deletions
diff --git a/direct/timothy_tests/quick_tests/quick_tests.c b/direct/timothy_tests/quick_tests/quick_tests.c
index f0fb021..b2864a0 100644
--- a/direct/timothy_tests/quick_tests/quick_tests.c
+++ b/direct/timothy_tests/quick_tests/quick_tests.c
@@ -151,14 +151,14 @@ void get_error(void)
void init_quick_tests(int argc, char *argv[])
{
int trace=0;
-int new_option;
+ int new_option;
int x=0;
do{
new_option=getopt_long(argc,argv,short_options,long_options,NULL);
- if (0==strcmp(argv[x],"-h")){
+ if (new_option=='h'){
printf("help\n");
printf("-h will print the commands available\n");
- printf("-c will continue after a test failes else the program will exit\n");
+ printf("-c will continue after a test fails else the program will exit\n");
printf("-v will print all messages\n");
printf("-q quiet mode only the number of tests passed and failed will be printed\n");
printf("-t [number] set yaffs_trace to number\n");
diff --git a/direct/timothy_tests/threading/threading.c b/direct/timothy_tests/threading/threading.c
index a9ed1bb..4b65e38 100644
--- a/direct/timothy_tests/threading/threading.c
+++ b/direct/timothy_tests/threading/threading.c
@@ -21,7 +21,7 @@ const struct option long_options[]={
{"threads", 1,NULL,'t'}
};
-const char short_options[]="hqn:t:cv";
+const char short_options[]="ht:";
@@ -31,16 +31,15 @@ void main_init(int argc, char *argv[])
int new_option;
int x=0;
int new_num_of_threads=5;
+ x=(unsigned)time(NULL);
+ printf("seeding srand with: %d\n",x);
+ srand(x);
do{
new_option=getopt_long(argc,argv,short_options,long_options,NULL);
- if (0==strcmp(argv[x],"-h")){
+ if (new_option=='h'){
printf("help\n");
printf("-h will print the commands available\n");
- printf("-c will continue after a test failes else the program will exit\n");
- printf("-v will print all messages\n");
- printf("-q quiet mode only the number of tests passed and failed will be printed\n");
- printf("-t [number] set yaffs_trace to number\n");
- printf("-n [number] sets the number of random loops to run after the the test has run\n");
+ printf("-t [number] sets the number of threads\n");
exit(0);
} else if (new_option=='t') {
new_num_of_threads=atoi(optarg);
diff --git a/direct/timothy_tests/threading/threading.h b/direct/timothy_tests/threading/threading.h
index 025bbd9..307a30c 100644
--- a/direct/timothy_tests/threading/threading.h
+++ b/direct/timothy_tests/threading/threading.h
@@ -15,7 +15,7 @@
#ifndef __threading_h__
#define __threading_h__
-
+#include <time.h>
#include <pthread.h>
#include <stdio.h>
#include "thread_function.h"