[bind10-dev] EXPECT_TRUE() considered harmful?
Jelte Jansen
jelte at isc.org
Tue Feb 21 10:24:46 UTC 2012
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 02/21/2012 08:10 AM, JINMEI Tatuya / 神明達哉 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 :)
On a related note; should we also by default overload the relevant
operators if we have their corresponding methods? (i am just writing
one that has an equals() for instance)
Jelte
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk9DcO0ACgkQ4nZCKsdOncURCgCcCnHhvvekxrFhsjUKZYQGBTbj
lKYAmgKYNHfG+6ZmLyDKp267m8qzaAhE
=ekMt
-----END PGP SIGNATURE-----
More information about the bind10-dev
mailing list