MCPcopy Create free account
hub / github.com/ceph/ceph / DecodeAndVerify

Function DecodeAndVerify

src/test/erasure-code/TestErasureCodeIsa.cc:381–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381bool
382DecodeAndVerify(ErasureCodeIsaDefault& Isa, shard_id_map<bufferlist> &degraded, shard_id_set want_to_decode, buffer::ptr* enc, int length)
383{
384 shard_id_map<bufferlist> decoded(Isa.get_chunk_count());
385 bool ok;
386
387 // decode as requested
388 ok = Isa._decode(want_to_decode,
389 degraded,
390 &decoded);
391
392 for (int i = 0; i < (int) decoded.size(); i++) {
393 // compare all the buffers with their original
394 ok |= memcmp(decoded[shard_id_t(i)].c_str(), enc[i].c_str(), length);
395 }
396
397 return ok;
398}
399
400TEST_F(IsaErasureCodeTest, isa_vandermonde_exhaustive)
401{

Callers 1

TEST_FFunction · 0.85

Calls 5

shard_id_tClass · 0.50
get_chunk_countMethod · 0.45
_decodeMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected