diff --git a/tests/0-dirwatcher.d b/tests/0-dirwatcher.d index e6e599b..a5468c9 100644 --- a/tests/0-dirwatcher.d +++ b/tests/0-dirwatcher.d @@ -39,8 +39,8 @@ void main() assert(change.kind == FileChangeKind.removed); assert(change.directory == "."); assert(change.name == testFilename); + eventDriver.watchers.releaseRef(id); s_done = true; - eventDriver.core.exit(); break; } }); @@ -63,7 +63,7 @@ void main() ExitReason er; do er = eventDriver.core.processEvents(Duration.max); while (er == ExitReason.idle); - //assert(er == ExitReason.outOfWaiters); // FIXME: see above + assert(er == ExitReason.outOfWaiters); assert(s_done); s_done = false; diff --git a/tests/0-dns.d b/tests/0-dns.d index 08b5fe6..7f3a43b 100644 --- a/tests/0-dns.d +++ b/tests/0-dns.d @@ -17,17 +17,16 @@ void main() assert(status == DNSStatus.ok); assert(addrs.length >= 1); foreach (a; addrs) { - try writefln("addr %s (%s)", a.toAddrString(), a.toPortString()); + try writefln("addr %s (%s)", a.toAddrString(), a.toPortString()); catch (Exception e) assert(false, e.msg); } s_done = true; - eventDriver.core.exit(); }); ExitReason er; do er = eventDriver.core.processEvents(Duration.max); while (er == ExitReason.idle); - //assert(er == ExitReason.outOfWaiters); // FIXME: see above + assert(er == ExitReason.outOfWaiters); assert(s_done); s_done = false; } diff --git a/tests/0-event.d b/tests/0-event.d index b0f9e2c..5d66633 100644 --- a/tests/0-event.d +++ b/tests/0-event.d @@ -27,7 +27,6 @@ void test(bool notify_all) assert(!s_done); s_done = true; eventDriver.timers.cancelWait(tm); - eventDriver.core.exit(); }); }); @@ -51,7 +50,7 @@ void test(bool notify_all) ExitReason er; do er = eventDriver.core.processEvents(Duration.max); while (er == ExitReason.idle); - //assert(er == ExitReason.outOfWaiters); // FIXME: see above + assert(er == ExitReason.outOfWaiters); assert(s_done); s_done = false; } diff --git a/tests/0-file.d b/tests/0-file.d index b533d8e..58b33f5 100644 --- a/tests/0-file.d +++ b/tests/0-file.d @@ -18,11 +18,6 @@ void main() auto f = eventDriver.files.open("test.txt", FileOpenMode.createTrunc); assert(eventDriver.files.getSize(f) == 0); auto data = cast(const(ubyte)[])"Hello, World!"; - auto tm = eventDriver.timers.create(); - eventDriver.timers.set(tm, 500.msecs, 0.msecs); - eventDriver.timers.wait(tm, (tm) { - assert(false, "File operation stalled."); - }); eventDriver.files.write(f, 0, data[0 .. 7], IOMode.all, (f, status, nbytes) { assert(status == IOStatus.ok); @@ -48,7 +43,6 @@ void main() } (); eventDriver.files.releaseRef(f); s_done = true; - eventDriver.core.exit(); }); }); }); @@ -57,7 +51,7 @@ void main() ExitReason er; do er = eventDriver.core.processEvents(Duration.max); while (er == ExitReason.idle); - //assert(er == ExitReason.outOfWaiters); // FIXME: see above + assert(er == ExitReason.outOfWaiters); assert(s_done); s_done = false; } diff --git a/tests/0-signal.d b/tests/0-signal.d index 273349e..22252e8 100644 --- a/tests/0-signal.d +++ b/tests/0-signal.d @@ -21,8 +21,8 @@ void main() assert(!s_done); assert(status == SignalStatus.ok); assert(sig == () @trusted { return SIGUSR1; } ()); + eventDriver.signals.releaseRef(id); s_done = true; - eventDriver.core.exit(); }); auto tm = eventDriver.timers.create(); @@ -34,7 +34,7 @@ void main() ExitReason er; do er = eventDriver.core.processEvents(Duration.max); while (er == ExitReason.idle); - //assert(er == ExitReason.outOfWaiters); // FIXME: see above + assert(er == ExitReason.outOfWaiters); assert(s_done); s_done = false; diff --git a/tests/0-tcp-readwait.d b/tests/0-tcp-readwait.d index e599753..3b8bfae 100644 --- a/tests/0-tcp-readwait.d +++ b/tests/0-tcp-readwait.d @@ -43,9 +43,6 @@ void main() destroy(server); destroy(client); s_done = true; - - // FIXME: this shouldn't ne necessary: - eventDriver.core.exit(); })(s_rbuf, IOMode.immediate); })(s_rbuf[0 .. 0], IOMode.once); }); @@ -67,7 +64,7 @@ void main() ExitReason er; do er = eventDriver.core.processEvents(Duration.max); while (er == ExitReason.idle); - //assert(er == ExitReason.outOfWaiters); // FIXME: see above + assert(er == ExitReason.outOfWaiters); assert(s_done); s_done = false; diff --git a/tests/0-tcp.d b/tests/0-tcp.d index 2af5885..92708f4 100644 --- a/tests/0-tcp.d +++ b/tests/0-tcp.d @@ -43,9 +43,6 @@ void main() destroy(server); destroy(client); s_done = true; - - // FIXME: this shouldn't ne necessary: - eventDriver.core.exit(); })(s_rbuf, IOMode.once); })(s_rbuf, IOMode.once); }); @@ -62,7 +59,7 @@ void main() ExitReason er; do er = eventDriver.core.processEvents(Duration.max); while (er == ExitReason.idle); - //assert(er == ExitReason.outOfWaiters); // FIXME: see above + assert(er == ExitReason.outOfWaiters); assert(s_done); s_done = false; } diff --git a/tests/0-timer.d b/tests/0-timer.d index 264b68c..d75997f 100644 --- a/tests/0-timer.d +++ b/tests/0-timer.d @@ -34,10 +34,11 @@ void main() s_cnt++; assert(dur > 100.msecs * s_cnt); assert(dur < 100.msecs * s_cnt + 20.msecs); + assert(s_cnt <= 3); if (s_cnt == 3) { s_done = true; - eventDriver.core.exit(); + eventDriver.timers.stop(timer); } else eventDriver.timers.wait(tm, &secondTier); } catch (Exception e) { assert(false, e.msg); @@ -52,7 +53,7 @@ void main() ExitReason er; do er = eventDriver.core.processEvents(Duration.max); while (er == ExitReason.idle); - //assert(er == ExitReason.outOfWaiters); // FIXME: see above + assert(er == ExitReason.outOfWaiters); assert(s_done); s_done = false; } diff --git a/tests/0-udp.d b/tests/0-udp.d index 2a49f9e..0369237 100644 --- a/tests/0-udp.d +++ b/tests/0-udp.d @@ -55,9 +55,6 @@ void main() destroy(s_connectedSocket); s_done = true; log("done."); - - // FIXME: this shouldn't be necessary: - eventDriver.core.exit(); })(s_rbuf, IOMode.immediate); }); })(s_rbuf, IOMode.once); @@ -70,7 +67,7 @@ void main() ExitReason er; do er = eventDriver.core.processEvents(Duration.max); while (er == ExitReason.idle); - //assert(er == ExitReason.outOfWaiters); // FIXME: see above + assert(er == ExitReason.outOfWaiters); assert(s_done); } diff --git a/tests/0-usds.d b/tests/0-usds.d index b03e434..700ea6f 100644 --- a/tests/0-usds.d +++ b/tests/0-usds.d @@ -118,9 +118,6 @@ void testStream() destroy(server); destroy(client); s_done = true; - - // FIXME: this shouldn't ne necessary: - eventDriver.core.exit(); })(s_rbuf, IOMode.once); })(s_rbuf, IOMode.once); }); @@ -137,7 +134,7 @@ void testStream() ExitReason er; do er = eventDriver.core.processEvents(Duration.max); while (er == ExitReason.idle); - //assert(er == ExitReason.outOfWaiters); // FIXME: see above + assert(er == ExitReason.outOfWaiters); assert(s_done); s_done = false; }