Unit tests and segfaults

Russel Winder russel at winder.org.uk
Tue Dec 11 11:21:59 PST 2012


On Tue, 2012-12-11 at 18:58 +0100, Jonathan M Davis wrote:
[…]
> I'd argue that if you want an error condition that you test for, you should 
> actually do something in your code that generates an error condition (e.g. 
> throw an exception) and that it really makes no sense to test for segfaults. 
> That's not really an error condition. That just means that your code is 
> broken. And such cases aren't generally worth testing for IMHO.

I appreciate where you are coming from with respect to general testing
strategy, and am basically in agreement with what you say.  However in
this specific case a segfault is just another exception.  In terms of
recursion the exception is "recursion stack limit reached" it just
happens to be spelt "segfault"

[…]

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20121211/8146a95b/attachment.pgp>


More information about the Digitalmars-d-learn mailing list