Skip to content
Snippets Groups Projects
Commit 5b83808f authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

test 120 fixed

Rev: src/testsuite.in:1.52
parent 6031f498
No related branches found
No related tags found
No related merge requests found
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())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment