Merge pull request #552 from marmistrz/poll
Minimal viable implementation of poll_oneoff for Windows
This commit is contained in:
@@ -45,10 +45,6 @@ unsafe fn test_timeout() {
|
||||
}];
|
||||
let out = poll_oneoff_impl(&r#in, 1);
|
||||
let event = &out[0];
|
||||
assert_eq!(
|
||||
event.userdata, CLOCK_ID,
|
||||
"the event.userdata should contain clock_id specified by the user"
|
||||
);
|
||||
assert_eq!(
|
||||
event.error,
|
||||
wasi::ERRNO_SUCCESS,
|
||||
@@ -59,6 +55,10 @@ unsafe fn test_timeout() {
|
||||
wasi::EVENTTYPE_CLOCK,
|
||||
"the event.type should equal clock"
|
||||
);
|
||||
assert_eq!(
|
||||
event.userdata, CLOCK_ID,
|
||||
"the event.userdata should contain clock_id specified by the user"
|
||||
);
|
||||
}
|
||||
|
||||
unsafe fn test_stdin_read() {
|
||||
@@ -77,6 +77,7 @@ unsafe fn test_stdin_read() {
|
||||
r#type: wasi::EVENTTYPE_CLOCK,
|
||||
u: wasi::SubscriptionU { clock },
|
||||
},
|
||||
// Make sure that timeout is returned only once even if there are multiple read events
|
||||
wasi::Subscription {
|
||||
userdata: 1,
|
||||
r#type: wasi::EVENTTYPE_FD_READ,
|
||||
@@ -85,10 +86,6 @@ unsafe fn test_stdin_read() {
|
||||
];
|
||||
let out = poll_oneoff_impl(&r#in, 1);
|
||||
let event = &out[0];
|
||||
assert_eq!(
|
||||
event.userdata, CLOCK_ID,
|
||||
"the event.userdata should contain clock_id specified by the user"
|
||||
);
|
||||
assert_eq!(
|
||||
event.error,
|
||||
wasi::ERRNO_SUCCESS,
|
||||
@@ -99,6 +96,10 @@ unsafe fn test_stdin_read() {
|
||||
wasi::EVENTTYPE_CLOCK,
|
||||
"the event.type should equal clock"
|
||||
);
|
||||
assert_eq!(
|
||||
event.userdata, CLOCK_ID,
|
||||
"the event.userdata should contain clock_id specified by the user"
|
||||
);
|
||||
}
|
||||
|
||||
unsafe fn test_stdout_stderr_write() {
|
||||
|
||||
Reference in New Issue
Block a user