Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
Added unit tests for ServerInfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikogenvik committed Feb 25, 2012
1 parent 0144056 commit 9223ff8
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test/ServerInfo_unittest.cpp
Expand Up @@ -24,7 +24,49 @@
#define DEBUG
#endif

#include "Eris/ServerInfo.h"
#include "ElementExerciser.h"
#include <Atlas/Objects/RootEntity.h>
#include <sigc++/slot.h>

namespace Eris
{

class TestServerInfo: public ServerInfo
{
public:
void injectAtlas(const Atlas::Objects::Entity::RootEntity& svr)
{
processServer(svr);
}
};
}

int main()
{

//ctor
new Eris::ServerInfo();

{
//ctor and dtor
Eris::ServerInfo();
}

Eris::TestServerInfo info;

sigc::slot<void, const Atlas::Objects::Entity::RootEntity&> slot(
sigc::mem_fun(info, &Eris::TestServerInfo::injectAtlas));
ElementExerciser<Atlas::Objects::Entity::RootEntity> exerciser(slot);
exerciser.addParam("ruleset", ElementParam("mason"));
exerciser.addParam("clients", ElementParam(2));
exerciser.addParam("server", ElementParam("localhost"));
exerciser.addParam("uptime", ElementParam(1000.0f));
exerciser.addParam("entities", ElementParam(200));
exerciser.addParam("version", ElementParam("1.0"));
exerciser.addParam("builddate", ElementParam("2000-01-01"));

exerciser.exercise();

return 0;
}

0 comments on commit 9223ff8

Please sign in to comment.