| 63 | } |
| 64 | |
| 65 | bool check_rows(ng::PleReader& rd, const std::vector<uint32_t>& rows, uint32_t n_rows, uint32_t rb, const char* what) { |
| 66 | std::vector<uint8_t> out(rows.size() * rb, 0xCC); |
| 67 | std::string err; |
| 68 | const auto t = rd.issue(rows.data(), rows.size(), out.data()); |
| 69 | if (!rd.collect(t, err)) { CHECK(false, "%s: collect failed: %s", what, err.c_str()); return false; } |
| 70 | std::vector<uint8_t> want(rb); |
| 71 | for (size_t i = 0; i < rows.size(); ++i) { |
| 72 | if (rows[i] >= n_rows) std::memset(want.data(), 0, rb); |
| 73 | else expected_row(rows[i], rb, want.data()); |
| 74 | if (std::memcmp(want.data(), &out[i * rb], rb) != 0) { |
| 75 | CHECK(false, "%s: row %u (index %zu) differs", what, rows[i], i); |
| 76 | return false; |
| 77 | } |
| 78 | } |
| 79 | return true; |
| 80 | } |
| 81 | |
| 82 | /// issue() folds the rows of one ticket that share a 4 KiB page into one read (PR #4910: a small stack buffer for up to 64 |
| 83 | /// misses, a reusable vector above that, sorted by offset and merged in one pass). The bytes are checked as always; here the |
no test coverage detected