| 42 | static int g_flag = 0; |
| 43 | |
| 44 | TEST(ErasureCodeShec, init_1) |
| 45 | { |
| 46 | //all parameters are normal values |
| 47 | ErasureCodeShecTableCache tcache; |
| 48 | ErasureCodeShec* shec = new ErasureCodeShecReedSolomonVandermonde( |
| 49 | tcache, |
| 50 | ErasureCodeShec::MULTIPLE); |
| 51 | ErasureCodeProfile *profile = new ErasureCodeProfile(); |
| 52 | (*profile)["plugin"] = "shec"; |
| 53 | (*profile)["technique"] = ""; |
| 54 | (*profile)["crush-failure-domain"] = "osd"; |
| 55 | (*profile)["k"] = "4"; |
| 56 | (*profile)["m"] = "3"; |
| 57 | (*profile)["c"] = "2"; |
| 58 | |
| 59 | int r = shec->init(*profile, &cerr); |
| 60 | |
| 61 | //check profile |
| 62 | EXPECT_EQ(4, shec->k); |
| 63 | EXPECT_EQ(3, shec->m); |
| 64 | EXPECT_EQ(2, shec->c); |
| 65 | EXPECT_EQ(8, shec->w); |
| 66 | EXPECT_EQ(ErasureCodeShec::MULTIPLE, shec->technique); |
| 67 | EXPECT_STREQ("default", shec->rule_root.c_str()); |
| 68 | EXPECT_STREQ("osd", shec->rule_failure_domain.c_str()); |
| 69 | EXPECT_TRUE(shec->matrix != NULL); |
| 70 | EXPECT_EQ(0, r); |
| 71 | |
| 72 | delete shec; |
| 73 | delete profile; |
| 74 | } |
| 75 | |
| 76 | TEST(ErasureCodeShec, init_2) |
| 77 | { |
nothing calls this directly
no test coverage detected