diff options
author | Zed <zestyr@users.noreply.github.com> | 2019-05-28 15:23:09 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-05-28 15:23:09 +0200 |
commit | 1f8c9aff1f8de7294c5326c7e986779ab27f0239 (patch) | |
tree | 3563f32d77032f82f00cf2dd04917dc5c1cb1526 /tests/threads | |
parent | 379916c737e66ba0f6b8b416ac4cee0239d883c6 (diff) | |
download | Nim-1f8c9aff1f8de7294c5326c7e986779ab27f0239.tar.gz |
Fix and reenable thread tests (#11343)
Diffstat (limited to 'tests/threads')
-rw-r--r-- | tests/threads/tthreadanalysis.nim | 6 | ||||
-rw-r--r-- | tests/threads/ttryrecv.nim | 7 |
2 files changed, 5 insertions, 8 deletions
diff --git a/tests/threads/tthreadanalysis.nim b/tests/threads/tthreadanalysis.nim index 8aacc71d1..7fc3593c8 100644 --- a/tests/threads/tthreadanalysis.nim +++ b/tests/threads/tthreadanalysis.nim @@ -1,8 +1,6 @@ discard """ - disabled: yes - outputsub: "101" errormsg: "'threadFunc' is not GC-safe" - line: 39 + line: 38 cmd: "nim $target --hints:on --threads:on $options $file" """ @@ -15,7 +13,7 @@ proc doNothing() = discard type PNode = ref TNode - TNode = object {.pure.} + TNode {.pure.} = object le, ri: PNode data: string diff --git a/tests/threads/ttryrecv.nim b/tests/threads/ttryrecv.nim index 5ef1a3c10..87dec6e79 100644 --- a/tests/threads/ttryrecv.nim +++ b/tests/threads/ttryrecv.nim @@ -1,18 +1,17 @@ discard """ - disabled: yes outputsub: "channel is empty" """ # bug #1816 -from random import random +from random import rand from os import sleep type PComm = ptr Channel[int] proc doAction(outC: PComm) {.thread.} = - for i in 0.. <5: - sleep(random(100)) + for i in 0 ..< 5: + sleep(rand(100)) send(outC[], i) var |