assertions in setup/teardown

63 views
Skip to first unread message

Karen Morrissey

unread,
Jun 26, 2013, 5:02:26 PM6/26/13
to cxxtes...@googlegroups.com
Something I couldn't find in the documentation: Can assertions be used within the setUp() and tearDown() methods of a test suite? How about within global setup and teardown?

I presume, since the scope is outside any test case to tie the failure to, that assertions cannot be used in world setup and teardown or in createSuite() and destroySuite().

Bill Hart

unread,
Jun 29, 2013, 1:05:14 AM6/29/13
to cxxtes...@googlegroups.com
Correct.  Test assertions cannot be used during the setup or teardown processes.

--Bill

Arjun Suresh Raji

unread,
Jun 16, 2014, 3:08:06 AM6/16/14
to cxxtes...@googlegroups.com
On Saturday, June 29, 2013 10:35:14 AM UTC+5:30, Bill Hart wrote:
Correct.  Test assertions cannot be used during the setup or teardown processes.

--Bill

Hi Bill,
I was exploring the sample code for Mock objects and I happened to find that setUp uses TS_ASSERT in this file "cxxtest-4.3/sample/mock/TestDice.h". 
Reply all
Reply to author
Forward
0 new messages