[bind10-dev] EXPECT_TRUE() considered harmful?

Shane Kerr shane at isc.org
Mon Feb 20 15:54:53 UTC 2012


All,

While looking through old tickets, I found this:

http://bind10.isc.org/ticket/398

The ticket says:

	In general, when we do

	    EXPECT_TRUE(a <op> b);

	it's better to be changed to:

	    EXPECT_<op>(a, b);

	because when the test fails the latter will provide more
	detailed information (the values of a and b).

This is true. I checked through the code, and there are a bunch of
cases where we use EXPECT_TRUE() rather than EXPECT_<op>().

I propose that we add this recommendation to the coding guidelines:

http://bind10.isc.org/wiki/CodingGuidelines

I'll leave the ticket there because we'll need a cleanup task, but I
thought we should have a discussion on the developer list. :)

Any objections or other ideas?

Cheers,

--
Shane


More information about the bind10-dev mailing list