本文整理汇总了C++中Admin::GetOperation方法的典型用法代码示例。如果您正苦于以下问题:C++ Admin::GetOperation方法的具体用法?C++ Admin::GetOperation怎么用?C++ Admin::GetOperation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin
的用法示例。
在下文中一共展示了Admin::GetOperation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_GetOperation_rule_found
void Admintest::test_GetOperation_rule_found()
{
Atlas::Objects::Operation::Get op;
OpVector res;
Anonymous arg;
arg->setObjtype("class");
arg->setId("root");
op->setArgs1(arg);
m_account->GetOperation(op, res);
ASSERT_EQUAL(res.size(), 1u);
const Operation & reply = res.front();
ASSERT_EQUAL(reply->getClassNo(),
Atlas::Objects::Operation::INFO_NO);
ASSERT_EQUAL(reply->getArgs().size(), 1u);
const Root & reply_arg = reply->getArgs().front();
ASSERT_TRUE(!reply_arg->isDefaultId());
ASSERT_EQUAL(reply_arg->getId(), "root");
}
示例2: test_GetOperation_obj_IG
void Admintest::test_GetOperation_obj_IG()
{
long cid = m_id_counter++;
std::string cid_str = String::compose("%1", cid);
Entity * to = new Entity(cid_str, cid);
m_server->m_world.addEntity(to);
Atlas::Objects::Operation::Get op;
OpVector res;
Anonymous arg;
arg->setObjtype("obj");
arg->setId(cid_str);
op->setArgs1(arg);
m_account->GetOperation(op, res);
ASSERT_EQUAL(res.size(), 1u);
const Operation & reply = res.front();
ASSERT_EQUAL(reply->getClassNo(),
Atlas::Objects::Operation::INFO_NO);
ASSERT_EQUAL(reply->getArgs().size(), 1u);
const Root & reply_arg = reply->getArgs().front();
ASSERT_TRUE(!reply_arg->isDefaultId());
ASSERT_EQUAL(reply_arg->getId(), to->getId());
delete to;
}
示例3: test_GetOperation_no_args
void Admintest::test_GetOperation_no_args()
{
Atlas::Objects::Operation::Get op;
OpVector res;
m_account->GetOperation(op, res);
ASSERT_EQUAL(res.size(), 1u);
ASSERT_EQUAL(res.front()->getClassNo(),
Atlas::Objects::Operation::ERROR_NO);
}
示例4: test_GetOperation_no_objtype
void Admintest::test_GetOperation_no_objtype()
{
Atlas::Objects::Operation::Get op;
OpVector res;
Anonymous arg;
op->setArgs1(arg);
m_account->GetOperation(op, res);
ASSERT_EQUAL(res.size(), 1u);
ASSERT_EQUAL(res.front()->getClassNo(),
Atlas::Objects::Operation::ERROR_NO);
}
示例5: test_GetOperation_obj_unconnected
void Admintest::test_GetOperation_obj_unconnected()
{
m_account->m_connection = 0;
Atlas::Objects::Operation::Get op;
OpVector res;
Anonymous arg;
arg->setObjtype("obj");
arg->setId("9287");
op->setArgs1(arg);
m_account->GetOperation(op, res);
ASSERT_EQUAL(res.size(), 0u);
}