On Mon, Dec 14, 2009 at 1:45 PM, liam mail <liam.l...@googlemail.com> wrote:
> > 2009/12/14 Vlad <v...@demoninsight.com> > > In my case, the message would be simply >> >> Unhandled exception in CHECK_EQUAL(A,B) >> >> 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. > That is correct, this is the error you get if the comparison operation throws. The error "Failure in VerifyBlahBlah: Unhandled exception: HOO-HA!" results from the test-wide try/catch block when evaluating A or B throws, but has the disadvantage of not knowing the file / line of the failure. The error "Unhandled exception in CHECK_EQUAL(A,B)" when operator== throws is both simultaneously more informative (includes file, line, expected, and actual -- unless of course streaming expected or actual crashes as well) and less informative (doesn't include the exception string). It would be nice if the std::exception special case was in all UT++ try / catch blocks so that in the latter case you'd get more info. Sounds like a feature request / patch. All that being said, typically operator== is written to be a non-throwing function, so I would think the latter message would be more than sufficient to indicate that there's a serious problem.
------------------------------------------------------------------------------ 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