本文整理汇总了C++中SubscriptionRequest::path_list方法的典型用法代码示例。如果您正苦于以下问题:C++ SubscriptionRequest::path_list方法的具体用法?C++ SubscriptionRequest::path_list怎么用?C++ SubscriptionRequest::path_list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SubscriptionRequest
的用法示例。
在下文中一共展示了SubscriptionRequest::path_list方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
TEST_F(AgentConsolidatorTest, add) {
AgentConsolidatorHandle *handle;
SubscriptionRequest request;
SubscriptionRequest system_accepted_request;
telemetry::Path *path;
// Build a request of valid paths
path = request.add_path_list();
path->set_path("firewall");
path = request.add_path_list();
path->set_path("port");
// Add it to the consolidator
handle = cons->addRequest(61, &request, &system_accepted_request);
EXPECT_TRUE(handle != NULL);
EXPECT_EQ(2, cons->getSystemRequestCount());
EXPECT_EQ(1, cons->getAddCount());
EXPECT_EQ(0, cons->getErrors());
for (int i = 0; i < request.path_list_size(); i++) {
EXPECT_STREQ(request.path_list(i).path().c_str(),
system_accepted_request.path_list(i).path().c_str());
}
// Simple check get call is good
SubscriptionRequest *test_ptr;
test_ptr = cons->getRequest(handle, false);
EXPECT_TRUE(test_ptr != NULL);
// Remove it now
cons->removeRequest(handle);
EXPECT_EQ(0, cons->getSystemRequestCount());
EXPECT_EQ(1, cons->getRemCount());
EXPECT_EQ(0, cons->getErrors());
}