本文整理汇总了C++中testnodes::BinaryNode::right方法的典型用法代码示例。如果您正苦于以下问题:C++ BinaryNode::right方法的具体用法?C++ BinaryNode::right怎么用?C++ BinaryNode::right使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testnodes::BinaryNode
的用法示例。
在下文中一共展示了BinaryNode::right方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
TEST(FilePersistence, LoadMultipleUnits)
{
QString testDir = ":/FilePersistence/test/persisted";
Model::Model model;
FileStore store;
store.setBaseFolder(testDir);
model.load(&store, "units");
TestNodes::BinaryNode* root = dynamic_cast<TestNodes::BinaryNode*> (model.root());
CHECK_STR_EQUAL("BinaryNode", root->typeName() );
CHECK_STR_EQUAL("Root", root->name()->get() );
CHECK_CONDITION(root->left() != nullptr);
CHECK_CONDITION(root->right() != nullptr);
CHECK_STR_EQUAL("BinaryNodePersistenceUnit", root->left()->typeName() );
CHECK_STR_EQUAL("Left child", root->left()->name()->get() );
CHECK_CONDITION(root->left()->left() != nullptr);
CHECK_CONDITION(root->left()->right() == nullptr);
CHECK_STR_EQUAL("BinaryNode", root->left()->left()->typeName() );
CHECK_STR_EQUAL("in a new unit", root->left()->left()->name()->get() );
CHECK_CONDITION(root->left()->left()->left() == nullptr);
CHECK_CONDITION(root->left()->left()->right() == nullptr);
CHECK_STR_EQUAL("BinaryNode", root->right()->typeName() );
CHECK_STR_EQUAL("Right child", root->right()->name()->get() );
CHECK_CONDITION(root->right()->left() == nullptr);
CHECK_CONDITION(root->right()->right() == nullptr);
}
示例2:
TEST(ModelBase, PersistenceSave)
{
Model model;
PersistentStoreMock store;
TestNodes::BinaryNode* root = dynamic_cast<TestNodes::BinaryNode*> (model.createRoot("BinaryNode"));
model.setName("root");
model.save(&store);
CHECK_STR_EQUAL("BinaryNode,root,full,Text,name,full,,Integer,_ext_PositionExtension_x,full,0,Integer,_ext_PositionExtension_y,full,0,", store.getSaved());
model.beginModification(root, "make tree");
root->setLeft(new TestNodes::BinaryNode());
root->setRight( new TestNodes::BinaryNode());
root->name()->set("Troot");
root->left()->name()->set("Tleft");
root->right()->name()->set("Tright");
model.endModification();
store.clear();
model.save();
CHECK_STR_EQUAL("BinaryNode,root,full,Text,name,full,Troot,BinaryNode,left,full,Text,name,full,Tleft,Integer,_ext_PositionExtension_x,full,0,Integer,_ext_PositionExtension_y,full,0,BinaryNode,right,full,Text,name,full,Tright,Integer,_ext_PositionExtension_x,full,0,Integer,_ext_PositionExtension_y,full,0,Integer,_ext_PositionExtension_x,full,0,Integer,_ext_PositionExtension_y,full,0,", store.getSaved());
}