From 5cfec260f797fe3568b17a77cfd9f0f646bd1ce2 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Tue, 26 May 2015 16:27:22 +0300 Subject: Random test code --- TestHelper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'TestHelper.cpp') diff --git a/TestHelper.cpp b/TestHelper.cpp index 476d1ecf..4836ce7f 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -328,7 +328,7 @@ void ImportTest::exportTest(bytes const& _output, State const& _statePost) { // export output - m_TestObject["out"] = _output.size() > 4096 ? "#" + toString(_output.size()) : toHex(_output, 2, HexPrefix::Add); + m_TestObject["out"] = (_output.size() > 4096 && !Options::get().fulloutput) ? "#" + toString(_output.size()) : toHex(_output, 2, HexPrefix::Add); // export logs m_TestObject["logs"] = exportLog(_statePost.pending().size() ? _statePost.log(0) : LogEntries()); @@ -760,6 +760,8 @@ Options::Options() else singleTestName = std::move(name1); } + else if (arg == "--fulloutput") + fulloutput = true; } } -- cgit v1.2.3 From 3bbef4fb328e3e48d637b9cd29aac4e65770e32f Mon Sep 17 00:00:00 2001 From: Dimitry Date: Tue, 26 May 2015 18:24:47 +0300 Subject: Random Code: fulloutput option + test --- TestHelper.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'TestHelper.cpp') diff --git a/TestHelper.cpp b/TestHelper.cpp index 4836ce7f..5ace49e5 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -771,7 +771,6 @@ Options const& Options::get() return instance; } - LastHashes lastHashes(u256 _currentBlockNumber) { LastHashes ret; -- cgit v1.2.3 From 5452c8f7e3f0161c6b8b580c19692ffce89b9008 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Fri, 29 May 2015 17:06:11 +0300 Subject: Random Code: cath fill exceptions --- TestHelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'TestHelper.cpp') diff --git a/TestHelper.cpp b/TestHelper.cpp index 5ace49e5..793e0565 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -588,7 +588,7 @@ void userDefinedTest(std::function doTests) oSingleTest[pos->first] = pos->second; json_spirit::mValue v_singleTest(oSingleTest); - doTests(v_singleTest, false); + doTests(v_singleTest, test::Options::get().fillTests); } catch (Exception const& _e) { -- cgit v1.2.3 From 7bbb8de506d225e80418641a97fca38e87d7ec25 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Thu, 4 Jun 2015 10:41:02 +0200 Subject: add ability to test unsigned transaction --- TestHelper.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'TestHelper.cpp') diff --git a/TestHelper.cpp b/TestHelper.cpp index 793e0565..bbe1a5b6 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -262,7 +262,21 @@ void ImportTest::importTransaction(json_spirit::mObject& _o) { RLPStream transactionRLPStream = createRLPStreamFromTransactionFields(_o); RLP transactionRLP(transactionRLPStream.out()); - m_transaction = Transaction(transactionRLP.data(), CheckTransaction::Everything); + try + { + m_transaction = Transaction(transactionRLP.data(), CheckTransaction::Everything); + } + catch(InvalidSignature) + { + // create unsigned transaction + m_transaction = _o["to"].get_str().empty() ? + Transaction(toInt(_o["value"]), toInt(_o["gasPrice"]), toInt(_o["gasLimit"]), importData(_o), toInt(_o["nonce"])) : + Transaction(toInt(_o["value"]), toInt(_o["gasPrice"]), toInt(_o["gasLimit"]), Address(_o["to"].get_str()), importData(_o), toInt(_o["nonce"])); + } + catch(Exception& _e) + { + cnote << "invalid transaction" << boost::diagnostic_information(_e); + } } } -- cgit v1.2.3 From b905fd80848cf01211316f54b80eb8bd0ea064e6 Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Thu, 4 Jun 2015 19:36:37 +0200 Subject: fixed peer test --- TestHelper.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'TestHelper.cpp') diff --git a/TestHelper.cpp b/TestHelper.cpp index 793e0565..2c638494 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -567,8 +567,7 @@ void userDefinedTest(std::function doTests) auto& filename = Options::get().singleTestFile; auto& testname = Options::get().singleTestName; - int currentVerbosity = g_logVerbosity; - g_logVerbosity = 12; + VerbosityHolder sentinel(12); try { cnote << "Testing user defined test: " << filename; @@ -593,14 +592,11 @@ void userDefinedTest(std::function doTests) catch (Exception const& _e) { BOOST_ERROR("Failed Test with Exception: " << diagnostic_information(_e)); - g_logVerbosity = currentVerbosity; } catch (std::exception const& _e) { BOOST_ERROR("Failed Test with Exception: " << _e.what()); - g_logVerbosity = currentVerbosity; } - g_logVerbosity = currentVerbosity; } void executeTests(const string& _name, const string& _testPathAppendix, const boost::filesystem::path _pathToFiller, std::function doTests) -- cgit v1.2.3 From ae454a9a04298336facee46c85da3319257d20cf Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 5 Jun 2015 08:38:58 +0200 Subject: style --- TestHelper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'TestHelper.cpp') diff --git a/TestHelper.cpp b/TestHelper.cpp index bbe1a5b6..74a4d063 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -266,14 +266,14 @@ void ImportTest::importTransaction(json_spirit::mObject& _o) { m_transaction = Transaction(transactionRLP.data(), CheckTransaction::Everything); } - catch(InvalidSignature) + catch (InvalidSignature) { // create unsigned transaction m_transaction = _o["to"].get_str().empty() ? Transaction(toInt(_o["value"]), toInt(_o["gasPrice"]), toInt(_o["gasLimit"]), importData(_o), toInt(_o["nonce"])) : Transaction(toInt(_o["value"]), toInt(_o["gasPrice"]), toInt(_o["gasLimit"]), Address(_o["to"].get_str()), importData(_o), toInt(_o["nonce"])); } - catch(Exception& _e) + catch (Exception& _e) { cnote << "invalid transaction" << boost::diagnostic_information(_e); } -- cgit v1.2.3