[bind10-dev] proposal: catching exceptions in run_unittests.cc:main()

Michal 'vorner' Vaner michal.vaner at nic.cz
Sat Jan 22 09:31:55 UTC 2011


On Fri, Jan 21, 2011 at 07:54:53PM -0800, JINMEI Tatuya / 神明達哉 wrote:
>  - typeid(type).name() may return mangled name, e.g. St13runtime_error
>    instead of std::runtime_error, in which case the result would be a
>    bit unreadable.  And this is the case for g++, and in this sense
>    this approach is a degradation for it (with the g++'s default
>    behavior we can see the demangled type name).  In practice, I think
>    it's okay, too, and if we worry about the degradation for g++ we
>    could selectively disable this hook for g++ (although I'd prefer
>    simplicity and use the same code for all compilers), or we could
>    add a filter to demangle the name (although I personally think it's
>    too much for the purpose here).

There's another regression on my system. When running under GDB and the
exception is thrown (and uncaught), GDB stops at the point when the exception is
thrown, before unwinding the stack, therefore all the reasons why it was thrown
and where is still clearly visible. With your proposal, it would show at the
bottom of this block, which already has no information.

So, it would be nice to have a library with main inside we could just link and
it could turn off/on the check for g++/anything else.

But aside for these implementation details, I think it is a good idea. Anyway, I
would like a practice where any tested code would still be wrapped in some kind
EXPECT_NO_THROW, one function after another.

Have a nice day

The problem with graduate students, in general, is that they have
to sleep every few days.

Michal 'vorner' Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20110122/dcc339f9/attachment.bin>

More information about the bind10-dev mailing list