Signed-off-by: Gilles Carry <[EMAIL PROTECTED]>
Cc: Darren Hart <[EMAIL PROTECTED]>
Cc: Tim Chavez <[EMAIL PROTECTED]>
---
testcases/realtime/func/thread_clock/tc-2.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/testcases/realtime/func/thread_clock/tc-2.c
b/testcases/realtime/func/thread_clock/tc-2.c
index 936413d..6bcaf00 100644
--- a/testcases/realtime/func/thread_clock/tc-2.c
+++ b/testcases/realtime/func/thread_clock/tc-2.c
@@ -60,12 +60,14 @@
struct timespec sleepts[NUMSLEEP];
struct timespec workts[NUMWORK];
static int run_jvmsim=0;
+static double threshold = THRESHOLD;
void usage(void)
{
rt_help();
printf("thread_clock specific options:\n");
printf(" -j enable jvmsim\n");
+ printf(" -t failure threshold in secs (defaults to %f)\n",
threshold);
}
int parse_args(int c, char *v)
@@ -75,6 +77,9 @@ int parse_args(int c, char *v)
case 'j':
run_jvmsim = 1;
break;
+ case 't':
+ threshold = atof(v);
+ break;
case 'h':
usage();
exit(0);
@@ -166,10 +171,10 @@ int checkresult(float proctime)
printf("Threads: %.4f s\n", threadstime);
printf("Delta: %.4f s\n", diff);
/* Difference between the sum of thread times and process time
- * should not be more than THRESHOLD */
- printf("\nCriteria: Delta < %.4f s\n", THRESHOLD);
+ * should not be more than threshold */
+ printf("\nCriteria: Delta < %.4f s\n", threshold);
printf("Result: ");
- if (diff > THRESHOLD) {
+ if (diff > threshold) {
printf("FAIL\n");
retval = 1;
}
@@ -185,7 +190,7 @@ int main(int argc,char* argv[])
struct timespec myts;
setup();
- rt_init("jh",parse_args,argc,argv);
+ rt_init("jht:",parse_args,argc,argv);
if (run_jvmsim) {
printf("jvmsim enabled\n");
--
1.5.4.3.450.gb92176
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list