MCPcopy Create free account
hub / github.com/LUX-Core/lux / read_block

Function read_block

src/test/checkblock_tests.cpp:23–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21BOOST_AUTO_TEST_SUITE(CheckBlock_tests)
22
23bool read_block(const std::string& filename, CBlock& block)
24{
25 namespace fs = boost::filesystem;
26 fs::path testFile = fs::current_path() / "data" / filename;
27#ifdef TEST_DATA_DIR
28 if (!fs::exists(testFile))
29 {
30 testFile = fs::path(BOOST_PP_STRINGIZE(TEST_DATA_DIR)) / filename;
31 }
32#endif
33 FILE* fp = fopen(testFile.string().c_str(), "rb");
34 if (!fp) return false;
35
36 fseek(fp, 8, SEEK_SET); // skip msgheader/size
37
38 CAutoFile filein(fp, SER_DISK, CLIENT_VERSION);
39 if (filein.IsNull()) return false;
40
41 filein >> block;
42
43 return true;
44}
45
46BOOST_AUTO_TEST_CASE(May15)
47{

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 1

IsNullMethod · 0.45

Tested by

no test coverage detected