• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TestAccount类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中TestAccount的典型用法代码示例。如果您正苦于以下问题:C++ TestAccount类的具体用法?C++ TestAccount怎么用?C++ TestAccount使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TestAccount类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1:

bool
LoadGenerator::loadAccount(TestAccount& account, Database& database)
{
    AccountFrame::pointer ret;
    ret = AccountFrame::loadAccount(account.getPublicKey(), database);
    if (!ret)
    {
        return false;
    }
    account.setSequenceNumber(ret->getSeqNum());

    return true;
}
开发者ID:charwliu,项目名称:stellar-core,代码行数:13,代码来源:LoadGenerator.cpp


示例2: main

int main()
{
    database_flag = false;

    (void)new Domain;

    WorldRouter world;
    Entity & e = world.m_gameWorld;

    ServerRouting server(world, "noruleset", "unittesting",
                         "1", 1, "2", 2);

    CommServer commServer(server);

    TestCommClient * tc = new TestCommClient(commServer);
    Connection * c = new Connection(*tc, server, "addr", "3", 3);
    TestAccount * ac = new TestAccount(c, "user", "password", "4", 4);
    Entity * chr;

    {
        chr = new Entity("5", 5);
        chr->m_location.m_loc = &e;
        chr->m_location.m_loc->makeContainer();
        assert(chr->m_location.m_loc->m_contains != 0);
        chr->m_location.m_loc->m_contains->insert(chr);

        ac->addCharacter(chr);

        chr->destroy();

    }

    {
        chr = new Character("6", 6);
        chr->m_location.m_loc = &e;
        chr->m_location.m_loc->makeContainer();
        assert(chr->m_location.m_loc->m_contains != 0);
        chr->m_location.m_loc->m_contains->insert(chr);

        ac->addCharacter(chr);

        chr->destroy();

    }

    {
        chr = new Character("7", 7);
        chr->m_location.m_loc = &e;
        chr->m_location.m_loc->makeContainer();
        assert(chr->m_location.m_loc->m_contains != 0);
        chr->m_location.m_loc->m_contains->insert(chr);

        ac->addCharacter(chr);
    }

    {
        Anonymous new_char;
        Entity * chr = ac->testAddNewCharacter("thing", new_char,
                                               RootEntity());
        assert(chr != 0);
    }

    ac->getType();

    {
        MapType emap;
        ac->addToMessage(emap);
    }

    {
        RootEntity ent;
        ac->addToEntity(ent);
    }

    {
        Create op;
        OpVector res;
        ac->operation(op, res);
        op->setArgs1(Root());
        ac->operation(op, res);
        Anonymous op_arg;
        op->setArgs1(op_arg);
        ac->operation(op, res);
        op_arg->setParents(std::list<std::string>());
        ac->operation(op, res);
        op_arg->setParents(std::list<std::string>(1, "game_entity"));
        ac->operation(op, res);
        op_arg->setName("Bob");
        ac->operation(op, res);
    }

    {
        Get op;
        OpVector res;
        ac->operation(op, res);
        op->setArgs1(Root());
        ac->operation(op, res);
        Anonymous op_arg;
        op->setArgs1(op_arg);
        ac->operation(op, res);
//.........这里部分代码省略.........
开发者ID:jekin-worldforge,项目名称:cyphesis,代码行数:101,代码来源:Accounttest.cpp


示例3: test_connectCharacter_entity

void Accountintegration::test_connectCharacter_entity()
{
    Entity *e = new Entity("7", 7);

    int ret = m_ac->connectCharacter(e);
    ASSERT_NOT_EQUAL(ret, 0);
}
开发者ID:9cat,项目名称:cyphesis,代码行数:7,代码来源:Accountintegration.cpp


示例4: test_connectCharacter_character

void Accountintegration::test_connectCharacter_character()
{
    Character * e = new Character("8", 8);

    int ret = m_ac->connectCharacter(e);
    ASSERT_EQUAL(ret, 0);
    ASSERT_NOT_NULL(e->m_externalMind);
    ASSERT_TRUE(e->m_externalMind->isLinkedTo(m_c));
}
开发者ID:9cat,项目名称:cyphesis,代码行数:9,代码来源:Accountintegration.cpp


示例5: test_LookOperation

void Accountintegration::test_LookOperation()
{
    Anonymous new_char;
    LocatedEntity * chr = m_ac->addNewCharacter("thing", new_char,
                                                RootEntity());

    Anonymous op_arg;
    op_arg->setId("1");
    op_arg->setId(chr->getId());

    Look op;
    op->setArgs1(op_arg);

    OpVector res;
    m_ac->operation(op, res);

    // FIXME This doesn't test a lot
}
开发者ID:9cat,项目名称:cyphesis,代码行数:18,代码来源:Accountintegration.cpp


示例6: test_addNewCharacter

void Accountintegration::test_addNewCharacter()
{
    Anonymous new_char;
    LocatedEntity * chr = m_ac->addNewCharacter("thing", new_char,
                                                RootEntity());
    assert(chr != 0);

    std::cout << "Test 1" << std::endl << std::flush;
}
开发者ID:9cat,项目名称:cyphesis,代码行数:9,代码来源:Accountintegration.cpp


示例7: test_GetOperation

void Accountintegration::test_GetOperation()
{
    Anonymous op_arg;
    op_arg->setParents(std::list<std::string>());

    Get op;
    op->setArgs1(op_arg);

    OpVector res;
    m_ac->operation(op, res);
}
开发者ID:9cat,项目名称:cyphesis,代码行数:11,代码来源:Accountintegration.cpp


示例8: test_CreateOperation

void Accountintegration::test_CreateOperation()
{
    Anonymous op_arg;
    op_arg->setParents(std::list<std::string>(1, "game_entity"));
    op_arg->setName("Bob");

    Create op;
    op->setArgs1(op_arg);

    OpVector res;
    m_ac->operation(op, res);
}
开发者ID:9cat,项目名称:cyphesis,代码行数:12,代码来源:Accountintegration.cpp


示例9: test_ImaginaryOperation

void Accountintegration::test_ImaginaryOperation()
{
    Anonymous op_arg;
    op_arg->setLoc("2");

    Imaginary op;
    op->setArgs1(op_arg);
    op->setSerialno(1);

    OpVector res;
    m_ac->operation(op, res);

    // FIXME Test response is sent to Lobby
}
开发者ID:9cat,项目名称:cyphesis,代码行数:14,代码来源:Accountintegration.cpp


示例10: test_LogoutOperation

void Accountintegration::test_LogoutOperation()
{
    Logout op;
    op->setSerialno(1);

    Anonymous op_arg;
    op_arg->setParents(std::list<std::string>());
    op->setArgs1(op_arg);

    OpVector res;
    m_ac->operation(op, res);

    // FIXME Account should have been removed from Lobby, and also from
    // Connection
}
开发者ID:9cat,项目名称:cyphesis,代码行数:15,代码来源:Accountintegration.cpp


示例11: test_TalkOperation

void Accountintegration::test_TalkOperation()
{
    Anonymous op_arg;
    op_arg->setParents(std::list<std::string>());
    op_arg->setLoc("1");

    Talk op;
    op->setSerialno(1);
    op->setArgs1(op_arg);

    OpVector res;
    m_ac->operation(op, res);

    // FIXME Sound op should have been sent to the lobby
}
开发者ID:9cat,项目名称:cyphesis,代码行数:15,代码来源:Accountintegration.cpp


示例12: test_SetOperation

void Accountintegration::test_SetOperation()
{
    Anonymous new_char;
    LocatedEntity * chr = m_ac->addNewCharacter("thing", new_char,
                                                RootEntity());
    BBox newBox(WFMath::Point<3>(-0.5, -0.5, 0.0),
                WFMath::Point<3>(-0.5, -0.5, 2.0));
    chr->m_location.setBBox(newBox);

    Anonymous op_arg;

    op_arg->setId(chr->getId());
    op_arg->setAttr("guise", "foo");
    op_arg->setAttr("height", 3.0);
    op_arg->setAttr("tasks", ListType());

    Set op;
    op->setArgs1(op_arg);

    OpVector res;
    m_ac->operation(op, res);

    // FIXME Ensure character has been modified
}
开发者ID:9cat,项目名称:cyphesis,代码行数:24,代码来源:Accountintegration.cpp


示例13: test_addToEntity

void Accountintegration::test_addToEntity()
{
    RootEntity ent;
    m_ac->addToEntity(ent);
}
开发者ID:9cat,项目名称:cyphesis,代码行数:5,代码来源:Accountintegration.cpp


示例14: test_addToMessage

void Accountintegration::test_addToMessage()
{
    MapType emap;
    m_ac->addToMessage(emap);
}
开发者ID:9cat,项目名称:cyphesis,代码行数:5,代码来源:Accountintegration.cpp


示例15: test_getType

void Accountintegration::test_getType()
{
    m_ac->getType();
}
开发者ID:9cat,项目名称:cyphesis,代码行数:4,代码来源:Accountintegration.cpp



注:本文中的TestAccount类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TestActiveDOMObject类代码示例发布时间:2022-05-31
下一篇:
C++ Test类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap