Re: running without a mainlopp for unittests



On Thu, 03 Feb 2005 20:41:39 +0100, Stefan Kost
<kost imn htwk-leipzig de> wrote:
Hi,

I use check too ;).
Are your tests available somehwere ?

Hmmm, like I said; I dont really use them for GUI elements so my
mainloop tests dont include gtk_init()... the test bodies that use mainloops
have this kind of flow:

 - create mainloop
 - provoke something that will happen in the event queue;
   the example I was just looking at is a test for a system wide
   observer model that uses an IPC; one test is that I modify
   a subject that I'm watching (through a callback that is obscurly
   registered through a GIOChannel)
-  register an idle func to terminate the main loop
 - If my message was recieved properly in the related callback, I set
   a global variable "success" to TRUE
- call g_main_loop_run()
- fail_unless (success == TRUE, "message");

Cheers,
                                       -Tristan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]