]> granicus.if.org Git - check/commit
report correct error if teardown after failure in no fork mode
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Fri, 28 Nov 2014 05:50:22 +0000 (05:50 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Fri, 28 Nov 2014 05:50:22 +0000 (05:50 +0000)
commite60390d54ab3a065f53d4e7150a79424b8a85fae
tree19f74a5d5d987aa6a47691ae65392c9d78c2688a
parent9b6ebbd89b1a59c4b3e8de6b19877a043b1323b1
report correct error if teardown after failure in no fork mode

In nofork mode, the location of a failed assertion within a test
case is lost if that test case has a checked teardown fixture
(even if that fixture function is empty).

The reason why this happens is this: the end of the message sequence
coming down the pipe is CK_MSG_LOC (location of failing test),
CK_MSG_FAIL, CK_MSG_CTX (TEARDOWN). It is this final message that
confuses things, because rcvmsg_update_ctx() updates rmsg->lastctx
(which I suspect is the right thing for it to do), which is the ctx
value used by the first 'if' body in construct_test_result() in its
call to tr_set_loc_by_ctx().

The solution is to initialize tr->ctx to rmsg->failctx if
it is not CK_CTX_INVALID.

Bug #99.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1193 64e312b2-a51f-0410-8e61-82d0ca0eb02a
AUTHORS
CMakeLists.txt
NEWS
src/check_msg.c
tests/CMakeLists.txt
tests/Makefile.am
tests/check_nofork_teardown.c [new file with mode: 0644]
tests/test_check_nofork_teardown.sh [new file with mode: 0755]