assert(condition[, message]) patch
Sean Kelly
sean at f4.ca
Mon Jul 31 11:09:07 PDT 2006
Joseph Lisee wrote:
> In article <e5l5v8$1g7j$1 at digitaldaemon.com>,
> Tom S <h3r3tic at remove.mat.uni.torun.pl> wrote:
>
>> Lars Ivar Igesund wrote:
>>> Because not all the users will have access to the source, or be inclined to
>>> see it. Unless the user get's a readable/understandable assert message
>>> he/she might not get enough information to actually reproduce a test case
>>> for the developer to peruse.
>>>
>>> Walter, this is a no-brainer, please put it in.
>> ++votes;
>>
>> /+
>> when you release your app to some testing team, you might want to leave
>> asserts in. While an error message containing the line number and
>> filename could be helpful, an additional message could be priceless.
>> E.g. assert(fileNameContainsNoSpaces(foo)); won't tell you that the
>> 'foo' really was something like '^&^34 5+23 3(43D678[SAFer6_[]' which
>> might mean some mem corruption or forgetting a .dup somewhere in your
>> code. You'd instead go searching for some logic problems that wouldn't
>> solve the problem.
>> +/
>
> I vote for the assert(condition, "msg"), construct as well.
This feature was added a number of builds ago.
Sean
More information about the Digitalmars-d
mailing list