about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSimon BD <simon@server>2012-10-24 19:17:24 -0500
committerSimon BD <simon@server>2012-10-24 19:17:24 -0500
commit19a59cb748b6715cd940eb6fa5ae4e1841dcfcf4 (patch)
tree7918d33eb7071c8920a0f3b6eb9ed6dfddad68fb /src
parentfb61f915db842ec06e6531237f5c73112dd1c7a0 (diff)
downloadrust-19a59cb748b6715cd940eb6fa5ae4e1841dcfcf4.tar.gz
rust-19a59cb748b6715cd940eb6fa5ae4e1841dcfcf4.zip
Fix tests for Copy bound
Diffstat (limited to 'src')
-rw-r--r--src/libstd/sort.rs54
1 files changed, 9 insertions, 45 deletions
diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs
index 24086057393..161d7fab81d 100644
--- a/src/libstd/sort.rs
+++ b/src/libstd/sort.rs
@@ -1032,11 +1032,6 @@ mod big_tests {
         tabulate_managed(low, high);
     }
 
-    #[test]
-    fn test_linear() {
-        tabulate_linear();
-    }
-
     fn multiplyVec<T: Copy>(arr: &[const T], num: uint) -> ~[mut T] {
         let size = arr.len();
         let res = do vec::from_fn(num) |i| {
@@ -1125,12 +1120,11 @@ mod big_tests {
     }
 
     fn tabulate_managed(lo: uint, hi: uint) {
-        fn isSorted<T: Ord>(arr: &[const @T], expected_refcount: uint) {
+        fn isSorted<T: Ord>(arr: &[const @T]) {
             for uint::range(0, arr.len()-1) |i| {
                 if arr[i] > arr[i+1] {
                     fail ~"Array not sorted";
                 }
-                assert sys::refcount(arr[i]) == expected_refcount;
             }
         }
 
@@ -1144,14 +1138,14 @@ mod big_tests {
             let arr = vec::to_mut(move arr);
 
             tim_sort(arr); // *sort
-            isSorted(arr, 1);
+            isSorted(arr);
 
             vec::reverse(arr);
             tim_sort(arr); // \sort
-            isSorted(arr, 1);
+            isSorted(arr);
 
             tim_sort(arr); // /sort
-            isSorted(arr, 1);
+            isSorted(arr);
 
             for 3.times {
                 let i1 = rng.gen_uint_range(0, n);
@@ -1159,7 +1153,7 @@ mod big_tests {
                 arr[i1] <-> arr[i2];
             }
             tim_sort(arr); // 3sort
-            isSorted(arr, 1);
+            isSorted(arr);
 
             if n >= 10 {
                 let size = arr.len();
@@ -1170,7 +1164,7 @@ mod big_tests {
                 }
             }
             tim_sort(arr); // +sort
-            isSorted(arr, 1);
+            isSorted(arr);
 
             for (n/100).times {
                 let idx = rng.gen_uint_range(0, n);
@@ -1184,16 +1178,16 @@ mod big_tests {
                 multiplyVec(part, n)
             } else { move arr };
             tim_sort(arr); // ~sort
-            isSorted(arr, n/4+1);
+            isSorted(arr);
 
             let mut arr = vec::from_elem(n, @(-0.5));
             tim_sort(arr); // =sort
-            isSorted(arr, n);
+            isSorted(arr);
 
             let half = n / 2;
             let mut arr = makeRange(half).map(|i| @(*i as float));
             tim_sort(arr); // !sort
-            isSorted(arr, 1);
+            isSorted(arr);
         }
     }
 
@@ -1220,36 +1214,6 @@ mod big_tests {
         pure fn gt(other: &LVal) -> bool { self.val > other.val }
         pure fn ge(other: &LVal) -> bool { self.val >= other.val }
     }
-
-    fn tabulate_linear() {
-        fn key(_x: @uint) { }
-        fn isSorted<T: Ord>(arr: &[const T]) {
-            for uint::range(0, arr.len()-1) |i| {
-                if arr[i] > arr[i+1] {
-                    fail ~"Array not sorted";
-                }
-            }
-        }
-
-        let n = 1000;
-        unsafe {
-            task::local_data::local_data_set(key, @0u);
-        }
-
-        {
-            let mut arr = do vec::from_fn(n) |i| {
-                LVal { val: i, key: key }
-            };
-            tim_sort(arr);
-            isSorted(arr);
-        }
-
-        let @dropped = unsafe {
-            task::local_data::local_data_get(key).get()
-        };
-
-        assert n == dropped;
-    }
 }
 
 // Local Variables: