Skip to content

Commit

Permalink
tcp tests: need a blocking_read to get messages (bytecodealliance#6953)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pat Hickey authored Sep 1, 2023
1 parent d4a4d4f commit e5e9cf8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/test-programs/wasi-sockets-tests/src/bin/tcp_v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn main() {
assert!(empty_data.is_empty());
assert_eq!(status, streams::StreamStatus::Open);

let (data, status) = streams::read(input, first_message.len() as u64).unwrap();
let (data, status) = streams::blocking_read(input, first_message.len() as u64).unwrap();
assert_eq!(status, streams::StreamStatus::Open);

tcp::drop_tcp_socket(accepted);
Expand Down Expand Up @@ -96,7 +96,7 @@ fn main() {

wait(sub);
let (accepted, input, output) = tcp::accept(sock).unwrap();
let (data, status) = streams::read(input, second_message.len() as u64).unwrap();
let (data, status) = streams::blocking_read(input, second_message.len() as u64).unwrap();
assert_eq!(status, streams::StreamStatus::Open);

streams::drop_input_stream(input);
Expand Down
4 changes: 2 additions & 2 deletions crates/test-programs/wasi-sockets-tests/src/bin/tcp_v6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn main() {
assert!(empty_data.is_empty());
assert_eq!(status, streams::StreamStatus::Open);

let (data, status) = streams::read(input, first_message.len() as u64).unwrap();
let (data, status) = streams::blocking_read(input, first_message.len() as u64).unwrap();
assert_eq!(status, streams::StreamStatus::Open);

tcp::drop_tcp_socket(accepted);
Expand Down Expand Up @@ -98,7 +98,7 @@ fn main() {

wait(sub);
let (accepted, input, output) = tcp::accept(sock).unwrap();
let (data, status) = streams::read(input, second_message.len() as u64).unwrap();
let (data, status) = streams::blocking_read(input, second_message.len() as u64).unwrap();
assert_eq!(status, streams::StreamStatus::Open);

streams::drop_input_stream(input);
Expand Down

0 comments on commit e5e9cf8

Please sign in to comment.