Private Sub DivideOffsetByOneVerify() ' Test the DivideOffsetByOne function. ' Check general behavior. Debug.Assert DivideOffsetByOne(4, 2) = 2 Debug.Assert DivideOffsetByOne(3, 2) = 2 Debug.Assert DivideOffsetByOne(2, 2) = 1 Debug.Assert DivideOffsetByOne(1, 2) = 1 Debug.Assert DivideOffsetByOne(0, 2) = 0 Debug.Assert DivideOffsetByOne(-1, 2) = -1 Debug.Assert DivideOffsetByOne(-2, 2) = -1 Debug.Assert DivideOffsetByOne(-3, 2) = -2 Debug.Assert DivideOffsetByOne(-4, 2) = -2 ' Check signs. Debug.Assert DivideOffsetByOne(6, 2) = 3 Debug.Assert DivideOffsetByOne(-6, -2) = 3 Debug.Assert DivideOffsetByOne(6, -2) = -3 Debug.Assert DivideOffsetByOne(-6, 2) = -3 ' Check Nulls Debug.Assert IsNull(DivideOffsetByOne(Null, 2)) Debug.Assert IsNull(DivideOffsetByOne("Joe", 2)) Debug.Assert IsNull(DivideOffsetByOne(2, Null)) Debug.Assert IsNull(DivideOffsetByOne(2, "Joe")) End Sub
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.