Add test for issue #104.
This commit is contained in:
parent
d48ae4913f
commit
9e526194e7
23
tests/issue-104-unreferenced-periodic-timer.d
Normal file
23
tests/issue-104-unreferenced-periodic-timer.d
Normal file
|
@ -0,0 +1,23 @@
|
|||
/+ dub.sdl:
|
||||
name "test"
|
||||
dependency "vibe-core" path=".."
|
||||
+/
|
||||
module test;
|
||||
|
||||
import vibe.core.core;
|
||||
|
||||
import core.memory;
|
||||
import core.time;
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
setTimer(10.seconds, { assert(false, "Event loop didn't exit in time."); });
|
||||
|
||||
// make sure that periodic timers for which no explicit reference is stored
|
||||
// are still getting invoked periodically
|
||||
size_t i = 0;
|
||||
setTimer(50.msecs, { if (i++ == 3) exitEventLoop(); }, true);
|
||||
|
||||
return runEventLoop();
|
||||
}
|
Loading…
Reference in a new issue