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