diff options
author | EXetoC <exetoc@gmail.com> | 2014-03-07 00:36:58 +0100 |
---|---|---|
committer | EXetoC <exetoc@gmail.com> | 2014-03-07 00:36:58 +0100 |
commit | 61e5435081069792dd027a1f127cba836af1ed20 (patch) | |
tree | f216c4111a45fbd25355757b36252a7094cb07d3 /tests/system/alloc.nim | |
parent | 5e78baa061f36900b28018b6b0c47e4f45dc92cf (diff) | |
download | Nim-61e5435081069792dd027a1f127cba836af1ed20.tar.gz |
Update unit test.
Diffstat (limited to 'tests/system/alloc.nim')
-rw-r--r-- | tests/system/alloc.nim | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/system/alloc.nim b/tests/system/alloc.nim index 3a10a1a39..f8e14ac04 100644 --- a/tests/system/alloc.nim +++ b/tests/system/alloc.nim @@ -3,11 +3,11 @@ var x: ptr int x = cast[ptr int](alloc(7)) assert x != nil -x = alloc(int, 3) +x = create(int, 3) assert x != nil x.dealloc() -x = alloc0(int, 4) +x = create0(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 @@ -18,28 +18,28 @@ assert x != nil x = x.resize(4) assert x != nil -x.dealloc() +x.free() x = cast[ptr int](allocShared(100)) assert x != nil deallocShared(x) -x = allocShared(int, 3) +x = createShared(int, 3) assert x != nil -x.deallocShared() +x.freeShared() -x = allocShared0(int, 3) +x = createShared0(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 -x = cast[ptr int](reallocShared(x, 2)) +x = cast[ptr int](x.resizeShared(2)) assert x != nil -x = resize(x, 12) +x = x.resize(12) assert x != nil -x = resizeShared(x, 1) +x = x.resizeShared(1) assert x != nil -x.deallocShared() +x.freeShared() |