comment about using constructor and destructor in cppunit tests

Markus Mohrhard markus.mohrhard at googlemail.com
Thu Sep 27 16:28:58 PDT 2012


Hey Matus,

I just saw that you started using the constructor and the destructor
in the tubes unit test. It would be a better idea to move this into
setUp and tearDown and check there with CPPUNIT_ASSERT that all
variables are set. In contrast to the constructor and the destructor
setUp and tearDown are protected inside the cppunit framework against
thrown exceptions. In general using the constructor and destructor in
a cppunit test should only be done for the few cases where it is
really necessary and setUp and tearDown are no alternative.

Regards,
Markus


More information about the LibreOffice mailing list