[Issue 8765] assert should print the source code for the condition when no message argument present

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Oct 11 08:36:20 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=8765

--- Comment #12 from Andrej Mitrovic <andrej.mitrovich at gmail.com> ---
(In reply to Walter Bright from comment #11)
> (In reply to Val Markovic from comment #0)
> > Currently I just get "unittest failure" instead of the condition
> > source, which is useless.
> 
> It gives the file/line, which is not useless:
> 
> 1. editors, IDEs, etc., can take you right to the source code of the error
> 
> 2. assert checks can add a great deal of bloat to the executable - the
> current implementation tries to minimize that. Adding expression strings to
> all of them will dramatically increase the size of an executable
> 
> I just do not understand why file/line is not sufficient.

If the assert is triggered at runtime in a realtime application you want to
make sure you get the relevant information back to you as soon as possible. You
may not even have the source at hand, it would really help knowing what
condition failed.

Code bloat is an issue, but if the requirement is a minimal binary then it
would be safe to assume -release is implied, no? So the asserts wouldn't be
compiled in anywho.

In any case I'll work on this PR again.

--


More information about the Digitalmars-d-bugs mailing list