Adjust USDS test for macOS behavior.

This commit is contained in:
Sönke Ludwig 2017-01-23 22:18:46 +01:00
parent 356a34fad2
commit 4f94cd107e

View file

@ -55,19 +55,23 @@ void testDgram()
assert(bytes == pack2.length); assert(bytes == pack2.length);
})(pack2, IOMode.once, baddr); })(pack2, IOMode.once, baddr);
s_baseSocket.receive!((status, bts, scope addr) { auto tm = eventDriver.timers.create();
assert(status == IOStatus.ok); eventDriver.timers.set(tm, 50.msecs, 0.msecs);
assert(bts == pack2.length); eventDriver.timers.wait(tm, (tm) {
assert(s_rbuf[0 .. pack2.length] == pack2); s_baseSocket.receive!((status, bts, scope addr) {
assert(status == IOStatus.ok);
assert(bts == pack2.length);
assert(s_rbuf[0 .. pack2.length] == pack2);
destroy(s_baseSocket); destroy(s_baseSocket);
destroy(s_freeSocket); destroy(s_freeSocket);
destroy(s_connectedSocket); destroy(s_connectedSocket);
s_done = true; s_done = true;
// FIXME: this shouldn't ne necessary: // FIXME: this shouldn't ne necessary:
eventDriver.core.exit(); eventDriver.core.exit();
})(s_rbuf, IOMode.immediate); })(s_rbuf, IOMode.immediate);
});
})(s_rbuf, IOMode.once); })(s_rbuf, IOMode.once);
s_connectedSocket.send!((status, bytes) { s_connectedSocket.send!((status, bytes) {
assert(status == IOStatus.ok); assert(status == IOStatus.ok);