#2 shuAssert and shuDeny input arguments

closed
Bobby Nations
None
5
2005-12-27
2005-04-18
Stephen Peterson
No

The two arguments for shuAssert and shuDeny should be
reversed. That is, the message should be specified
after the boolResult, and here is why:

Currently, if either function is called without a
message string (the name of the function should be
descriptive enough) the retcode (0=TRUE or 1=FALSE)
goes to the message and the boolResult defaults to a
value that causes the test to fail.

Discussion

  • Bobby Nations
    Bobby Nations
    2005-12-27

    • assigned_to: nobody --> bobbynations
    • status: open --> closed
     
  • Bobby Nations
    Bobby Nations
    2005-12-27

    Logged In: YES
    user_id=425916

    Stephen,

    I've given your suggestion some thought, and I'm afraid that
    I don't agree with your rationale. It' fairly common to
    have multiple shuAssert's or shuDeny's called from a single
    function; which means that it might be tricky to figure out
    which one actually failed without the user supplied message.
    This wouldn't be a problem in most languages (c, c++, java,
    heck even bash) as it's usually possible to at least report
    the line number being executed. Unfortunately, this isn't
    the case for the Bourne shell AFAIK.

    So, in short, we need the message in order to distinguish
    between the shuAssert/shuDeny when there are multiple called
    from within a single function.

    Thanks for the suggestion, and please keep giving good feedback.

    Cheers,

    Bobby