2009/12/14 Vlad <v...@demoninsight.com>
> I am puzzled why it works for you unless you've patched your version (as I > have just done). I've checked my svn snapshot and CheckMacros.h is in sync > with the official trunk. > > Since in > > #define CHECK(value) \ > do \ > { \ > try { \ > if (!UnitTest::Check(value)) \ > > > UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), > __LINE__), #value); \ > } \ > catch (...) { \ > > > UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), > __LINE__), \ > "Unhandled exception in CHECK(" #value ")"); \ > } \ > } while (0) > > there is no catch(std::exception & e) I don't understand how the value of > what() gets preserved. > > In my case, the message would be simply > > Unhandled exception in CHECK_EQUAL(A,B) > > > On Dec 14, 2009, at 1:22 PM, Patrick Johnmeyer wrote: > > Vlad, > > Not sure what you are referring to. If I do CHECK_EQUAL(A,B) and B throws > a std::exception (or something that inherits from it), I get output like : > > error: Failure in VerifyBlahBlah: Unhandled exception: HOO-HA! > > > where HOO-HA! is the return value of what(). > > Can you provide a simple concrete example that exhibits your problem? > > pj > > On Mon, Dec 14, 2009 at 12:58 PM, Vlad <v...@demoninsight.com> wrote: > >> Greetings, >> >> Is there a patch or feature set change planned such that all the >> "Unhandled exception in ..." messages would also include the what() of the >> actual underlying exception? It is a common case for me that one of the >> macro arguments throws and then I need to change CHECK_EQUAL (A, B) into >> >> bool b = A == B; >> CHECK (b); >> >> to see the helpful info. It would be nice not to have to do that. >> >> >> Thanks, >> Vlad >> >> ------------------------------------------------------------------------------ >> Return on Information: >> Google Enterprise Search pays you back >> Get the facts. >> http://p.sf.net/sfu/google-dev2dev >> _______________________________________________ >> unittest-cpp-devel mailing list >> unittest-cpp-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/unittest-cpp-devel >> > > > ------------------------------------------------------------------------------ > Return on Information: > Google Enterprise Search pays you back > Get the facts. > http://p.sf.net/sfu/google-dev2dev > _______________________________________________ > unittest-cpp-devel mailing list > unittest-cpp-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/unittest-cpp-devel > > > > > ------------------------------------------------------------------------------ > Return on Information: > Google Enterprise Search pays you back > Get the facts. > http://p.sf.net/sfu/google-dev2dev > > _______________________________________________ > unittest-cpp-devel mailing list > unittest-cpp-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/unittest-cpp-devel > > IIRC That is an exception being thrown from the equality check not the actual operation under test. The operation under test is scoped inside a try catch block which does output the result of what if it is derived from std::exception.
------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev
_______________________________________________ unittest-cpp-devel mailing list unittest-cpp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/unittest-cpp-devel