Thread overview
postconditions?
Dec 18, 2002
Evan McClanahan
Dec 18, 2002
Russell Lewis
Dec 18, 2002
Walter
Dec 19, 2002
Evan McClanahan
December 18, 2002
Is there any way to do tests on out/inout stuff that gets changed in functions in the function postconditions?  Although I guess you can use other contracts to get around this lack, I think that it would be nice to be able to test them in the postcondition code, so that all of the tests for the functions are in the same place.

Evan

December 18, 2002
Evan McClanahan wrote:
> Is there any way to do tests on out/inout stuff that gets changed in functions in the function postconditions?  Although I guess you can use other contracts to get around this lack, I think that it would be nice to be able to test them in the postcondition code, so that all of the tests for the functions are in the same place.
> 
> Evan

Are you talking about testing the effects of a function, not just the result?  That might be better tested in a unittest function that runs the function many times with different inputs and then checks the result.  I think (not 100% sure) that you can defined multiple unittests in a single module; I would write the unittest right next to the function declaration.

December 18, 2002
Yes, just put the assert's in the out { } block.

"Evan McClanahan" <evan@dontSPAMaltarinteractive.com> wrote in message news:atq57d$2nr6$1@digitaldaemon.com...
> Is there any way to do tests on out/inout stuff that gets changed in functions in the function postconditions?  Although I guess you can use other contracts to get around this lack, I think that it would be nice to be able to test them in the postcondition code, so that all of the tests for the functions are in the same place.
>
> Evan
>


December 19, 2002
Walter wrote:
> Yes, just put the assert's in the out { } block.

That's odd, I could have sworn that didn't work before.  Sorry...

Evan