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

View file

@ -5,11 +5,11 @@ Default="GambasSelftests.IntegerOverflows;IntegerOverflowsUnsafe"
[TestSuites/1] [TestSuites/1]
Name="Fast" 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] [TestSuites/2]
Name="Full" 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] [TestSuites/3]
Name="Slow tests" Name="Slow tests"
@ -17,5 +17,5 @@ Tests="FileReadWrite.FileReadWrite;ReadUrandom;ReadZero,SlowThousandsProcs.FewTh
[TestSuites/4] [TestSuites/4]
Name="Production" 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"