5 Commits

Author SHA1 Message Date
Miklos Vajna
839e53b933 compilerplugins: enable loplugin:cppunitassertequals by default
This forces writing a comparision of two variables in the
CPPUNIT_ASSERT_EQUALS(expected, actual) form, rather than
CPPUNIT_ASSERT(actual == expected). The benefit is when the test fail,
it's more clear what are these two values, rather than just seeing that
they are not equal.

In the relatively rare case when the types are not streamable, the
plugin can be silenced using CPPUNIT_ASSERT(bool(it == foo.end())). But
please always first consider making the type streamable instead. See
commit 0e1b831b93048c68735f2e2dbdcee587db4862ef
(CppunitTest_vcl_complextext: fix loplugin:cppunitassertequals warnings,
2016-12-16) for an example.

Change-Id: I564fb0724836b6dbbea9262b53ad646e285a339c
2017-02-03 12:20:03 +01:00
Noel Grandin
994e38e336 loplugin: use TypeCheck instead of getQualifiedNameAsString
since the latter is rather slow

Change-Id: Ib73cdb923585580777c2265b561c1808e93b2baa
Reviewed-on: https://gerrit.libreoffice.org/33585
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01 12:49:42 +00:00
Stephan Bergmann
733198de1b Remove support for Clang < 3.4
Change-Id: I81e97c5f720535b33dd3ce72d01151765e4e93a0
2016-06-29 09:15:25 +02:00
Markus Mohrhard
a3d8833bd8 fix crash in cppunitassertequals plugin
Change-Id: I0427c70aa3a7f55aba4bbe0fe571aab08596541a
Reviewed-on: https://gerrit.libreoffice.org/22922
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-03-05 11:44:27 +00:00
Noel Grandin
e236cc1676 new loplugin:cppunitassertequals
look for places we should be calling CPPUNIT_ASSERT_EQUALS instead of
CPPUNIT_ASSERT

Change-Id: Ia836555d569069c6d0dce592f1c9a78bf8d8adb8
2016-02-24 13:35:05 +02:00