aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2014-02-24 18:24:18 +0800
committerGav Wood <i@gavwood.com>2014-02-24 18:24:18 +0800
commitb10e67213ab76b6f96b3a5ffa3819c46495ddd72 (patch)
treef7346d34789fda6f217a1b34c41f58a64852e0d2
parente9057d221cab6e0151c0ce91df0a56b89ee97399 (diff)
downloaddexon-solidity-b10e67213ab76b6f96b3a5ffa3819c46495ddd72.tar
dexon-solidity-b10e67213ab76b6f96b3a5ffa3819c46495ddd72.tar.gz
dexon-solidity-b10e67213ab76b6f96b3a5ffa3819c46495ddd72.tar.bz2
dexon-solidity-b10e67213ab76b6f96b3a5ffa3819c46495ddd72.tar.lz
dexon-solidity-b10e67213ab76b6f96b3a5ffa3819c46495ddd72.tar.xz
dexon-solidity-b10e67213ab76b6f96b3a5ffa3819c46495ddd72.tar.zst
dexon-solidity-b10e67213ab76b6f96b3a5ffa3819c46495ddd72.zip
Tests bug fix.
-rw-r--r--main.cpp10
-rw-r--r--vm.cpp16
2 files changed, 14 insertions, 12 deletions
diff --git a/main.cpp b/main.cpp
index 0cf46901..ed0ea76e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -42,11 +42,11 @@ int main(int, char**)
std::cout << asHex(s.out()) << std::endl;
std::cout << sha3(s.out()) << std::endl;*/
-// hexPrefixTest();
-// rlpTest();
-// trieTest();
-// daggerTest();
-// cryptoTest();
+ hexPrefixTest();
+ rlpTest();
+ trieTest();
+ daggerTest();
+ cryptoTest();
vmTest();
// stateTest();
// peerTest(argc, argv);
diff --git a/vm.cpp b/vm.cpp
index 285a0397..9fe858e1 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -269,22 +269,24 @@ public:
Transactions txs;
};
+#define CREATE_TESTS 0
+
template <> class UnitTest<1>
{
public:
int operator()()
{
json_spirit::mValue v;
- string s = asString(contents("/home/gav/Projects/cpp-ethereum/test/vmtests.json"));
- cout << s << endl;
+#if CREATE_TESTS
+ string s = asString(contents("../../cpp-ethereum/test/vmtests.json"));
json_spirit::read_string(s, v);
-
- doTests(v, true);
-
+ bool passed = doTests(v, true);
cout << json_spirit::write_string(v, true) << endl;
-
+#else
+ string s = asString(contents("../../tests/vmtests.json"));
+ json_spirit::read_string(s, v);
bool passed = doTests(v, false);
-
+#endif
return passed ? 0 : 1;
}