MCPcopy Create free account
hub / github.com/baidu/tera / CheckRandomRead

Method CheckRandomRead

src/leveldb/util/env_test.cc:291–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289 }
290
291 void CheckRandomRead(uint32_t idx, const std::string& tip = "") {
292 if (idx > TEST_DATA_NUM) {
293 return;
294 }
295 CreateRandomReader();
296 if (idx == 362) {
297 SLOG(DEBUG, "here");
298 }
299
300 Slice data;
301 char scratch[8 * 1024];
302 Status s = raf_->Read(idx * TEST_DATA_SIZE, TEST_DATA_SIZE,
303 &data, scratch);
304 ASSERT_TRUE(s.ok()) << s.ToString();
305 ASSERT_TRUE(memcmp(data.data(), &test_data[idx][0], TEST_DATA_SIZE) == 0)
306 << tip << ": data = " << data.data()
307 << "\n vs. test_data[" << idx << "] = " << test_data[idx];
308 }
309
310 void CheckSequentialRead(uint32_t idx, const std::string& tip = "") {
311 if (idx > TEST_DATA_NUM) {

Callers 1

TESTFunction · 0.80

Calls 4

dataMethod · 0.80
ReadMethod · 0.45
okMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected