Merge branch 'master' of gitlab.com:gambas/gambas

This commit is contained in:
Benoît Minisini 2023-01-14 19:06:12 +01:00
commit 928914ea6b
2 changed files with 32 additions and 28 deletions

View file

@ -2343,29 +2343,33 @@ Fast Public Sub IntegerOverflows()
' ------------------------------------------------- Ignore Overflows
System.IgnoreOverflow = True
If Jit.Enabled = False Then
Test.Note("Ignore Short Overflow")
s = HighestShort + 1
System.IgnoreOverflow = True
Test.Note("Ignore Integer Overflow")
i = HighestInteger + 1
Test.Note("Ignore Short Overflow")
s = HighestShort + 1
Test.Note("Ignore Long Overflow")
l = HighestLong + 1
Test.Note("Ignore Integer Overflow")
i = HighestInteger + 1
Test.Note("Ignore Short Underflow")
s = LowestShort - 1
Test.Note("Ignore Long Overflow")
l = HighestLong + 1
Test.Note("Ignore Integer Underflow")
i = LowestInteger - 1
Test.Note("Ignore Short Underflow")
s = LowestShort - 1
Test.Note("Ignore Long Underflow")
l = LowestLong - 1
Test.Note("Ignore Integer Underflow")
i = LowestInteger - 1
' ------------------------------------------------- Restore original behavior
Test.Note("Ignore Long Underflow")
l = LowestLong - 1
System.IgnoreOverflow = bIgnoreOverflows
' ------------------------------------------------- Restore original behavior
System.IgnoreOverflow = bIgnoreOverflows
Endif
End
@ -2376,38 +2380,38 @@ Fast Unsafe Public Sub IntegerOverflowsUnsafe()
Dim l As Integer
If Jit.Enabled Then
Test.Plan(6)
Test.Note("Short Unsafe Overflow")
s = HighestShort + 1
Assert.Ok(s)
Assert.Noterror()
Test.Note("Integer Unsafe Overflow")
i = HighestInteger + 1
Assert.Ok(i)
Assert.Noterror()
Test.Note("Long Unsafe Overflow")
l = HighestLong + 1
Assert.Ok(l)
Assert.Noterror()
Test.Note("Short Unsafe Underflow")
s = LowestShort - 1
Assert.Ok(s)
Assert.Noterror()
Test.Note("Integer Unsafe Underflow")
i = LowestInteger - 1
Assert.Ok(i)
Assert.Noterror()
Test.Note("Long Unsafe Underflow")
l = LowestLong - 1
Assert.Ok(l)
Assert.Noterror()
Else
Else
Test.Note("Jit disabled")
Test.Plan(1)
'minimum 1 test
Assert.Equals(1, 1, "useless test, otherwise gb.test reports a failure")
Endif
End
End

View file

@ -5,11 +5,11 @@ Default="GambasSelftests.IntegerOverflows;IntegerOverflowsUnsafe"
[TestSuites/1]
Name="Fast"
Tests="Errorhandling.GeneralError,GambasSelftests.FastTests;IntegerOverflows;TCatch;TError;TVal,LocalStaticFun.CountALot;Saysth;SwingDoor"
Tests="Errorhandling.GeneralError,GambasSelftests.FastTests;IntegerOverflows;IntegerOverflowsUnsafe;TCatch;TError;TVal,LocalStaticFun.CountALot;Saysth;SwingDoor"
[TestSuites/2]
Name="Full"
Tests="Errorhandling.GeneralError,FileReadWrite.FileReadWrite;ReadUrandom;ReadZero,GambasSelftests.FastTests;IntegerOverflows;TCatch;TError;TVal,LocalStaticFun.CountALot;Saysth;SwingDoor,SlowThousandsProcs.FewThousandProcesses,Timers.Timers"
Tests="Errorhandling.GeneralError,FileReadWrite.FileReadWrite;ReadUrandom;ReadZero,GambasSelftests.FastTests;IntegerOverflows;IntegerOverflowsUnsafe;TCatch;TError;TVal,LocalStaticFun.CountALot;Saysth;SwingDoor,SlowThousandsProcs.FewThousandProcesses,Timers.Timers"
[TestSuites/3]
Name="Slow tests"
@ -17,5 +17,5 @@ Tests="FileReadWrite.FileReadWrite;ReadUrandom;ReadZero,SlowThousandsProcs.FewTh
[TestSuites/4]
Name="Production"
Tests="Errorhandling.GeneralError,FileReadWrite.FileReadWrite;ReadUrandom;ReadZero,GambasSelftests.FastTests;IntegerOverflows;TCatch;TError;TVal,LocalStaticFun.CountALot;Saysth;SwingDoor,SlowThousandsProcs.FewThousandProcesses"
Tests="Errorhandling.GeneralError,FileReadWrite.FileReadWrite;ReadUrandom;ReadZero,GambasSelftests.FastTests;IntegerOverflows;IntegerOverflowsUnsafe;TCatch;TError;TVal,LocalStaticFun.CountALot;Saysth;SwingDoor,SlowThousandsProcs.FewThousandProcesses"