[interfacekit] Re: Ready, set, go!

Its been a while since I have sent an email also.  Between holidays and 
some personal things going on, I have not really had a chance to work 
on anything over the last 1.5 months or so.  But I plan to get back at 
it now.

The things I am going to be working on are:

- documenting and writing test cases for Autolock (I needed it to test 
BMessageQueue so I implemented it quick)

- re-implementing the BMessageQueue and BLocker testcases using 
cppunit.  See below for some details

- document and implement BMessageFilter class, assuming it is still 
available.  Seems to be according to the webpage

On the topic of cppunit, I looked at the docs and I think I may have a 
problem using it with the testcases I have written.  The problem is 
that to test BLocker or BMessageQueue well, I had to do tests where a 
couple of threads are started concurrently.  These threads attempt to 
find synchronization problems by using the interface concurrently from 
multiple threads.

I am unsure how well cppunit will work with multiple threads.  My 
understanding is that a failure of a test turns into a C++ exception 
being thrown.  So, in my situation the stack might look something like:

main thread - RunTests(), blocked waiting for threads to finish
thread 1 - doSomething(), performing the test
thread 2 - doSomethingElse(), performing the test also

If something goes wrong in thread 1 or thread 2, how will the exception 
make its way to the main thread so it can be reported as a test 
failure?  Correct me if I am wrong, but I think we need to implement a 
class derived from TestCase called ThreadedTestCase perhaps.  This 
class would provide a mechanism to start a set of threads, each of 
which perfoms part of the test, waits for them to finish and reports 
any failure.

What do people think about this?  Is this a requirement we need to 
build ontop of cppunit or is it there already and I am missing it?  I 
will volunteer to do so if people agree it needs to be there.

Again, sorry for the lack of any real progress from me in a while.  I 
hope to change that very soon now!

--
Jeremy Rand
jrand@xxxxxxxx

Other related posts: