mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-07 11:34:00 -04:00
fix inaccuracy in 760 unit regression test
This commit is contained in:
parent
533109541b
commit
ecf9a359e2
1 changed files with 4 additions and 2 deletions
|
@ -74,6 +74,7 @@ test('#760 - broadcastAndWait', t => {
|
|||
// does not yield once all threads are done
|
||||
th.status = Thread.STATUS_RUNNING;
|
||||
rt.threads[1].status = Thread.STATUS_DONE;
|
||||
rt.threads.splice(1, 1);
|
||||
e.broadcastAndWait({BROADCAST_OPTION: {id: 'testBroadcastID', name: 'message'}}, util);
|
||||
t.strictEqual(th.status, Thread.STATUS_RUNNING);
|
||||
|
||||
|
@ -82,7 +83,7 @@ test('#760 - broadcastAndWait', t => {
|
|||
util.thread = th;
|
||||
e.broadcastAndWait({BROADCAST_OPTION: {id: 'testBroadcastID', name: 'message'}}, util);
|
||||
t.strictEqual(rt.threads.length, 3);
|
||||
t.strictEqual(rt.threads[1].status, Thread.STATUS_RUNNING);
|
||||
t.strictEqual(rt.threads[2].status, Thread.STATUS_RUNNING);
|
||||
t.strictEqual(th.status, Thread.STATUS_YIELD);
|
||||
// yields when some restarted thread is active
|
||||
th.status = Thread.STATUS_RUNNING;
|
||||
|
@ -90,7 +91,8 @@ test('#760 - broadcastAndWait', t => {
|
|||
t.strictEqual(th.status, Thread.STATUS_YIELD);
|
||||
// does not yield once all threads are done
|
||||
th.status = Thread.STATUS_RUNNING;
|
||||
rt.threads[1].status = Thread.STATUS_DONE;
|
||||
rt.threads[2].status = Thread.STATUS_DONE;
|
||||
rt.threads.splice(2, 1);
|
||||
e.broadcastAndWait({BROADCAST_OPTION: {id: 'testBroadcastID', name: 'message'}}, util);
|
||||
t.strictEqual(th.status, Thread.STATUS_RUNNING);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue