Author: rfm Date: Tue Jul 12 13:06:43 2016 New Revision: 39980 URL: http://svn.gna.org/viewcvs/gnustep?rev=39980&view=rev Log: make sure the loop has an input source
Modified: libs/base/trunk/Tests/base/NSRunLoop/general.m Modified: libs/base/trunk/Tests/base/NSRunLoop/general.m URL: http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Tests/base/NSRunLoop/general.m?rev=39980&r1=39979&r2=39980&view=diff ============================================================================== --- libs/base/trunk/Tests/base/NSRunLoop/general.m (original) +++ libs/base/trunk/Tests/base/NSRunLoop/general.m Tue Jul 12 13:06:43 2016 @@ -24,6 +24,7 @@ MyClass *dummy = [MyClass new]; NSMethodSignature *sig; NSInvocation *inv; + NSTimer *dly; NSTimer *tim; NSRunLoop *run; NSDate *date; @@ -34,6 +35,12 @@ [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"); @@ -50,6 +57,12 @@ "-runUntilDate: works for distant past"); 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 _______________________________________________ Gnustep-cvs mailing list Gnustep-cvs@gna.org https://mail.gna.org/listinfo/gnustep-cvs