Update VMTests with Stint, raise Exception for non-implemented Exp and byteOp instead of quitting

This commit is contained in:
mratsim 2018-05-11 18:16:35 +02:00
parent 8f95c86944
commit 9fc80cb6c9
4 changed files with 241 additions and 242 deletions

View File

@ -2,153 +2,153 @@ VMTests
=== ===
## vmArithmeticTest ## vmArithmeticTest
```diff ```diff
+ add0.json OK - add0.json Fail
+ add1.json OK - add1.json Fail
+ add2.json OK + add2.json OK
+ add3.json OK + add3.json OK
+ add4.json OK + add4.json OK
+ addmod0.json OK - addmod0.json Fail
+ addmod1.json OK - addmod1.json Fail
+ addmod1_overflow2.json OK + addmod1_overflow2.json OK
+ addmod1_overflow3.json OK + addmod1_overflow3.json OK
+ addmod1_overflow4.json OK - addmod1_overflow4.json Fail
+ addmod1_overflowDiff.json OK - addmod1_overflowDiff.json Fail
+ addmod2.json OK - addmod2.json Fail
+ addmod2_0.json OK + addmod2_0.json OK
+ addmod2_1.json OK - addmod2_1.json Fail
+ addmod3.json OK - addmod3.json Fail
+ addmod3_0.json OK + addmod3_0.json OK
+ addmodBigIntCast.json OK + addmodBigIntCast.json OK
+ addmodDivByZero.json OK + addmodDivByZero.json OK
+ addmodDivByZero1.json OK + addmodDivByZero1.json OK
+ addmodDivByZero2.json OK + addmodDivByZero2.json OK
+ addmodDivByZero3.json OK - addmodDivByZero3.json Fail
arith1.json Skip arith1.json Skip
+ div1.json OK + div1.json OK
+ divBoostBug.json OK - divBoostBug.json Fail
+ divByNonZero0.json OK - divByNonZero0.json Fail
+ divByNonZero1.json OK + divByNonZero1.json OK
+ divByNonZero2.json OK + divByNonZero2.json OK
+ divByNonZero3.json OK - divByNonZero3.json Fail
+ divByZero.json OK + divByZero.json OK
+ divByZero_2.json OK - divByZero_2.json Fail
+ exp0.json OK - exp0.json Fail
+ exp1.json OK - exp1.json Fail
+ exp2.json OK - exp2.json Fail
+ exp3.json OK - exp3.json Fail
+ exp4.json OK - exp4.json Fail
+ exp5.json OK - exp5.json Fail
+ exp6.json OK - exp6.json Fail
+ exp7.json OK - exp7.json Fail
+ expPowerOf256Of256_0.json OK - expPowerOf256Of256_0.json Fail
+ expPowerOf256Of256_1.json OK - expPowerOf256Of256_1.json Fail
+ expPowerOf256Of256_10.json OK - expPowerOf256Of256_10.json Fail
+ expPowerOf256Of256_11.json OK - expPowerOf256Of256_11.json Fail
+ expPowerOf256Of256_12.json OK - expPowerOf256Of256_12.json Fail
+ expPowerOf256Of256_13.json OK - expPowerOf256Of256_13.json Fail
+ expPowerOf256Of256_14.json OK - expPowerOf256Of256_14.json Fail
+ expPowerOf256Of256_15.json OK - expPowerOf256Of256_15.json Fail
+ expPowerOf256Of256_16.json OK - expPowerOf256Of256_16.json Fail
+ expPowerOf256Of256_17.json OK - expPowerOf256Of256_17.json Fail
+ expPowerOf256Of256_18.json OK - expPowerOf256Of256_18.json Fail
+ expPowerOf256Of256_19.json OK - expPowerOf256Of256_19.json Fail
+ expPowerOf256Of256_2.json OK - expPowerOf256Of256_2.json Fail
+ expPowerOf256Of256_20.json OK - expPowerOf256Of256_20.json Fail
+ expPowerOf256Of256_21.json OK - expPowerOf256Of256_21.json Fail
+ expPowerOf256Of256_22.json OK - expPowerOf256Of256_22.json Fail
+ expPowerOf256Of256_23.json OK - expPowerOf256Of256_23.json Fail
+ expPowerOf256Of256_24.json OK - expPowerOf256Of256_24.json Fail
+ expPowerOf256Of256_25.json OK - expPowerOf256Of256_25.json Fail
+ expPowerOf256Of256_26.json OK - expPowerOf256Of256_26.json Fail
+ expPowerOf256Of256_27.json OK - expPowerOf256Of256_27.json Fail
+ expPowerOf256Of256_28.json OK - expPowerOf256Of256_28.json Fail
+ expPowerOf256Of256_29.json OK - expPowerOf256Of256_29.json Fail
+ expPowerOf256Of256_3.json OK - expPowerOf256Of256_3.json Fail
+ expPowerOf256Of256_30.json OK - expPowerOf256Of256_30.json Fail
+ expPowerOf256Of256_31.json OK - expPowerOf256Of256_31.json Fail
- expPowerOf256Of256_32.json Fail - expPowerOf256Of256_32.json Fail
- expPowerOf256Of256_33.json Fail - expPowerOf256Of256_33.json Fail
+ expPowerOf256Of256_4.json OK - expPowerOf256Of256_4.json Fail
+ expPowerOf256Of256_5.json OK - expPowerOf256Of256_5.json Fail
+ expPowerOf256Of256_6.json OK - expPowerOf256Of256_6.json Fail
+ expPowerOf256Of256_7.json OK - expPowerOf256Of256_7.json Fail
+ expPowerOf256Of256_8.json OK - expPowerOf256Of256_8.json Fail
+ expPowerOf256Of256_9.json OK - expPowerOf256Of256_9.json Fail
+ expPowerOf256_1.json OK - expPowerOf256_1.json Fail
+ expPowerOf256_10.json OK - expPowerOf256_10.json Fail
+ expPowerOf256_11.json OK - expPowerOf256_11.json Fail
+ expPowerOf256_12.json OK - expPowerOf256_12.json Fail
+ expPowerOf256_13.json OK - expPowerOf256_13.json Fail
+ expPowerOf256_14.json OK - expPowerOf256_14.json Fail
+ expPowerOf256_15.json OK - expPowerOf256_15.json Fail
+ expPowerOf256_16.json OK - expPowerOf256_16.json Fail
+ expPowerOf256_17.json OK - expPowerOf256_17.json Fail
+ expPowerOf256_18.json OK - expPowerOf256_18.json Fail
+ expPowerOf256_19.json OK - expPowerOf256_19.json Fail
+ expPowerOf256_2.json OK - expPowerOf256_2.json Fail
+ expPowerOf256_20.json OK - expPowerOf256_20.json Fail
+ expPowerOf256_21.json OK - expPowerOf256_21.json Fail
+ expPowerOf256_22.json OK - expPowerOf256_22.json Fail
+ expPowerOf256_23.json OK - expPowerOf256_23.json Fail
+ expPowerOf256_24.json OK - expPowerOf256_24.json Fail
+ expPowerOf256_25.json OK - expPowerOf256_25.json Fail
+ expPowerOf256_26.json OK - expPowerOf256_26.json Fail
+ expPowerOf256_27.json OK - expPowerOf256_27.json Fail
+ expPowerOf256_28.json OK - expPowerOf256_28.json Fail
+ expPowerOf256_29.json OK - expPowerOf256_29.json Fail
+ expPowerOf256_3.json OK - expPowerOf256_3.json Fail
+ expPowerOf256_30.json OK - expPowerOf256_30.json Fail
+ expPowerOf256_31.json OK - expPowerOf256_31.json Fail
+ expPowerOf256_32.json OK - expPowerOf256_32.json Fail
+ expPowerOf256_33.json OK - expPowerOf256_33.json Fail
+ expPowerOf256_4.json OK - expPowerOf256_4.json Fail
+ expPowerOf256_5.json OK - expPowerOf256_5.json Fail
+ expPowerOf256_6.json OK - expPowerOf256_6.json Fail
+ expPowerOf256_7.json OK - expPowerOf256_7.json Fail
+ expPowerOf256_8.json OK - expPowerOf256_8.json Fail
+ expPowerOf256_9.json OK - expPowerOf256_9.json Fail
+ expPowerOf2_128.json OK - expPowerOf2_128.json Fail
+ expPowerOf2_16.json OK - expPowerOf2_16.json Fail
+ expPowerOf2_2.json OK - expPowerOf2_2.json Fail
+ expPowerOf2_256.json OK - expPowerOf2_256.json Fail
+ expPowerOf2_32.json OK - expPowerOf2_32.json Fail
+ expPowerOf2_4.json OK - expPowerOf2_4.json Fail
+ expPowerOf2_64.json OK - expPowerOf2_64.json Fail
+ expPowerOf2_8.json OK - expPowerOf2_8.json Fail
- expXY.json Fail - expXY.json Fail
- expXY_success.json Fail - expXY_success.json Fail
+ fibbonacci_unrolled.json OK + fibbonacci_unrolled.json OK
+ mod0.json OK - mod0.json Fail
+ mod1.json OK - mod1.json Fail
+ mod2.json OK + mod2.json OK
+ mod3.json OK + mod3.json OK
+ mod4.json OK - mod4.json Fail
+ modByZero.json OK - modByZero.json Fail
+ mul0.json OK - mul0.json Fail
+ mul1.json OK - mul1.json Fail
+ mul2.json OK + mul2.json OK
+ mul3.json OK - mul3.json Fail
+ mul4.json OK - mul4.json Fail
+ mul5.json OK + mul5.json OK
+ mul6.json OK - mul6.json Fail
+ mul7.json OK + mul7.json OK
- mulUnderFlow.json Fail - mulUnderFlow.json Fail
+ mulmod0.json OK + mulmod0.json OK
+ mulmod1.json OK - mulmod1.json Fail
- mulmod1_overflow.json Fail - mulmod1_overflow.json Fail
+ mulmod1_overflow2.json OK + mulmod1_overflow2.json OK
+ mulmod1_overflow3.json OK - mulmod1_overflow3.json Fail
+ mulmod1_overflow4.json OK - mulmod1_overflow4.json Fail
+ mulmod2.json OK - mulmod2.json Fail
+ mulmod2_0.json OK + mulmod2_0.json OK
+ mulmod2_1.json OK - mulmod2_1.json Fail
+ mulmod3.json OK - mulmod3.json Fail
+ mulmod3_0.json OK + mulmod3_0.json OK
- mulmod4.json Fail - mulmod4.json Fail
+ mulmoddivByZero.json OK + mulmoddivByZero.json OK
+ mulmoddivByZero1.json OK + mulmoddivByZero1.json OK
+ mulmoddivByZero2.json OK + mulmoddivByZero2.json OK
+ mulmoddivByZero3.json OK - mulmoddivByZero3.json Fail
+ not1.json OK + not1.json OK
+ sdiv0.json OK + sdiv0.json OK
+ sdiv1.json OK + sdiv1.json OK
@ -162,24 +162,24 @@ VMTests
+ sdiv9.json OK + sdiv9.json OK
+ sdivByZero0.json OK + sdivByZero0.json OK
+ sdivByZero1.json OK + sdivByZero1.json OK
+ sdivByZero2.json OK - sdivByZero2.json Fail
- sdiv_dejavu.json Fail - sdiv_dejavu.json Fail
+ sdiv_i256min.json OK + sdiv_i256min.json OK
+ sdiv_i256min2.json OK + sdiv_i256min2.json OK
+ sdiv_i256min3.json OK + sdiv_i256min3.json OK
+ signextendInvalidByteNumber.json OK - signextendInvalidByteNumber.json Fail
+ signextend_00.json OK + signextend_00.json OK
+ signextend_0_BigByte.json OK - signextend_0_BigByte.json Fail
+ signextend_AlmostBiggestByte.json OK - signextend_AlmostBiggestByte.json Fail
+ signextend_BigByteBigByte.json OK - signextend_BigByteBigByte.json Fail
+ signextend_BigBytePlus1_2.json OK - signextend_BigBytePlus1_2.json Fail
+ signextend_BigByte_0.json OK + signextend_BigByte_0.json OK
+ signextend_BitIsNotSet.json OK - signextend_BitIsNotSet.json Fail
+ signextend_BitIsNotSetInHigherByte.json OK - signextend_BitIsNotSetInHigherByte.json Fail
+ signextend_BitIsSetInHigherByte.json OK - signextend_BitIsSetInHigherByte.json Fail
- signextend_Overflow_dj42.json Fail - signextend_Overflow_dj42.json Fail
+ signextend_bigBytePlus1.json OK - signextend_bigBytePlus1.json Fail
+ signextend_bitIsSet.json OK - signextend_bitIsSet.json Fail
+ smod0.json OK + smod0.json OK
+ smod1.json OK + smod1.json OK
+ smod2.json OK + smod2.json OK
@ -188,63 +188,63 @@ VMTests
+ smod5.json OK + smod5.json OK
+ smod6.json OK + smod6.json OK
+ smod7.json OK + smod7.json OK
+ smod8_byZero.json OK - smod8_byZero.json Fail
+ smod_i256min1.json OK + smod_i256min1.json OK
+ smod_i256min2.json OK - smod_i256min2.json Fail
+ stop.json OK + stop.json OK
+ sub0.json OK - sub0.json Fail
+ sub1.json OK - sub1.json Fail
+ sub2.json OK - sub2.json Fail
+ sub3.json OK - sub3.json Fail
+ sub4.json OK - sub4.json Fail
``` ```
OK: 185/195 Fail: 9/195 Skip: 1/195 OK: 56/195 Fail: 138/195 Skip: 1/195
## vmBitwiseLogicOperation ## vmBitwiseLogicOperation
```diff ```diff
+ and0.json OK - and0.json Fail
+ and1.json OK + and1.json OK
+ and2.json OK - and2.json Fail
+ and3.json OK - and3.json Fail
+ and4.json OK - and4.json Fail
+ and5.json OK - and5.json Fail
+ byte0.json OK - byte0.json Fail
+ byte1.json OK - byte1.json Fail
+ byte10.json OK - byte10.json Fail
+ byte11.json OK - byte11.json Fail
+ byte2.json OK - byte2.json Fail
+ byte3.json OK - byte3.json Fail
+ byte4.json OK - byte4.json Fail
+ byte5.json OK - byte5.json Fail
+ byte6.json OK - byte6.json Fail
+ byte7.json OK - byte7.json Fail
+ byte8.json OK - byte8.json Fail
+ byte9.json OK - byte9.json Fail
+ eq0.json OK + eq0.json OK
+ eq1.json OK - eq1.json Fail
+ eq2.json OK - eq2.json Fail
+ gt0.json OK - gt0.json Fail
+ gt1.json OK + gt1.json OK
+ gt2.json OK - gt2.json Fail
+ gt3.json OK + gt3.json OK
+ iszeo2.json OK + iszeo2.json OK
+ iszero0.json OK + iszero0.json OK
+ iszero1.json OK - iszero1.json Fail
+ lt0.json OK + lt0.json OK
+ lt1.json OK - lt1.json Fail
+ lt2.json OK + lt2.json OK
+ lt3.json OK - lt3.json Fail
+ not0.json OK - not0.json Fail
+ not1.json OK - not1.json Fail
+ not2.json OK + not2.json OK
+ not3.json OK - not3.json Fail
+ not4.json OK - not4.json Fail
+ not5.json OK - not5.json Fail
+ or0.json OK - or0.json Fail
+ or1.json OK - or1.json Fail
+ or2.json OK - or2.json Fail
+ or3.json OK - or3.json Fail
+ or4.json OK - or4.json Fail
+ or5.json OK - or5.json Fail
+ sgt0.json OK + sgt0.json OK
+ sgt1.json OK + sgt1.json OK
+ sgt2.json OK + sgt2.json OK
@ -256,13 +256,13 @@ OK: 185/195 Fail: 9/195 Skip: 1/195
+ slt3.json OK + slt3.json OK
+ slt4.json OK + slt4.json OK
+ xor0.json OK + xor0.json OK
+ xor1.json OK - xor1.json Fail
+ xor2.json OK - xor2.json Fail
+ xor3.json OK - xor3.json Fail
+ xor4.json OK - xor4.json Fail
+ xor5.json OK - xor5.json Fail
``` ```
OK: 60/60 Fail: 0/60 Skip: 0/60 OK: 20/60 Fail: 40/60 Skip: 0/60
## vmBlockInfoTest ## vmBlockInfoTest
```diff ```diff
- blockhash257Block.json Fail - blockhash257Block.json Fail
@ -558,82 +558,82 @@ OK: 0/46 Fail: 0/46 Skip: 46/46
OK: 0/18 Fail: 0/18 Skip: 18/18 OK: 0/18 Fail: 0/18 Skip: 18/18
## vmPushDupSwapTest ## vmPushDupSwapTest
```diff ```diff
+ dup1.json OK - dup1.json Fail
+ dup10.json OK - dup10.json Fail
+ dup11.json OK - dup11.json Fail
+ dup12.json OK - dup12.json Fail
+ dup13.json OK - dup13.json Fail
+ dup14.json OK - dup14.json Fail
+ dup15.json OK - dup15.json Fail
+ dup16.json OK - dup16.json Fail
+ dup2.json OK - dup2.json Fail
+ dup2error.json OK + dup2error.json OK
+ dup3.json OK - dup3.json Fail
+ dup4.json OK - dup4.json Fail
+ dup5.json OK - dup5.json Fail
+ dup6.json OK - dup6.json Fail
+ dup7.json OK - dup7.json Fail
+ dup8.json OK - dup8.json Fail
+ dup9.json OK - dup9.json Fail
+ push1.json OK - push1.json Fail
+ push10.json OK - push10.json Fail
+ push11.json OK - push11.json Fail
+ push12.json OK - push12.json Fail
+ push13.json OK - push13.json Fail
+ push14.json OK - push14.json Fail
+ push15.json OK - push15.json Fail
+ push16.json OK - push16.json Fail
+ push17.json OK - push17.json Fail
+ push18.json OK - push18.json Fail
+ push19.json OK - push19.json Fail
+ push1_missingStack.json OK + push1_missingStack.json OK
+ push2.json OK - push2.json Fail
+ push20.json OK - push20.json Fail
+ push21.json OK - push21.json Fail
+ push22.json OK - push22.json Fail
+ push23.json OK - push23.json Fail
+ push24.json OK - push24.json Fail
+ push25.json OK - push25.json Fail
+ push26.json OK - push26.json Fail
+ push27.json OK - push27.json Fail
+ push28.json OK - push28.json Fail
+ push29.json OK - push29.json Fail
+ push3.json OK - push3.json Fail
+ push30.json OK - push30.json Fail
+ push31.json OK - push31.json Fail
+ push32.json OK - push32.json Fail
+ push32AndSuicide.json OK + push32AndSuicide.json OK
+ push32FillUpInputWithZerosAtTheEnd.json OK + push32FillUpInputWithZerosAtTheEnd.json OK
+ push32Undefined.json OK + push32Undefined.json OK
+ push32Undefined2.json OK - push32Undefined2.json Fail
+ push32Undefined3.json OK + push32Undefined3.json OK
+ push33.json OK + push33.json OK
+ push4.json OK - push4.json Fail
+ push5.json OK - push5.json Fail
+ push6.json OK - push6.json Fail
+ push7.json OK - push7.json Fail
+ push8.json OK - push8.json Fail
+ push9.json OK - push9.json Fail
+ swap1.json OK - swap1.json Fail
+ swap10.json OK - swap10.json Fail
+ swap11.json OK - swap11.json Fail
+ swap12.json OK - swap12.json Fail
+ swap13.json OK - swap13.json Fail
+ swap14.json OK - swap14.json Fail
+ swap15.json OK - swap15.json Fail
+ swap16.json OK - swap16.json Fail
+ swap2.json OK - swap2.json Fail
+ swap2error.json OK + swap2error.json OK
+ swap3.json OK - swap3.json Fail
+ swap4.json OK - swap4.json Fail
+ swap5.json OK - swap5.json Fail
+ swap6.json OK - swap6.json Fail
+ swap7.json OK - swap7.json Fail
+ swap8.json OK - swap8.json Fail
+ swap9.json OK - swap9.json Fail
+ swapjump1.json OK + swapjump1.json OK
``` ```
OK: 74/74 Fail: 0/74 Skip: 0/74 OK: 9/74 Fail: 65/74 Skip: 0/74
## vmRandomTest ## vmRandomTest
```diff ```diff
201503102037PYTHON.json Skip 201503102037PYTHON.json Skip

