Skip to content

Commit 8e86cd0

Browse files
olsonjefferybrson
authored andcommitted
test: bunch of test cleanup from sendable_futures change
1 parent 12439b0 commit 8e86cd0

7 files changed

+19
-12
lines changed

src/test/bench/msgsend-ring-mutex-arcs.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,16 @@ fn main(args: ~[~str]) {
8282
let num_chan2 = ~mut None;
8383
*num_chan2 <-> num_chan;
8484
let num_port = ~mut Some(num_port);
85-
futures += ~[future::spawn(|move num_chan2, move num_port| {
85+
let new_future = future::spawn(|move num_chan2, move num_port| {
8686
let mut num_chan = None;
8787
num_chan <-> *num_chan2;
8888
let mut num_port1 = None;
8989
num_port1 <-> *num_port;
9090
thread_ring(i, msg_per_task,
9191
option::unwrap(num_chan),
9292
option::unwrap(num_port1))
93-
})];
93+
});
94+
vec::push(futures, new_future);
9495
num_chan = Some(new_chan);
9596
};
9697

src/test/bench/msgsend-ring-pipes.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,17 @@ fn main(args: ~[~str]) {
7878
let num_chan2 = ~mut None;
7979
*num_chan2 <-> num_chan;
8080
let num_port = ~mut Some(num_port);
81-
futures += ~[future::spawn(|move num_chan2, move num_port| {
81+
let new_future = do future::spawn
82+
|move num_chan2, move num_port| {
8283
let mut num_chan = None;
8384
num_chan <-> *num_chan2;
8485
let mut num_port1 = None;
8586
num_port1 <-> *num_port;
8687
thread_ring(i, msg_per_task,
8788
option::unwrap(num_chan),
8889
option::unwrap(num_port1))
89-
})];
90+
};
91+
vec::push(futures, new_future);
9092
num_chan = Some(new_chan);
9193
};
9294

src/test/bench/msgsend-ring-rw-arcs.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,17 @@ fn main(args: ~[~str]) {
8282
let num_chan2 = ~mut None;
8383
*num_chan2 <-> num_chan;
8484
let num_port = ~mut Some(num_port);
85-
futures += ~[future::spawn(|move num_chan2, move num_port| {
85+
let new_future = do future::spawn
86+
|move num_chan2, move num_port| {
8687
let mut num_chan = None;
8788
num_chan <-> *num_chan2;
8889
let mut num_port1 = None;
8990
num_port1 <-> *num_port;
9091
thread_ring(i, msg_per_task,
9192
option::unwrap(num_chan),
9293
option::unwrap(num_port1))
93-
})];
94+
};
95+
vec::push(futures, new_future);
9496
num_chan = Some(new_chan);
9597
};
9698

src/test/bench/msgsend-ring.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ fn main(args: ~[~str]) {
4545
let get_chan = Port();
4646
let get_chan_chan = Chan(get_chan);
4747

48-
futures += ~[do future::spawn |copy num_chan, move get_chan_chan| {
48+
let new_future = do future::spawn
49+
|copy num_chan, move get_chan_chan| {
4950
let p = Port();
5051
get_chan_chan.send(Chan(p));
5152
thread_ring(i, msg_per_task, num_chan, p)
52-
}];
53+
};
54+
vec::push(futures, new_future);
5355

5456
num_chan = get_chan.recv();
5557
};

src/test/bench/shootout-pfib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn stress(num_tasks: int) {
7171
let mut results = ~[];
7272
for range(0, num_tasks) |i| {
7373
do task::task().future_result(|+r| {
74-
results += ~[r];
74+
vec::push(results, r);
7575
}).spawn {
7676
stress_task(i);
7777
}

src/test/run-pass/task-comm-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn test00() {
3131
while i < number_of_tasks {
3232
let ch = po.chan();
3333
do task::task().future_result(|+r| {
34-
results += ~[r];
34+
vec::push(results, r);
3535
}).spawn |copy i| {
3636
test00_start(ch, i, number_of_messages)
3737
}

src/test/run-pass/task-comm.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn test00() {
4040
while i < number_of_tasks {
4141
i = i + 1;
4242
do task::task().future_result(|+r| {
43-
results += ~[r];
43+
vec::push(results, r);
4444
}).spawn |copy i| {
4545
test00_start(ch, i, number_of_messages);
4646
}
@@ -127,7 +127,7 @@ fn test06() {
127127
while i < number_of_tasks {
128128
i = i + 1;
129129
do task::task().future_result(|+r| {
130-
results += ~[r];
130+
vec::push(results, r);
131131
}).spawn |copy i| {
132132
test06_start(i);
133133
};

0 commit comments

Comments
 (0)