| 61 | }; |
| 62 | |
| 63 | IGNORE_DEPRECATED |
| 64 | TEST_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)); |
nothing calls this directly
no test coverage detected