Public Function IsGoodSwapEndian() As Boolean
' verify correct SwapEndian returns
' returns True if all tests are passed
  Dim fFailed As Boolean

  ' replace "SwapEndian04" with the name of your function to test
  If SwapEndian04(&H0) <> &H0 Then Stop: fFailed = True
  If SwapEndian04(&HFFFFFFFF) <> &HFFFFFFFF Then Stop: fFailed = True
  If SwapEndian04(&H12345678) <> &H78563412 Then Stop: fFailed = True
  If SwapEndian04(&H80000000) <> &H80 Then Stop: fFailed = True
  If SwapEndian04(&H80) <> &H80000000 Then Stop: fFailed = True
  If SwapEndian04(&H7FFFFFFF) <> &HFFFFFF7F Then Stop: fFailed = True

  ' well done
  IsGoodSwapEndian = Not fFailed

End Function


Back to SwapEndian