Fix macOS compile error in signal test.
This commit is contained in:
parent
607bd1df09
commit
86ff9ea0d0
|
@ -7,7 +7,7 @@ module test;
|
||||||
import eventcore.core;
|
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 : SIGUSR1;
|
||||||
import core.time : Duration, msecs;
|
import core.time : Duration, msecs;
|
||||||
|
|
||||||
bool s_done;
|
bool s_done;
|
||||||
|
@ -17,10 +17,10 @@ void main()
|
||||||
version (OSX) writefln("Signals are not yet supported on macOS. Skipping test.");
|
version (OSX) writefln("Signals are not yet supported on macOS. Skipping test.");
|
||||||
else {
|
else {
|
||||||
|
|
||||||
auto id = eventDriver.signals.listen(SIGRTMIN+1, (id, status, sig) {
|
auto id = eventDriver.signals.listen(SIGUSR1, (id, status, sig) {
|
||||||
assert(!s_done);
|
assert(!s_done);
|
||||||
assert(status == SignalStatus.ok);
|
assert(status == SignalStatus.ok);
|
||||||
assert(sig == () @trusted { return SIGRTMIN+1; } ());
|
assert(sig == () @trusted { return SIGUSR1; } ());
|
||||||
s_done = true;
|
s_done = true;
|
||||||
eventDriver.core.exit();
|
eventDriver.core.exit();
|
||||||
});
|
});
|
||||||
|
@ -28,7 +28,7 @@ void main()
|
||||||
auto tm = eventDriver.timers.create();
|
auto tm = eventDriver.timers.create();
|
||||||
eventDriver.timers.set(tm, 500.msecs, 0.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(SIGUSR1); } ();
|
||||||
});
|
});
|
||||||
|
|
||||||
ExitReason er;
|
ExitReason er;
|
||||||
|
|
Loading…
Reference in a new issue