Cleanups/bugfixes.

This commit is contained in:
JoelKatz
2012-05-31 02:40:51 -07:00
parent 64dc941bc6
commit 31a44088d6
4 changed files with 4 additions and 4 deletions

View File

@@ -36,7 +36,6 @@ std::stack<SHAMapTreeNode::pointer> SHAMap::getStack(const uint256& id, bool inc
// produce a stack of nodes along the way, with the terminal node at the top
std::stack<SHAMapTreeNode::pointer> stack;
SHAMapTreeNode::pointer node = root;
while (!node->isLeaf())
{
stack.push(node);
@@ -495,6 +494,7 @@ bool SHAMap::addGiveItem(SHAMapItem::pointer item, bool isTransaction)
{
std::cerr << "Node: " << node->getString() << std::endl;
std::cerr << "NewNode: " << newNode->getString() << std::endl;
dump();
assert(false);
throw SHAMapException(InvalidNode);
}
@@ -670,6 +670,7 @@ BOOST_AUTO_TEST_SUITE(shamap)
BOOST_AUTO_TEST_CASE( SHAMap_test )
{ // h3 and h4 differ only in the leaf, same terminal node (level 19)
SHAMapNode::ClassInit();
uint256 h1, h2, h3, h4, h5;
h1.SetHex("092891fe4ef6cee585fdc6fda0e09eb4d386363158ec3321b8123e5a772c6ca7");
h2.SetHex("436ccbac3347baa1f1e53baeef1f43334da88f1f6d70d963b833afd6dfa289fe");

View File

@@ -339,8 +339,6 @@ public:
static std::vector<unsigned char> checkTrustedPath(const uint256& ledgerHash, const uint256& leafIndex,
const std::list<std::vector<unsigned char> >& path);
static bool TestSHAMap();
static bool syncTest();
bool deepCompare(SHAMap& other);
virtual void dump(bool withHashes = false);
};

View File

@@ -366,6 +366,7 @@ BOOST_AUTO_TEST_CASE( SHAMapSync_test )
unsigned int seed;
RAND_pseudo_bytes(reinterpret_cast<unsigned char *>(&seed), sizeof(seed));
srand(seed);
SHAMapNode::ClassInit();
SHAMap source, destination;

View File

@@ -8,7 +8,7 @@
typedef SerializedLedgerEntry SLE;
#define DIR_NODE_MAX 1
#define DIR_NODE_MAX 32
// We return the uNodeDir so that on delete we can quickly know where the element is mentioned in the directory.
TransactionEngineResult TransactionEngine::dirAdd(