Fix writing timeout events. Check that we only return one timeout event.

This commit is contained in:
Marcin Mielniczuk
2020-01-08 19:44:07 +01:00
parent a2b556f1b0
commit 54a398ad69
2 changed files with 15 additions and 6 deletions

View File

@@ -65,11 +65,17 @@ 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,
u: wasi::SubscriptionU { fd_readwrite },
},
wasi::Subscription {
userdata: 42,
r#type: wasi::EVENTTYPE_FD_READ,
u: wasi::SubscriptionU { fd_readwrite },
},
];
let out = poll_oneoff_impl(&r#in, 1);
let event = &out[0];