#ifndef TEST_SETUP_HELPERS_H #define TEST_SETUP_HELPERS_H #include #include #include #include typedef std::auto_ptr AutoConnection; typedef std::auto_ptr AutoAccount; typedef std::auto_ptr AutoAvatar; AutoConnection stdConnect(); AutoAccount stdLogin(const std::string& uname, const std::string& pwd, Eris::Connection* con); class AvatarGetter : public SigC::Object { public: AvatarGetter(Eris::Account* acc); void expectFailure() { m_expectFail = true; } void returnOnSuccess() { m_earlyReturn = true; } AutoAvatar take(const std::string& charId); AutoAvatar create(const Atlas::Objects::Entity::RootEntity& charEnt); private: void success(Eris::Avatar* av); void failure(const std::string& msg); bool m_waiting; Eris::Account* m_acc; AutoAvatar m_av; bool m_expectFail, m_failed; bool m_earlyReturn; }; #endif // of TEST_SETUP_HELPERS_H