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

Method TestTwoNameSpace

src/graph/in_memory_graph_test.cc:80–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 }
79
80 void TestTwoNameSpace() {
81 config_.set_node_graph(USER_ITEM_CONTEXT);
82 config_.set_node_config(USER_ITEM_CONFIG);
83 graph_ = InMemoryGraph::Create(config_);
84 EXPECT_TRUE(graph_ != nullptr);
85
86 // user topology
87 EXPECT_EQ(graph_->uniq_nodes_list()[0].size(), 13u);
88 EXPECT_EQ(graph_->total_freqs()[0], (int_t)52);
89
90 // item topology
91 EXPECT_EQ(graph_->uniq_nodes_list()[1].size(), 13u);
92 EXPECT_EQ(graph_->total_freqs()[1], (int_t)52);
93
94 // size
95 EXPECT_EQ(graph_->node_size(), 26u);
96 EXPECT_EQ(graph_->node_feature_size(), 12u);
97 EXPECT_EQ(graph_->neigh_feature_size(), 12u);
98
99 // empty
100 EXPECT_TRUE(!graph_->node_empty());
101 EXPECT_TRUE(!graph_->node_feature_empty());
102 EXPECT_TRUE(!graph_->neigh_feature_empty());
103
104 // degree
105 for (auto node : graph_->node_keys()) {
106 EXPECT_EQ(graph_->GetInDegree(node), 3);
107 EXPECT_EQ(graph_->GetOutDegree(node), 3);
108 }
109 }
110
111 void TestShard0() {
112 config_.set_shard_num(2);

Callers

nothing calls this directly

Calls 10

set_node_graphMethod · 0.80
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
set_node_configMethod · 0.45
GetInDegreeMethod · 0.45
GetOutDegreeMethod · 0.45

Tested by

no test coverage detected