Merge branch 'devel' into sighashes

This commit is contained in:
Araq 2016-12-19 11:35:45 +01:00
commit 237252f90c
14 changed files with 115 additions and 25 deletions

View file

@ -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}

View file

@ -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

View file

@ -1,6 +1,6 @@
discard """
tfile: "tnot.nim"
tline: 14
file: "tnot.nim"
line: 14
errormsg: "type mismatch"
"""
# BUG: following compiles, but should not:

View file

@ -1,6 +1,5 @@
discard """
output: "ok"
disabled: "true"
"""
import tables, lists

21
tests/system/trealloc.nim Normal file
View file

@ -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"