• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Asynchronous Unit testing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Asynchronous Unit testing


  • Subject: Re: Asynchronous Unit testing
  • From: Mike Zornek <email@hidden>
  • Date: Wed, 08 Feb 2006 10:53:58 -0500

On 2/8/06 9:09 AM, "Ruotger Skupin" <email@hidden> wrote:

> Hi,
>
> I hope this is the right list to ask...
>
> I'd like to unit test some code that relies heavily on timers and calls like
> [[NSNotificationQueue defaultQueue] enqueueNotification:[NSNotification
> notificationWithName:kSomeNotification object:self]
> postingStyle:NSPostWhenIdle];
>
> i.e. my -(void) testSomething method returns immediately and actual test will
> run some time later. Is that possible at all with the SenTestingKit?
>
> Roddi

I did some unit testing on a web spider I wrote. Had the same issue .. I
wasn't sure when it would be done. Here's my code:

[websiteScanner startScan];
while ([websiteScanner isDoneProcessing] == NO) {
    [[NSRunLoop currentRunLoop] runUntilDate:[NSDate
dateWithTimeIntervalSinceNow:1.0]];
    NSLog(@"Polling...");
}

After that I would do all of my asserts.

~ Mike
--
Work: http://ClickableBliss.com
Play: http://MikeZornek.com


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Asynchronous Unit testing -- solved
      • From: Ruotger Skupin <email@hidden>
    • Re: Asynchronous Unit testing
      • From: Ruotger Skupin <email@hidden>
References: 
 >Asynchronous Unit testing (From: Ruotger Skupin <email@hidden>)

  • Prev by Date: Asynchronous Unit testing
  • Next by Date: gcc frontend bug when compiling fat/universal?
  • Previous by thread: Asynchronous Unit testing
  • Next by thread: Re: Asynchronous Unit testing
  • Index(es):
    • Date
    • Thread