D - postconditions?
- Evan McClanahan (6/6) Dec 18 2002 Is there any way to do tests on out/inout stuff that gets changed in
- Russell Lewis (7/14) Dec 18 2002 Are you talking about testing the effects of a function, not just the
- Walter (3/9) Dec 18 2002 Yes, just put the assert's in the out { } block.
- Evan McClanahan (3/4) Dec 19 2002 That's odd, I could have sworn that didn't work before. Sorry...
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
Dec 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. EvanAre 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.
Dec 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
Dec 18 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
Dec 19 2002