本文整理汇总了C++中Admin::createObject方法的典型用法代码示例。如果您正苦于以下问题:C++ Admin::createObject方法的具体用法?C++ Admin::createObject怎么用?C++ Admin::createObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin
的用法示例。
在下文中一共展示了Admin::createObject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_createObject_juncture_id_fail
void Admintest::test_createObject_juncture_id_fail()
{
newId_fail = true;
std::string parent("juncture");
Root arg;
Atlas::Objects::Operation::Create op;
OpVector res;
arg->setObjtype("obj");
m_account->createObject(parent, arg, op, res);
ASSERT_EQUAL(res.size(), 1u);
ASSERT_EQUAL(res.front()->getClassNo(),
Atlas::Objects::Operation::ERROR_NO);
}
示例2: test_createObject_fallthrough
void Admintest::test_createObject_fallthrough()
{
Account_createObject_called = 0;
std::string parent("unimportant_string");
Root arg;
Atlas::Objects::Operation::Create op;
op->setSerialno(m_id_counter++);
OpVector res;
arg->setObjtype("obj");
m_account->createObject(parent, arg, op, res);
ASSERT_EQUAL(res.size(), 0u);
ASSERT_EQUAL(Account_createObject_called,
m_account);
}
示例3: test_createObject_juncture_serialno
void Admintest::test_createObject_juncture_serialno()
{
newId_fail = false;
std::string parent("juncture");
Root arg;
Atlas::Objects::Operation::Create op;
op->setSerialno(m_id_counter++);
OpVector res;
arg->setObjtype("obj");
m_account->createObject(parent, arg, op, res);
ASSERT_EQUAL(res.size(), 1u);
ASSERT_EQUAL(res.front()->getClassNo(),
Atlas::Objects::Operation::INFO_NO);
ASSERT_TRUE(!res.front()->isDefaultRefno());
}
示例4: test_createObject_class_no_id
void Admintest::test_createObject_class_no_id()
{
Ruleset_installRule_called = false;
Ruleset_installRule_retval = -1;
std::string parent("root");
Root arg;
Atlas::Objects::Operation::Create op;
OpVector res;
arg->setObjtype("class");
m_account->createObject(parent, arg, op, res);
ASSERT_EQUAL(res.size(), 1u);
ASSERT_EQUAL(res.front()->getClassNo(),
Atlas::Objects::Operation::ERROR_NO);
ASSERT_TRUE(!Ruleset_installRule_called);
}
示例5: test_createObject_class_exists
void Admintest::test_createObject_class_exists()
{
Ruleset_installRule_called = false;
Ruleset_installRule_retval = -1;
Inheritance::instance().addChild(atlasClass("character", "root"));
std::string parent("root");
Root arg;
Atlas::Objects::Operation::Create op;
OpVector res;
arg->setObjtype("class");
arg->setId("character");
m_account->createObject(parent, arg, op, res);
ASSERT_EQUAL(res.size(), 1u);
ASSERT_EQUAL(res.front()->getClassNo(),
Atlas::Objects::Operation::ERROR_NO);
ASSERT_TRUE(!Ruleset_installRule_called);
}