From: <ap...@gm...> - 2007-09-11 16:37:25
|
Stuart, =20 I haven't needed to test threaded code, so I don't know what it takes in general. Thus, I can't know if DUnit supports what's required. =20 I suggest you search the web for testing threaded code in general = (keywords concurrent and test/testing). Why? Because a maxim of concurrent = programing is that every execution of a concurrent program is equivalent to the execution of some sequential program. That means that the unit testing you're doing by separating the logic from the threading is enough for = the sequential side to yur program and that what you want to test is the concurrency itself. Are buffers large enough for intended loads? Can you lead the program to a race condition or a deadlock? That kind of thing. =20 Juanco =20 =20 _____ =20 From: dun...@li... [mailto:dun...@li...] On Behalf Of = Stuart Grassie Sent: Tuesday, September 11, 2007 9:22 AM To: dun...@li... Subject: [DUnit-interest] Unit testing threaded code Hello list, =20 I am writing some threaded code, using TThread, and I want to ensure = that it is unit is unit tested in the best possible way, and I hoping that = someone on the list reading this may be able to point me in the right direction. =20 I have done some research on using dunit for this via google and this = list=92s archives, but either there just isn=92t a great detail of information on = the subject or my search skills are sorely lacking. =20 I have separated the logic that is used in the thread, and the actual threaded code, into separate units. So the logic is easily unit tested.=20 =20 What is the best way to go about writing a test case to check that, for example, the worker thread has successfully synchronized with the main = vcl thread? =20 Regards, =20 Stuart Grassie =20 |