RegressionTests__IntegerTest.st
changeset 15 99df9ea7f146
parent 14 bbcc61e38aaf
child 16 b10bb029410d
equal deleted inserted replaced
14:bbcc61e38aaf 15:99df9ea7f146
   107     t := maxVal + 1.
   107     t := maxVal + 1.
   108     self test:[t - 1 == maxVal].
   108     self test:[t - 1 == maxVal].
   109     t := minVal - 1.
   109     t := minVal - 1.
   110     self test:[t + 1 == minVal].
   110     self test:[t + 1 == minVal].
   111 
   111 
       
   112     self testLargeAddition.
   112     self testLargeMultiplication.
   113     self testLargeMultiplication.
   113     self testLargeDivision.
   114     self testLargeDivision.
   114     self testLargeAddition.
       
   115 
   115 
   116     "
   116     "
   117      self test1
   117      self test1
   118     "
   118     "
   119 
   119 
   123 testLargeAddition
   123 testLargeAddition
   124     "general conversion & arithmetic tests.
   124     "general conversion & arithmetic tests.
   125      Notice, the arithmetic tests are both performed via regular sends
   125      Notice, the arithmetic tests are both performed via regular sends
   126      and via constructed performs. The reason is to test both inlined
   126      and via constructed performs. The reason is to test both inlined
   127      JIT-compiler code AND the regular methods code."
   127      JIT-compiler code AND the regular methods code."
       
   128 
       
   129     |s|
   128 
   130 
   129     "Large + Large addition"
   131     "Large + Large addition"
   130     self testReading1.
   132     self testReading1.
   131 
   133 
   132     self test:[(20 factorial + 20 factorial) printString = '4865804016353280000'].
   134     self test:[(20 factorial + 20 factorial) printString = '4865804016353280000'].
   298     self test:[(Integer readFrom:'FFFFFFFF' radix:16) hexPrintString = 'FFFFFFFF'].
   300     self test:[(Integer readFrom:'FFFFFFFF' radix:16) hexPrintString = 'FFFFFFFF'].
   299     self test:[(Integer readFrom:'FFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFF'].
   301     self test:[(Integer readFrom:'FFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFF'].
   300     self test:[(Integer readFrom:'FFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFF'].
   302     self test:[(Integer readFrom:'FFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFF'].
   301     self test:[(Integer readFrom:'FFFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFFF'].
   303     self test:[(Integer readFrom:'FFFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFFF'].
   302     self test:[(Integer readFrom:'FFFFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFFFF'].
   304     self test:[(Integer readFrom:'FFFFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFFFF'].
       
   305     self test:[(Integer readFrom:'FFFFFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFFFFF'].
       
   306     self test:[(Integer readFrom:'FFFFFFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFFFFFF'].
   303 
   307 
   304     self test:[(Integer readFrom:'10000000' radix:16) hexPrintString = '10000000'].
   308     self test:[(Integer readFrom:'10000000' radix:16) hexPrintString = '10000000'].
   305     self test:[(Integer readFrom:'100000000' radix:16) hexPrintString = '100000000'].
   309     self test:[(Integer readFrom:'100000000' radix:16) hexPrintString = '100000000'].
   306     self test:[(Integer readFrom:'1000000000' radix:16) hexPrintString = '1000000000'].
   310     self test:[(Integer readFrom:'1000000000' radix:16) hexPrintString = '1000000000'].
   307     self test:[(Integer readFrom:'10000000000' radix:16) hexPrintString = '10000000000'].
   311     self test:[(Integer readFrom:'10000000000' radix:16) hexPrintString = '10000000000'].
   308     self test:[(Integer readFrom:'100000000000' radix:16) hexPrintString = '100000000000'].
   312     self test:[(Integer readFrom:'100000000000' radix:16) hexPrintString = '100000000000'].
       
   313     self test:[(Integer readFrom:'1000000000000' radix:16) hexPrintString = '1000000000000'].
       
   314     self test:[(Integer readFrom:'10000000000000' radix:16) hexPrintString = '10000000000000'].
   309 
   315 
   310     t := Integer readFrom:'FFFFFFFF' radix:16.
   316     t := Integer readFrom:'FFFFFFFF' radix:16.
   311     self test:[(t + 1) hexPrintString = '100000000'].
   317     self test:[(t + 1) hexPrintString = '100000000'].
   312     t := Integer readFrom:'FFFFFFFFF' radix:16.
   318     t := Integer readFrom:'FFFFFFFFF' radix:16.
   313     self test:[(t + 1) hexPrintString = '1000000000'].
   319     self test:[(t + 1) hexPrintString = '1000000000'].