MCPcopy Create free account
hub / github.com/Tencent/embedx / TestOneNameSpace

Method TestOneNameSpace

src/graph/in_memory_graph_test.cc:55–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 }
54
55 void TestOneNameSpace() {
56 graph_ = InMemoryGraph::Create(config_);
57 EXPECT_TRUE(graph_ != nullptr);
58
59 // topology
60 EXPECT_EQ(graph_->uniq_nodes_list()[0].size(), 13u);
61 EXPECT_EQ(graph_->total_freqs()[0], (int_t)52);
62
63 // size
64 EXPECT_EQ(graph_->node_size(), 13u);
65 EXPECT_EQ(graph_->node_feature_size(), 12u);
66 EXPECT_EQ(graph_->neigh_feature_size(), 12u);
67
68 // empty
69 EXPECT_TRUE(!graph_->node_empty());
70 EXPECT_TRUE(!graph_->node_feature_empty());
71 EXPECT_TRUE(!graph_->neigh_feature_empty());
72
73 // degree
74 for (auto node : graph_->node_keys()) {
75 EXPECT_EQ(graph_->GetInDegree(node), 3);
76 EXPECT_EQ(graph_->GetOutDegree(node), 3);
77 }
78 }
79
80 void TestTwoNameSpace() {
81 config_.set_node_graph(USER_ITEM_CONTEXT);

Callers

nothing calls this directly

Calls 8

node_sizeMethod · 0.80
node_feature_sizeMethod · 0.80
neigh_feature_sizeMethod · 0.80
node_emptyMethod · 0.80
node_feature_emptyMethod · 0.80
neigh_feature_emptyMethod · 0.80
GetInDegreeMethod · 0.45
GetOutDegreeMethod · 0.45

Tested by

no test coverage detected