diff --git a/src/testsuite.in b/src/testsuite.in index 0d68b10583e43cc95fa0788e5bf431ca0adcdf8b..8b788964a64bc127225ff58a6b6e8356f1ecda2f 100644 --- a/src/testsuite.in +++ b/src/testsuite.in @@ -1,4 +1,4 @@ -test_true([["$Id: testsuite.in,v 1.51 1997/09/09 03:36:13 hubbe Exp $"]]) +test_true([["$Id: testsuite.in,v 1.52 1997/09/10 01:24:36 hubbe Exp $"]]) test_eq(1e1,10.0) test_eq(1E1,10.0) test_eq(1e+1,10.0) @@ -163,7 +163,13 @@ cond([[all_constants()->thread_create]], test_do(add_constant("_tmp_mutex")) test_any([[ object m = Thread.Mutex(); object k = m->lock(); thread_create(lambda(object k){ sleep(10); }, k);if (catch{m->lock(); return 0;}) { return 1; } return 0; ]],1) test_any([[ mixed *data=({0,Thread.Mutex(),Thread.Mutex(),0}); data[3]=data[2]->lock(); thread_create(lambda(mixed *data) {object o=data[1]->lock(); destruct(data[3]); sleep(10); data[0]=1; destruct(o); },data); object l=data[2]->lock(1); object ll=data[1]->lock(); return data[0]; ]],1) - test_any([[mixed *data=({1, Thread.Mutex()}); for(int e=0;e<3;e++) thread_create(lambda(mixed *data) { for(int e=0;e<1000;e++) { object o=data[1]->lock(); data[0]*=2; for(int d=0;d<5;d++) { data[0]--; data[0]*=2; } data[0]--; destruct(o); }}, data); return data[0];]],1) + test_any([[ +mixed *data=({1, Thread.Mutex(), Thread.Condition(), 0}); +for(int e=0;e<3;e++) { data[3]++; thread_create(lambda(mixed *data) { + for(int e=0;e<1000;e++) { object o=data[1]->lock(); data[0]*=2; + for(int d=0;d<5;d++) { data[0]--; data[0]*=2; } data[0]--; destruct(o); } + data[3]--; data[2]->signal();}, data);} + while(data[3]) data[2]->wait(); return data[0];]],1) // /precompiled/condition test_true(Thread.Condition())