RegressionTests__IntegerTest.st
changeset 34 f52571b86f62
parent 33 f7b691b71cad
child 35 91703aab73bd
--- a/RegressionTests__IntegerTest.st	Wed Jun 09 17:49:23 1999 +0200
+++ b/RegressionTests__IntegerTest.st	Fri Jun 11 15:24:41 1999 +0200
@@ -549,6 +549,33 @@
 
     "Large + Small addition"
 
+    self testLargeAddition1.
+
+    "Large + Large addition"
+
+    self testLargeAddition2.
+
+    "Large - small subtraction"
+
+    self testLargeAddition3.
+
+    "
+     self testLargeAddition
+    "
+
+    "Modified: / 4.6.1999 / 15:26:55 / cg"
+!
+
+testLargeAddition1
+    "general conversion & arithmetic tests.
+     Notice, the arithmetic tests are both performed via regular sends
+     and via constructed performs. The reason is to test both inlined
+     JIT-compiler code AND the regular methods code."
+
+    |s n1 n2 x|
+
+    "Large + Small addition"
+
     n1 := 16r3FFFFFFF. n2 := 1.
     self test:[(n1 + n2 ) hexPrintString = '40000000'].
     self test:[(n1 perform:'+' asSymbol with:n2 ) hexPrintString = '40000000'].
@@ -577,6 +604,21 @@
     self test:[(n1 + n2 ) hexPrintString = '4000000000000000'].
     self test:[(n1 perform:'+' asSymbol with:n2 ) hexPrintString = '4000000000000000'].
 
+    "
+     self testLargeAddition1
+    "
+
+    "Modified: / 4.6.1999 / 15:26:55 / cg"
+!
+
+testLargeAddition2
+    "general conversion & arithmetic tests.
+     Notice, the arithmetic tests are both performed via regular sends
+     and via constructed performs. The reason is to test both inlined
+     JIT-compiler code AND the regular methods code."
+
+    |s n1 n2 x|
+
     "Large + Large addition"
 
     n1 := 16r100000000. n2 := 16r7FFFFFFF.
@@ -632,6 +674,20 @@
     self test:[(n1 perform:'-' asSymbol with:16r10000000) hexPrintString = 'F0000000'].
     self test:[(16r100000000 perform:'-' asSymbol with:16r10000000) hexPrintString = 'F0000000'].
 
+    "
+     self testLargeAddition2
+    "
+
+!
+
+testLargeAddition3
+    "general conversion & arithmetic tests.
+     Notice, the arithmetic tests are both performed via regular sends
+     and via constructed performs. The reason is to test both inlined
+     JIT-compiler code AND the regular methods code."
+
+    |s n1 n2 x|
+
     "Large - small subtraction"
     self test:[(20 factorial + 20 factorial - 1) printString = '4865804016353279999'].
     self test:[(20 factorial - 10 factorial + 3628800) printString = '2432902008176640000'].
@@ -644,10 +700,9 @@
     self test:[(20 factorial + 10 factorial - 3628800) printString = '2432902008176640000'].
 
     "
-     self testLargeAddition
+     self testLargeAddition3
     "
 
-    "Modified: / 4.6.1999 / 15:26:55 / cg"
 !
 
 testLargeDivision
@@ -1063,6 +1118,62 @@
 
     "Modified: / 9.6.1999 / 17:47:56 / cg"
     "Created: / 9.6.1999 / 17:49:45 / cg"
+!
+
+testSmallIntegerMultiplication2
+    "multiply tests.
+     Notice, the arithmetic tests are both performed via regular sends
+     and via constructed performs. The reason is to test both inlined
+     JIT-compiler code AND the regular methods code."
+
+    |s n1 n2 t|
+
+    n1 := 100000.
+    n2 := n1 negated.
+
+    self test:[(n1 * 2) printString = '200000'].
+    self test:[(n1 perform:'*' asSymbol with:2) printString = '200000'].
+    self test:[(n1 * 3) printString = '300000'].
+    self test:[(n1 perform:'*' asSymbol with:3) printString = '300000'].
+    self test:[(n1 * 4) printString = '400000'].
+    self test:[(n1 perform:'*' asSymbol with:4) printString = '400000'].
+    self test:[(n1 * 5) printString = '500000'].
+    self test:[(n1 perform:'*' asSymbol with:5) printString = '500000'].
+    self test:[(n1 * 6) printString = '600000'].
+    self test:[(n1 perform:'*' asSymbol with:6) printString = '600000'].
+    self test:[(n1 * 7) printString = '700000'].
+    self test:[(n1 perform:'*' asSymbol with:7) printString = '700000'].
+    self test:[(n1 * 8) printString = '800000'].
+    self test:[(n1 perform:'*' asSymbol with:8) printString = '800000'].
+    self test:[(n1 * 9) printString = '900000'].
+    self test:[(n1 perform:'*' asSymbol with:9) printString = '900000'].
+    self test:[(n1 * 10) printString = '1000000'].
+    self test:[(n1 perform:'*' asSymbol with:10) printString = '1000000'].
+    self test:[(n1 * 11) printString = '1100000'].
+    self test:[(n1 perform:'*' asSymbol with:11) printString = '1100000'].
+    self test:[(n1 * 12) printString = '1200000'].
+    self test:[(n1 perform:'*' asSymbol with:12) printString = '1200000'].
+    self test:[(n1 * 13) printString = '1300000'].
+    self test:[(n1 perform:'*' asSymbol with:13) printString = '1300000'].
+    self test:[(n1 * 14) printString = '1400000'].
+    self test:[(n1 perform:'*' asSymbol with:14) printString = '1400000'].
+    self test:[(n1 * 15) printString = '1500000'].
+    self test:[(n1 perform:'*' asSymbol with:15) printString = '1500000'].
+    self test:[(n1 * 16) printString = '1600000'].
+    self test:[(n1 perform:'*' asSymbol with:16) printString = '1600000'].
+    self test:[(n1 * 17) printString = '1700000'].
+    self test:[(n1 perform:'*' asSymbol with:17) printString = '1700000'].
+    self test:[(n1 * 18) printString = '1800000'].
+    self test:[(n1 perform:'*' asSymbol with:18) printString = '1800000'].
+    self test:[(n1 * 19) printString = '1900000'].
+    self test:[(n1 perform:'*' asSymbol with:19) printString = '1900000'].
+
+    "
+     self testSmallIntegerMultiplication2
+    "
+
+    "Modified: / 9.6.1999 / 17:47:56 / cg"
+    "Created: / 9.6.1999 / 17:49:45 / cg"
 ! !
 
 !IntegerTest class methodsFor:'documentation'!