RetroShare/tests/unittests/libretroshare/gxs/nxs_test/rsgxsnetservice_test.cc
drbob 2a5854188e Added new test structure for libretroshare
ported some of the tests across.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7233 b45a01b8-16f6-495d-af2f-9b41ad6348cc
2014-04-05 07:27:18 +00:00

47 lines
822 B
C++

/*
* rsgxsnetservice_test.cc
*
* Created on: 11 Jul 2012
* Author: crispy
*/
#include "util/utest.h"
#include "nxstesthub.h"
#include "nxstestscenario.h"
INITTEST();
int main()
{
// first setup
NxsMessageTest msgTest(RS_SERVICE_TYPE_PLUGIN_SIMPLE_FORUM);
std::set<std::string> peers;
peers.insert("PeerA");
peers.insert("PeerB");
NxsTestHub hub(&msgTest, peers);
// now get things started
createThread(hub);
double timeDelta = 50;
// put this thread to sleep for 10 secs
// make thread sleep for a bit
#ifndef WINDOWS_SYS
usleep((int) (timeDelta * 1000000));
#else
Sleep((int) (timeDelta * 1000));
#endif
hub.join();
CHECK(hub.testsPassed());
hub.cleanUp();
FINALREPORT("RsGxsNetService Tests");
return TESTRESULT();
}