Fix from_buf in test cases
This commit is contained in:
@@ -1973,7 +1973,7 @@ mod tests {
|
||||
// Test on-stack copy-from-buf.
|
||||
let a = ~[1, 2, 3];
|
||||
let mut ptr = raw::to_ptr(a);
|
||||
let b = raw::from_buf(ptr, 3u);
|
||||
let b = from_buf(ptr, 3u);
|
||||
assert (len(b) == 3u);
|
||||
assert (b[0] == 1);
|
||||
assert (b[1] == 2);
|
||||
@@ -1982,7 +1982,7 @@ mod tests {
|
||||
// Test on-heap copy-from-buf.
|
||||
let c = ~[1, 2, 3, 4, 5];
|
||||
ptr = raw::to_ptr(c);
|
||||
let d = raw::from_buf(ptr, 5u);
|
||||
let d = from_buf(ptr, 5u);
|
||||
assert (len(d) == 5u);
|
||||
assert (d[0] == 1);
|
||||
assert (d[1] == 2);
|
||||
|
||||
@@ -1048,7 +1048,7 @@ pub mod test {
|
||||
as *request_wrapper;
|
||||
let buf_base = get_base_from_buf(buf);
|
||||
let buf_len = get_len_from_buf(buf);
|
||||
let bytes = vec::raw::from_buf(buf_base, buf_len as uint);
|
||||
let bytes = vec::from_buf(buf_base, buf_len as uint);
|
||||
let read_chan = *((*client_data).read_chan);
|
||||
let msg_from_server = str::from_bytes(bytes);
|
||||
core::comm::send(read_chan, msg_from_server);
|
||||
@@ -1223,7 +1223,7 @@ pub mod test {
|
||||
buf_base as uint,
|
||||
buf_len as uint,
|
||||
nread));
|
||||
let bytes = vec::raw::from_buf(buf_base, buf_len);
|
||||
let bytes = vec::from_buf(buf_base, buf_len);
|
||||
let request_str = str::from_bytes(bytes);
|
||||
|
||||
let client_data = get_data_for_uv_handle(
|
||||
|
||||
Reference in New Issue
Block a user