none
Message: Unhandled C++ Exception RRS feed

  • Question

  • If a std::exception is thrown from my code, Test Explorer will just show "Message: Unhandled C++ Exception". It does show the proper stack trace though.

    Is it possible to have Test Explorer show the message from the what() method of std::exception?

    Wednesday, February 5, 2014 5:07 PM

Answers

  • Hi pmagalhaes,

    If you really want to know more detailed information about your test method, I suggest you debug your test in Test Explorer Window with Breakpoints.

    Right click your test method in Test Explorer->select debug test option.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 7, 2014 7:55 AM
    Moderator

All replies

  • Hi pmagalhaes,

    If you really want to know more detailed information about your test method, I suggest you debug your test in Test Explorer Window with Breakpoints.

    Right click your test method in Test Explorer->select debug test option.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 7, 2014 7:55 AM
    Moderator
  • In case anyone has this problem, here is a solution:

    http://durwella.tumblr.com/post/96457792632/extending-microsoft-cppunittestframework#96457792632

    Basically, a macro wrapper around TEST_METHOD which catches the std::exception and sends the message to Assert::Fail.

    Still, I wish this was default behaviour of CppUnitTest!

    Tuesday, February 13, 2018 4:16 PM
  • CppUnitTest should get some love in many areas. However, being able to see std::exception message is a basic feature!
    Thursday, November 28, 2019 3:14 PM