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

Function TEST_P

src/test/erasure-code/TestErasureCodeShec_all.cc:63–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61};
62
63IGNORE_DEPRECATED
64TEST_P(ParameterTest, parameter_all)
65{
66 int result;
67 //get parameters
68 char* k = GetParam().k;
69 char* m = GetParam().m;
70 char* c = GetParam().c;
71 unsigned c_size = GetParam().ch_size;
72 int i_k = atoi(k);
73 int i_m = atoi(m);
74 int i_c = atoi(c);
75
76 //init
77 ErasureCodeShecTableCache tcache;
78 ErasureCodeShec* shec = new ErasureCodeShecReedSolomonVandermonde(
79 tcache,
80 ErasureCodeShec::MULTIPLE);
81 ErasureCodeProfile *profile = new ErasureCodeProfile();
82 (*profile)["plugin"] = "shec";
83 (*profile)["technique"] = "";
84 (*profile)["crush-failure-domain"] = "osd";
85 (*profile)["k"] = k;
86 (*profile)["m"] = m;
87 (*profile)["c"] = c;
88
89 result = shec->init(*profile, &cerr);
90
91 //check profile
92 EXPECT_EQ(i_k, shec->k);
93 EXPECT_EQ(i_m, shec->m);
94 EXPECT_EQ(i_c, shec->c);
95 EXPECT_EQ(8, shec->w);
96 EXPECT_EQ(ErasureCodeShec::MULTIPLE, shec->technique);
97 EXPECT_STREQ("default", shec->rule_root.c_str());
98 EXPECT_STREQ("osd", shec->rule_failure_domain.c_str());
99 EXPECT_TRUE(shec->matrix != NULL);
100 EXPECT_EQ(0, result);
101
102 //minimum_to_decode
103 //want_to_decode will be a combination that chooses 1~c from k+m
104 shard_id_set want_to_decode, available_chunks, minimum_chunks;
105 int array_want_to_decode[shec->get_chunk_count()];
106 struct Recover_d comb;
107
108 for (int w = 1; w <= i_c; w++) {
109 const unsigned int r = w; // combination(k+m,r)
110
111 for (unsigned int i = 0; i < r; ++i) {
112 array_want_to_decode[i] = 1;
113 }
114 for (unsigned int i = r; i < shec->get_chunk_count(); ++i) {
115 array_want_to_decode[i] = 0;
116 }
117
118 do {
119 for (unsigned int i = 0; i < shec->get_chunk_count(); i++) {
120 available_chunks.insert(shard_id_t(i));

Callers

nothing calls this directly

Calls 15

stringifyFunction · 0.85
set_type_nameMethod · 0.80
add_bucketMethod · 0.80
set_item_nameMethod · 0.80
insert_itemMethod · 0.80
shard_id_tClass · 0.50
initMethod · 0.45
c_strMethod · 0.45
get_chunk_countMethod · 0.45
insertMethod · 0.45
eraseMethod · 0.45
_minimum_to_decodeMethod · 0.45

Tested by

no test coverage detected