Can we use constructor and destructor instead of tuning and stalling?

setup () and teardown () do the same thing as constructor and destructor. If not, how are they different? if so, why can't we use the constructor and destructor instead.

+3
source share
1 answer

SetUp and tearDown cannot be replaced by constructor and destructor, as they are internally protected from exceptions thrown by approval macros. This way you can add an affirmation macro to setUp or tearDown, but you cannot do this in the destructor and you will have some problems in the constructor.

cppunit Junit, . setUp tearDown setUp/tearDown.

+3

All Articles