本文整理汇总了C++中PathNode::hasChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ PathNode::hasChildren方法的具体用法?C++ PathNode::hasChildren怎么用?C++ PathNode::hasChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathNode
的用法示例。
在下文中一共展示了PathNode::hasChildren方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
TEST(addDevice, normalConditions) {
PathTree tree;
PathNode *dev = nullptr;
ASSERT_NO_THROW(dev = &addDevice(tree, "/com_osvr_sample/MyDevice"));
// Check Device
ASSERT_EQ(dev->getName(), "MyDevice");
ASSERT_FALSE(dev->hasChildren()) << "Make sure it has no children.";
ASSERT_TRUE(isNodeType<elements::DeviceElement>(*dev)) << "Check type";
ASSERT_NE(dev->getParent(), nullptr) << "Make sure it has a parent.";
// Check com_osvr_sample
auto plugin = dev->getParent();
ASSERT_EQ(plugin->getName(), "com_osvr_sample");
ASSERT_TRUE(isNodeType<elements::PluginElement>(*plugin)) << "Check type";
ASSERT_NE(plugin->getParent(), nullptr) << "Make sure it has a parent.";
auto root = plugin->getParent();
ASSERT_TRUE(root->isRoot());
ASSERT_EQ(tree.getNodeByPath("/"), *root)
<< "Root identity should be preserved";
ASSERT_EQ(tree.getNodeByPath("/com_osvr_sample/MyDevice"), *dev)
<< "Identity should be preserved";
}