Boost logo

Boost Testing :

Subject: [Boost-testing] How to test callbacks / non-blocking calls?
From: ariasgore_at_[hidden]
Date: 2009-06-18 04:35:00


I am testing some sort of socket connection where I have async callbacks which are of course non-blocking calls.
How can Boost::Test provide some testing facilities for that?

Here is a very simple example:

void mmyFunc(const char * text)
  // compare
  mocksocket m;
  MySocket my(1000); // listen on port 1000
  my.callback(myFunc); // register callback

  // test case ended

So my test cannot be executed at once in the case since the callback most probably fires too late. What are workarrounds for such scenarios?

Thank you

GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter

Boost-testing list run by mbergal at