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

Function TEST

src/test/erasure-code/TestErasureCodeShec.cc:44–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42static int g_flag = 0;
43
44TEST(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
76TEST(ErasureCodeShec, init_2)
77{

Callers

nothing calls this directly

Calls 15

pthread_createFunction · 0.85
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
insertMethod · 0.45
_minimum_to_decodeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected