| 21 | BOOST_AUTO_TEST_SUITE(CheckBlock_tests) |
| 22 | |
| 23 | bool 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 | |
| 46 | BOOST_AUTO_TEST_CASE(May15) |
| 47 | { |
no test coverage detected