From 62b7862206f7fe91934a5a7b7313e609b060a727 Mon Sep 17 00:00:00 2001 From: Tomusdrw Date: Wed, 3 Feb 2016 16:21:52 +0100 Subject: [PATCH] Fixing evm tests for JIT --- ethcore/src/evm/factory.rs | 12 ++++++++++++ ethcore/src/evm/tests.rs | 11 +++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ethcore/src/evm/factory.rs b/ethcore/src/evm/factory.rs index f97c157a8..acefeeb37 100644 --- a/ethcore/src/evm/factory.rs +++ b/ethcore/src/evm/factory.rs @@ -100,6 +100,18 @@ fn test_create_vm() { /// Create tests by injecting different VM factories #[macro_export] macro_rules! evm_test( + (ignorejit => $name_test: ident: $name_jit: ident, $name_int: ident) => { + #[test] + #[ignore] + #[cfg(feature = "jit")] + fn $name_jit() { + $name_test(Factory::new(VMType::Jit)); + } + #[test] + fn $name_int() { + $name_test(Factory::new(VMType::Interpreter)); + } + }; ($name_test: ident: $name_jit: ident, $name_int: ident) => { #[test] #[cfg(feature = "jit")] diff --git a/ethcore/src/evm/tests.rs b/ethcore/src/evm/tests.rs index bcd0819de..ccb637a1a 100644 --- a/ethcore/src/evm/tests.rs +++ b/ethcore/src/evm/tests.rs @@ -254,8 +254,7 @@ fn test_origin(factory: super::Factory) { assert_store(&ext, 0, "000000000000000000000000cd1722f2947def4cf144679da39c4c32bdc35681"); } -// TODO [todr] Fails with Signal 11 on JIT -evm_test!{test_sender: test_sender_jit, test_sender_int} +evm_test!{ignorejit => test_sender: test_sender_jit, test_sender_int} fn test_sender(factory: super::Factory) { let address = Address::from_str("0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6").unwrap(); let sender = Address::from_str("cd1722f2947def4cf144679da39c4c32bdc35681").unwrap(); @@ -367,7 +366,7 @@ fn test_log_sender(factory: super::Factory) { assert_eq!(ext.logs[0].data, "ff00000000000000000000000000000000000000000000000000000000000000".from_hex().unwrap()); } -evm_test!{test_blockhash: test_blockhash_jit, test_blockhash_int} +evm_test!{ignorejit => test_blockhash: test_blockhash_jit, test_blockhash_int} fn test_blockhash(factory: super::Factory) { let address = Address::from_str("0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6").unwrap(); let code = "600040600055".from_hex().unwrap(); @@ -785,9 +784,9 @@ fn test_signextend(factory: super::Factory) { assert_eq!(gas_left, U256::from(59_972)); } - -evm_test!{test_badinstruction: test_badinstruction_jit, test_badinstruction_int} -fn test_badinstruction(factory: super::Factory) { +#[test] // JIT just returns out of gas +fn test_badinstruction_int() { + let factory = super::Factory::new(VMType::Interpreter); let code = "af".from_hex().unwrap(); let mut params = ActionParams::default();