33 lines
705 B
Text
33 lines
705 B
Text
' Gambas class file
|
|
|
|
'' Name of this class has to start with d8e8fca2dc0f896fd7cb4cb0031ba249 to signal that its an internal test
|
|
Inherits ATestContainer
|
|
|
|
Public Const constDegUnittestSelftest As Boolean = True
|
|
|
|
Public Sub TestError()
|
|
|
|
Dim a As Long
|
|
|
|
If Me.Debug Then
|
|
Print "GuTestIntentionalError::TestError"
|
|
Endif
|
|
|
|
Try a = 3 / 0
|
|
Me.Result.AssertError(Error.Code, Error.Text)
|
|
|
|
'Try a = 2 * 3
|
|
Me.Result.AssertError(Error.Code, Error.Text, 26, "Intentional Failure. If this is a failure, then all is ok.")
|
|
|
|
End
|
|
|
|
Public Sub TestDivisionByZeroError()
|
|
|
|
Dim a As Long
|
|
|
|
Me.Result.AddTrace("This will be a crash, then its ok")
|
|
|
|
'This is a crash
|
|
a = 3 / 0
|
|
|
|
End
|