MCPcopy Create free account
hub / github.com/Niko1221/Strata / check_rows

Function check_rows

engine/src/ngram/ple_reader_test.cpp:65–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65bool 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

Callers 2

check_coalescingFunction · 0.70
selftestFunction · 0.70

Calls 5

expected_rowFunction · 0.85
sizeMethod · 0.45
issueMethod · 0.45
dataMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected