diff options
author | Araq <rumpf_a@web.de> | 2016-12-19 11:35:45 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2016-12-19 11:35:45 +0100 |
commit | 237252f90cbea354ee7104388b174f0ed899803c (patch) | |
tree | 498e985bb160e21c79f5c7c84975e2e6b1cc819b /tests | |
parent | 24239c23619e9d64562699b5d890fa2575e9c9cb (diff) | |
parent | c130a2af17e0d5e948d21e6cb5bd0aca02ddb977 (diff) | |
download | Nim-237252f90cbea354ee7104388b174f0ed899803c.tar.gz |
Merge branch 'devel' into sighashes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/errmsgs/tdont_show_system.nim | 13 | ||||
-rw-r--r-- | tests/errmsgs/tproper_stacktrace.nim | 11 | ||||
-rw-r--r-- | tests/misc/tnot.nim | 4 | ||||
-rw-r--r-- | tests/system/tdeepcopy.nim | 1 | ||||
-rw-r--r-- | tests/system/trealloc.nim | 21 |
5 files changed, 47 insertions, 3 deletions
diff --git a/tests/errmsgs/tdont_show_system.nim b/tests/errmsgs/tdont_show_system.nim new file mode 100644 index 000000000..6963a8a3f --- /dev/null +++ b/tests/errmsgs/tdont_show_system.nim @@ -0,0 +1,13 @@ +discard """ + errormsg: "value of type 'bool' has to be discarded" + line: 13 + file: "tdont_show_system.nim" +""" + +# bug #4308 + +#proc getGameTile: int = +# 1 > 0 + +# bug #4905 subsumes the problem of #4308: +true notin {false} diff --git a/tests/errmsgs/tproper_stacktrace.nim b/tests/errmsgs/tproper_stacktrace.nim new file mode 100644 index 000000000..57e65fa6f --- /dev/null +++ b/tests/errmsgs/tproper_stacktrace.nim @@ -0,0 +1,11 @@ +discard """ + outputsub: '''tproper_stacktrace.nim(7) tproper_stacktrace''' + exitcode: 1 +""" + +template fuzzy(x) = + echo x[] != 9 + +var p: ptr int +fuzzy p + diff --git a/tests/misc/tnot.nim b/tests/misc/tnot.nim index 8c75c6bc0..5c268981e 100644 --- a/tests/misc/tnot.nim +++ b/tests/misc/tnot.nim @@ -1,6 +1,6 @@ discard """ - tfile: "tnot.nim" - tline: 14 + file: "tnot.nim" + line: 14 errormsg: "type mismatch" """ # BUG: following compiles, but should not: diff --git a/tests/system/tdeepcopy.nim b/tests/system/tdeepcopy.nim index 5a582425a..f7a6e87fa 100644 --- a/tests/system/tdeepcopy.nim +++ b/tests/system/tdeepcopy.nim @@ -1,6 +1,5 @@ discard """ output: "ok" - disabled: "true" """ import tables, lists diff --git a/tests/system/trealloc.nim b/tests/system/trealloc.nim new file mode 100644 index 000000000..dc5f712d6 --- /dev/null +++ b/tests/system/trealloc.nim @@ -0,0 +1,21 @@ +discard """ + output: '''success''' +""" + +# bug #4818 + +# Test that this completes without OOM. + +const BUFFER_SIZE = 5000 +var buffer = cast[ptr uint16](alloc(BUFFER_SIZE)) + +var total_size: int64 = 0 +for i in 0 .. 4000: + let size = BUFFER_SIZE * i + #echo "requesting ", size + total_size += size.int64 + buffer = cast[ptr uint16](realloc(buffer, size)) + #echo totalSize, " total: ", getTotalMem(), " occupied: ", getOccupiedMem(), " free: ", getFreeMem() + +dealloc(buffer) +echo "success" |