mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-22 07:41:20 -04:00
added cleanup function to test hub
refined group retrieval for RsDataService also added fix for RsNxsTrasac flag masks added group data send transaction generation, and fix for request generation git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-new_cache_system@5298 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
24f6f874f2
commit
d3e5ec2836
12 changed files with 489 additions and 147 deletions
|
@ -66,9 +66,12 @@ void NxsTestHub::run()
|
|||
netServicePairs.second->join();
|
||||
}
|
||||
|
||||
void NxsTestHub::cleanUp()
|
||||
{
|
||||
mTestScenario->cleanUp();
|
||||
}
|
||||
|
||||
bool NxsTestHub::testsPassed()
|
||||
{
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -94,6 +94,7 @@ public:
|
|||
void run();
|
||||
|
||||
|
||||
void cleanUp();
|
||||
private:
|
||||
|
||||
std::pair<p3Service*, p3Service*> mServicePairs;
|
||||
|
|
|
@ -88,8 +88,8 @@ void NxsMessageTest::populateStore(RsGeneralDataService* dStore)
|
|||
init_item(*msg);
|
||||
init_item(msgMeta);
|
||||
std::pair<RsNxsMsg*, RsGxsMsgMetaData*> p(msg, msgMeta);
|
||||
int chosen = 0;
|
||||
|
||||
// pick a grp at random to associate the msg to
|
||||
const std::string& grpId = grpIdList[rand()%nGrp];
|
||||
msgMeta->mMsgId = msg->msgId;
|
||||
msgMeta->mGroupId = msg->grpId = grpId;
|
||||
|
@ -145,3 +145,11 @@ RsGeneralDataService* NxsMessageTest::dummyDataService2()
|
|||
{
|
||||
return mStorePair.second;
|
||||
}
|
||||
|
||||
void NxsMessageTest::cleanUp()
|
||||
{
|
||||
mStorePair.first->resetDataStore();
|
||||
mStorePair.second->resetDataStore();
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -24,6 +24,12 @@ public:
|
|||
virtual RsGeneralDataService* dummyDataService1() = 0;
|
||||
virtual RsGeneralDataService* dummyDataService2() = 0;
|
||||
|
||||
/*!
|
||||
* Call to remove files created
|
||||
* in the test directory
|
||||
*/
|
||||
virtual void cleanUp() = 0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
@ -38,6 +44,12 @@ public:
|
|||
RsGeneralDataService* dummyDataService1();
|
||||
RsGeneralDataService* dummyDataService2();
|
||||
|
||||
/*!
|
||||
* Call to remove files created
|
||||
* in the test directory
|
||||
*/
|
||||
void cleanUp();
|
||||
|
||||
public:
|
||||
|
||||
/*!
|
||||
|
|
|
@ -23,11 +23,13 @@ int main()
|
|||
createThread(hub);
|
||||
|
||||
// put this thread to sleep for 10 secs
|
||||
usleep(10000);
|
||||
sleep(10);
|
||||
|
||||
hub.join();
|
||||
CHECK(hub.testsPassed());
|
||||
|
||||
hub.cleanUp();
|
||||
|
||||
FINALREPORT("RsGxsNetService Tests");
|
||||
|
||||
return TESTRESULT();
|
||||
|
|
|
@ -86,7 +86,7 @@ RsSerialType* init_item(RsNxsTransac& rstx){
|
|||
|
||||
rstx.clear();
|
||||
|
||||
rstx.timeout = rand()%14141;
|
||||
rstx.timestamp = rand()%14141;
|
||||
rstx.transactFlag = rand()%2424;
|
||||
rstx.nItems = rand()%33132;
|
||||
rstx.transactionNumber = rand()%242112;
|
||||
|
@ -162,7 +162,7 @@ bool operator==(const RsNxsTransac& l, const RsNxsTransac& r){
|
|||
|
||||
if(l.transactFlag != r.transactFlag) return false;
|
||||
if(l.transactionNumber != r.transactionNumber) return false;
|
||||
if(l.timeout != r.timeout) return false;
|
||||
if(l.timestamp != r.timestamp) return false;
|
||||
if(l.nItems != r.nItems) return false;
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue