summary refs log tree commit diff stats
path: root/tests/system
diff options
context:
space:
mode:
authorEXetoC <exetoc@gmail.com>2014-03-07 01:09:16 +0100
committerEXetoC <exetoc@gmail.com>2014-03-07 01:09:16 +0100
commitc7b83d2c44626cd90d0d83ed2684c120e1490283 (patch)
tree83867b72603ad84eb9ff0ccb8a881645284f74e9 /tests/system
parent5b7e44f0aaab8e47e11de029924439175f4ad0bd (diff)
downloadNim-c7b83d2c44626cd90d0d83ed2684c120e1490283.tar.gz
Update unit test.
Diffstat (limited to 'tests/system')
-rw-r--r--tests/system/alloc.nim23
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/system/alloc.nim b/tests/system/alloc.nim
index f8e14ac04..7abefec2a 100644
--- a/tests/system/alloc.nim
+++ b/tests/system/alloc.nim
@@ -2,20 +2,20 @@ var x: ptr int
 
 x = cast[ptr int](alloc(7))
 assert x != nil
-
-x = create(int, 3)
+x = cast[ptr int](x.realloc(2))
 assert x != nil
 x.dealloc()
 
-x = create0(int, 4)
+x = createU(int, 3)
+assert x != nil
+x.free()
+
+x = create(int, 4)
 assert cast[ptr array[4, int]](x)[0] == 0
 assert cast[ptr array[4, int]](x)[1] == 0
 assert cast[ptr array[4, int]](x)[2] == 0
 assert cast[ptr array[4, int]](x)[3] == 0
 
-x = cast[ptr int](x.realloc(2))
-assert x != nil
-
 x = x.resize(4)
 assert x != nil
 x.free()
@@ -24,22 +24,29 @@ x = cast[ptr int](allocShared(100))
 assert x != nil
 deallocShared(x)
 
-x = createShared(int, 3)
+x = createSharedU(int, 3)
 assert x != nil
 x.freeShared()
 
-x = createShared0(int, 3)
+x = createShared(int, 3)
 assert x != nil
 assert cast[ptr array[3, int]](x)[0] == 0
 assert cast[ptr array[3, int]](x)[1] == 0
 assert cast[ptr array[3, int]](x)[2] == 0
 
+assert x != nil
 x = cast[ptr int](x.resizeShared(2))
 assert x != nil
+x.freeShared()
 
+x = create(int, 10)
+assert x != nil
 x = x.resize(12)
 assert x != nil
+x.dealloc()
 
+x = createShared(int, 1)
+assert x != nil
 x = x.resizeShared(1)
 assert x != nil
 x.freeShared()