Menu

#17 CFIXCC_METHOD_EXPECT_EXCEPTION and MFC CException

1.0
open
nobody
5
2011-04-29
2011-04-29
Anonymous
No

The CFIXCC_METHOD_EXPECT_EXCEPTION macro fails to catch MFC exceptions which are thrown by pointer.
Since CException is derived from CObject whose constructor is private, MFC leaves us no other choice than catching its exceptions by pointer.
However, cfix catches exceptions by reference.

Step to reproduce:
1) Create a test with CFIXCC_METHOD_EXPECT_EXCEPTION(CFileTest, CFileException)
2) throw a new CFileException within the test method, cfix reports an unhandled exception

Discussion


Log in to post a comment.

MongoDB Logo MongoDB