Changeset View
Changeset View
Standalone View
Standalone View
src/test/blockindex_tests.cpp
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | for (BlockValidity validity : validityValues) { | ||||
} | } | ||||
if (flags & 0x02) { | if (flags & 0x02) { | ||||
index.nStatus = index.nStatus.withUndo(); | index.nStatus = index.nStatus.withUndo(); | ||||
index.nFile = expectedFile; | index.nFile = expectedFile; | ||||
index.nUndoPos = expectedUndoPosition; | index.nUndoPos = expectedUndoPosition; | ||||
} | } | ||||
// Data and undo positions should be unmodified | // Data and undo positions should be unmodified | ||||
CDiskBlockPos dataPosition = index.GetBlockPos(); | FlatFilePos dataPosition = index.GetBlockPos(); | ||||
if (flags & 0x01) { | if (flags & 0x01) { | ||||
BOOST_CHECK(dataPosition.nFile == expectedFile); | BOOST_CHECK(dataPosition.nFile == expectedFile); | ||||
BOOST_CHECK(dataPosition.nPos == expectedDataPosition); | BOOST_CHECK(dataPosition.nPos == expectedDataPosition); | ||||
} else { | } else { | ||||
BOOST_CHECK(dataPosition == CDiskBlockPos()); | BOOST_CHECK(dataPosition == FlatFilePos()); | ||||
} | } | ||||
CDiskBlockPos undoPosition = index.GetUndoPos(); | FlatFilePos undoPosition = index.GetUndoPos(); | ||||
if (flags & 0x02) { | if (flags & 0x02) { | ||||
BOOST_CHECK(undoPosition.nFile == expectedFile); | BOOST_CHECK(undoPosition.nFile == expectedFile); | ||||
BOOST_CHECK(undoPosition.nPos == expectedUndoPosition); | BOOST_CHECK(undoPosition.nPos == expectedUndoPosition); | ||||
} else { | } else { | ||||
BOOST_CHECK(undoPosition == CDiskBlockPos()); | BOOST_CHECK(undoPosition == FlatFilePos()); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(get_block_hash) { | BOOST_AUTO_TEST_CASE(get_block_hash) { | ||||
CBlockIndex index = CBlockIndex(); | CBlockIndex index = CBlockIndex(); | ||||
▲ Show 20 Lines • Show All 332 Lines • Show Last 20 Lines |