View File

@ -85,7 +85,7 @@ proc sdiv*(computation: var BaseComputation) =
# no curry # no curry
proc exp*(computation: var BaseComputation) = proc exp*(computation: var BaseComputation) =
quit("Exp is not implemented at the moment. Pending https://github.com/status-im/nim-stint/issues/37") raise newException(ValueError, "Exp is not implemented at the moment. Pending https://github.com/status-im/nim-stint/issues/37")
# # Exponentiation # # Exponentiation
# let (base, exponent) = computation.stack.popInt(2) # let (base, exponent) = computation.stack.popInt(2)

View File

@ -43,9 +43,8 @@ proc notOp*(computation: var BaseComputation) =
proc byteOp*(computation: var BaseComputation) = proc byteOp*(computation: var BaseComputation) =
# Bitwise And # Bitwise And
quit("byteOp is not Implemented as it requires pow https://github.com/status-im/nim-stint/issues/37") raise newException(ValueError, "byteOp is not Implemented as it requires pow https://github.com/status-im/nim-stint/issues/37")
# var (position, value) = computation.stack.popInt(2) # var (position, value) = computation.stack.popInt(2)
# var res = if position >= 32.u256: 0.u256 else: (value div (256.u256.pow(31'u64 - position.toInt.uint64))) mod 256 # var res = if position >= 32.u256: 0.u256 else: (value div (256.u256.pow(31'u64 - position.toInt.uint64))) mod 256
# pushRes() # pushRes()

View File

@ -50,8 +50,8 @@ macro jsonTest*(s: static[string], handler: untyped): untyped =
status[folder][name] = Status.OK status[folder][name] = Status.OK
z += 1 z += 1
status.sort do (a: (string, OrderedTable[string, Status]), b: (string, OrderedTable[string, Status])) -> int: status.sort do (a: (string, OrderedTable[string, Status]),
cmp(a[0], b[0]) b: (string, OrderedTable[string, Status])) -> int: cmp(a[0], b[0])
let symbol: array[Status, string] = ["+", "-", " "] let symbol: array[Status, string] = ["+", "-", " "]
var raw = "" var raw = ""