From c9c5ee252a8523778377f2832765442e611e85a4 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 25 Aug 2011 10:18:02 +0200 Subject: Implement non-internal ivecs Vectors are now similar to our old, pre-internal vectors, except that they are uniquely owned, not refcounted. Their name should probably change too, then. I've renamed them to vec in the runtime, will do so throughout the compiler later. --- src/test/stdtest/vec.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/test/stdtest') diff --git a/src/test/stdtest/vec.rs b/src/test/stdtest/vec.rs index f5c4af42681..2f9e691b62d 100644 --- a/src/test/stdtest/vec.rs +++ b/src/test/stdtest/vec.rs @@ -18,21 +18,12 @@ fn square_if_odd(n: &uint) -> option::t { fn add(x: &uint, y: &uint) -> uint { ret x + y; } -#[test] -fn test_reserve_and_on_heap() { - let v: [int] = [1, 2]; - assert (!vec::on_heap(v)); - vec::reserve(v, 8u); - assert (vec::on_heap(v)); -} - #[test] fn test_unsafe_ptrs() { // Test on-stack copy-from-buf. let a = [1, 2, 3]; let ptr = vec::to_ptr(a); - let b = []; - vec::unsafe::copy_from_buf(b, ptr, 3u); + let b = vec::unsafe::from_buf(ptr, 3u); assert (vec::len(b) == 3u); assert (b[0] == 1); assert (b[1] == 2); @@ -41,8 +32,7 @@ fn test_unsafe_ptrs() { // Test on-heap copy-from-buf. let c = [1, 2, 3, 4, 5]; ptr = vec::to_ptr(c); - let d = []; - vec::unsafe::copy_from_buf(d, ptr, 5u); + let d = vec::unsafe::from_buf(ptr, 5u); assert (vec::len(d) == 5u); assert (d[0] == 1); assert (d[1] == 2); -- cgit 1.4.1-3-g733a5