Fix test compile errors.

This commit is contained in:
Sönke Ludwig 2016-10-19 22:00:06 +02:00
parent ee1b9cbd4b
commit bf519fd058
5 changed files with 14 additions and 11 deletions

View file

@ -7,7 +7,7 @@ module test;
import eventcore.core; import eventcore.core;
import std.stdio : File, writefln; import std.stdio : File, writefln;
import std.file : exists, remove; import std.file : exists, remove;
import core.time : msecs; import core.time : Duration, msecs;
bool s_done; bool s_done;
int s_cnt = 0; int s_cnt = 0;
@ -45,12 +45,12 @@ void main()
auto fil = File(testFilename, "wt"); auto fil = File(testFilename, "wt");
auto tm = eventDriver.timers.create(); auto tm = eventDriver.timers.create();
eventDriver.timers.set(tm, 100.msecs); eventDriver.timers.set(tm, 100.msecs, 0.msecs);
eventDriver.timers.wait(tm, (tm) { eventDriver.timers.wait(tm, (tm) {
scope (failure) assert(false); scope (failure) assert(false);
fil.write("test"); fil.write("test");
fil.close(); fil.close();
eventDriver.timers.set(tm, 100.msecs); eventDriver.timers.set(tm, 100.msecs, 0.msecs);
eventDriver.timers.wait(tm, (tm) { eventDriver.timers.wait(tm, (tm) {
scope (failure) assert(false); scope (failure) assert(false);
remove(testFilename); remove(testFilename);
@ -58,7 +58,7 @@ void main()
}); });
ExitReason er; ExitReason er;
do er = eventDriver.core.processEvents(); do er = eventDriver.core.processEvents(Duration.max);
while (er == ExitReason.idle); while (er == ExitReason.idle);
//assert(er == ExitReason.outOfWaiters); // FIXME: see above //assert(er == ExitReason.outOfWaiters); // FIXME: see above
assert(s_done); assert(s_done);

View file

@ -6,6 +6,7 @@ module test;
import eventcore.core; import eventcore.core;
import std.stdio : writefln; import std.stdio : writefln;
import core.time : Duration;
bool s_done; bool s_done;
@ -23,7 +24,7 @@ void main()
}); });
ExitReason er; ExitReason er;
do er = eventDriver.core.processEvents(); do er = eventDriver.core.processEvents(Duration.max);
while (er == ExitReason.idle); while (er == ExitReason.idle);
//assert(er == ExitReason.outOfWaiters); // FIXME: see above //assert(er == ExitReason.outOfWaiters); // FIXME: see above
assert(s_done); assert(s_done);

View file

@ -8,7 +8,7 @@ import eventcore.core;
import std.stdio : writefln; import std.stdio : writefln;
import core.stdc.signal; import core.stdc.signal;
import core.sys.posix.signal : SIGRTMIN; import core.sys.posix.signal : SIGRTMIN;
import core.time : msecs; import core.time : Duration, msecs;
bool s_done; bool s_done;
@ -23,13 +23,13 @@ void main()
}); });
auto tm = eventDriver.timers.create(); auto tm = eventDriver.timers.create();
eventDriver.timers.set(tm, 500.msecs); eventDriver.timers.set(tm, 500.msecs, 0.msecs);
eventDriver.timers.wait(tm, (tm) { eventDriver.timers.wait(tm, (tm) {
() @trusted { raise(SIGRTMIN+1); } (); () @trusted { raise(SIGRTMIN+1); } ();
}); });
ExitReason er; ExitReason er;
do er = eventDriver.core.processEvents(); do er = eventDriver.core.processEvents(Duration.max);
while (er == ExitReason.idle); while (er == ExitReason.idle);
//assert(er == ExitReason.outOfWaiters); // FIXME: see above //assert(er == ExitReason.outOfWaiters); // FIXME: see above
assert(s_done); assert(s_done);

View file

@ -7,6 +7,7 @@ module test;
import eventcore.core; import eventcore.core;
import eventcore.socket; import eventcore.socket;
import std.socket : InternetAddress; import std.socket : InternetAddress;
import core.time : Duration;
DatagramSocket s_baseSocket; DatagramSocket s_baseSocket;
DatagramSocket s_freeSocket; DatagramSocket s_freeSocket;
@ -63,7 +64,7 @@ void main()
})(pack1, IOMode.immediate); })(pack1, IOMode.immediate);
ExitReason er; ExitReason er;
do er = eventDriver.core.processEvents(); do er = eventDriver.core.processEvents(Duration.max);
while (er == ExitReason.idle); while (er == ExitReason.idle);
//assert(er == ExitReason.outOfWaiters); // FIXME: see above //assert(er == ExitReason.outOfWaiters); // FIXME: see above
assert(s_done); assert(s_done);

View file

@ -18,6 +18,7 @@ import eventcore.core;
import eventcore.socket; import eventcore.socket;
import std.file : exists, remove; import std.file : exists, remove;
import std.socket : UnixAddress; import std.socket : UnixAddress;
import core.time : Duration;
ubyte[256] s_rbuf; ubyte[256] s_rbuf;
bool s_done; bool s_done;
@ -75,7 +76,7 @@ void testDgram()
ExitReason er; ExitReason er;
do er = eventDriver.core.processEvents(); do er = eventDriver.core.processEvents(Duration.max);
while (er == ExitReason.idle); while (er == ExitReason.idle);
//assert(er == ExitReason.outOfWaiters); // FIXME: see above //assert(er == ExitReason.outOfWaiters); // FIXME: see above
assert(s_done); assert(s_done);
@ -130,7 +131,7 @@ void testStream()
})(baddr); })(baddr);
ExitReason er; ExitReason er;
do er = eventDriver.core.processEvents(); do er = eventDriver.core.processEvents(Duration.max);
while (er == ExitReason.idle); while (er == ExitReason.idle);
//assert(er == ExitReason.outOfWaiters); // FIXME: see above //assert(er == ExitReason.outOfWaiters); // FIXME: see above
assert(s_done); assert(s_done);