about summary refs log tree commit diff
path: root/src/test/stdtest
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-08-25 10:18:02 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2011-08-29 09:07:53 +0200
commitc9c5ee252a8523778377f2832765442e611e85a4 (patch)
tree85c0837af34b2431fc17da0a166254144aaa99c7 /src/test/stdtest
parent855e0a471365c7c61a139e2437215028bd231af5 (diff)
downloadrust-c9c5ee252a8523778377f2832765442e611e85a4.tar.gz
rust-c9c5ee252a8523778377f2832765442e611e85a4.zip
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.
Diffstat (limited to 'src/test/stdtest')
-rw-r--r--src/test/stdtest/vec.rs14
1 files changed, 2 insertions, 12 deletions
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
@@ -19,20 +19,11 @@ fn square_if_odd(n: &uint) -> option::t<uint> {
 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);