mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
make sure the loop has an input source
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39980 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5dad2747ef
commit
be79404656
1 changed files with 13 additions and 0 deletions
|
@ -24,6 +24,7 @@ int main()
|
|||
MyClass *dummy = [MyClass new];
|
||||
NSMethodSignature *sig;
|
||||
NSInvocation *inv;
|
||||
NSTimer *dly;
|
||||
NSTimer *tim;
|
||||
NSRunLoop *run;
|
||||
NSDate *date;
|
||||
|
@ -34,6 +35,12 @@ int main()
|
|||
[inv setSelector: @selector(incrementCounter)];
|
||||
[inv setTarget: dummy];
|
||||
|
||||
/* Ensure the runloop has an 'input source' for events.
|
||||
*/
|
||||
dly = [NSTimer scheduledTimerWithTimeInterval: 120.0
|
||||
invocation: inv
|
||||
repeats: NO];
|
||||
|
||||
run = [NSRunLoop currentRunLoop];
|
||||
PASS(run != nil, "NSRunLoop understands [+currentRunLoop]");
|
||||
PASS([run currentMode] == nil, "-currentMode returns nil");
|
||||
|
@ -51,6 +58,12 @@ int main()
|
|||
ti = [NSDate timeIntervalSinceReferenceDate] - ti;
|
||||
PASS(ti < 0.2, "-runUntilDate: takes very short time");
|
||||
|
||||
ti = [NSDate timeIntervalSinceReferenceDate];
|
||||
PASS_RUNS([run runUntilDate: nil];,
|
||||
"-runUntilDate: works for nil date");
|
||||
ti = [NSDate timeIntervalSinceReferenceDate] - ti;
|
||||
PASS(ti < 0.2, "-runUntilDate: for nil date takes very short time");
|
||||
|
||||
tim = [NSTimer scheduledTimerWithTimeInterval: 0.005
|
||||
invocation: inv
|
||||
repeats: NO];
|
||||
|
|
Loading…
Reference in a new issue