<-- Previous || Up || Next -->

Bitwise Test Sub
Bitwise Class

Private Sub BitwiseTest()
    ' Perform a simple test of some of the bitwise binary functions.

    Debug.Assert ArithmeticShiftRight(1024, 9) = 2
    Debug.Assert ArithmeticShiftRight(-1024, 9) = -2
    Debug.Assert ArithmeticShiftRight(1024, 8) = 4
    Debug.Assert ArithmeticShiftRight(-1024, 8) = -4

    Debug.Assert RotateLeft(2, 9) = 1024
    Debug.Assert RotateLeft(4, 8) = 1024

    Debug.Assert RotateRight(1024, 9) = 2
    Debug.Assert RotateRight(1024, 8) = 4

    Debug.Assert ShiftLeft(2, 9) = 1024
    Debug.Assert ShiftLeft(-2, 9) = -1024
    Debug.Assert ShiftLeft(4, 8) = 1024
    Debug.Assert ShiftLeft(-4, 8) = -1024

    Debug.Assert ShiftRight(1024, 9) = 2
    Debug.Assert ShiftRight(1024, 8) = 4
End Sub

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.