[bind10-dev] EXPECT_TRUE() considered harmful?

JINMEI Tatuya / 神明達哉 jinmei at isc.org
Tue Feb 21 17:32:29 UTC 2012


At Tue, 21 Feb 2012 11:24:46 +0100,
Jelte Jansen <jelte at isc.org> wrote:

> > As the reporter of the ticket I support the proposal.  One note:
> > there are cases we cannot use EXPECT_<op> because sometimes the
> > class of the compared objects do not meet template requirements
> > (most commonly observed failure case is it doesn't have
> > corresponding operator<<).
> > 
> > Obviously, in such cases EXPECT_TRUE/FALSE should be allowed as a 
> > compromise.
> 
> Note that Shane only mentioned EXPECT_TRUE; for EXPECT_FALSE, we often
> intend exactly what we wrote; (eg. EXPECT_FALSE(a < a) or
> EXPECT_FALSE(small > large)). AFAIK there is no EXPECT_NOT_<op> (or,
> well, one could argue that EXPECT_FALSE is just that), and we do need
> to test the operator does not always return true :)

Ah, right, the difference between EXPECT_FALSE and EXPECT_NE (btw we
have EXPECT_NOT_==, which is EXPECT_NE) is not so significant in terms
of what happens on failure (EXPECT_NE might still be a bit more
helpful because we can know the value without additional explicit
typing, but the specific value wouldn't be that important compared to
the fact that they are unexpectedly equal).

---
JINMEI, Tatuya


More information about the bind10-dev mailing list