Menu

#10 Possible overflow on CheckCalledCount variable

v1.0 (example)
open
nobody
None
6
2014-08-18
2014-08-12
Nick Ring
No

When range checking is turned on and there is a lot of checks done (I have a set of tests that causes overflow issues), it is possible for https://sourceforge.net/p/dunit2/code/HEAD/tree/trunk/src/TestFramework.pas#l1481

Inc(FCheckCalledCount);

to overflow.

Solution: To change the variable https://sourceforge.net/p/dunit2/code/HEAD/tree/trunk/src/TestFramework.pas#l670 to be of type UInt64 (as there isn't any possibility to have a negative count of checks). If UInt64 isn't available, I would suggest Int64.

Discussion


Log in to post a comment.