From 477394ac49c15e15ff5ef900383367fdb742b43c Mon Sep 17 00:00:00 2001 From: nicksavers Date: Sat, 23 Aug 2014 20:47:48 +0200 Subject: [PATCH] Add CALLDATACOPY OutOfGasException Unit Test --- .../src/test/java/org/ethereum/vm/VMTest.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ethereumj-core/src/test/java/org/ethereum/vm/VMTest.java b/ethereumj-core/src/test/java/org/ethereum/vm/VMTest.java index 520d96fc..bb8b8c41 100644 --- a/ethereumj-core/src/test/java/org/ethereum/vm/VMTest.java +++ b/ethereumj-core/src/test/java/org/ethereum/vm/VMTest.java @@ -1,6 +1,7 @@ package org.ethereum.vm; import org.ethereum.db.Repository; +import org.ethereum.vm.Program.OutOfGasException; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; @@ -2662,6 +2663,26 @@ public class VMTest { } } + @Test(expected=OutOfGasException.class) // CALLDATACOPY OP mal + public void testCALLDATACOPY_7() { + + VM vm = new VM(); + Program program = + new Program(Hex.decode("6020600073CC0929EB16730E7C14FEFC63006AC2D794C5795637"), + createProgramInvoke_1()); + + try { + vm.step(program); + vm.step(program); + vm.step(program); + vm.step(program); + fail(); + } finally { + program.getResult().getRepository().close(); + assertTrue(program.isStopped()); + } + } + @Test // ADDRESS OP public void testADDRESS_1() {