mirror of
https://github.com/RetroShare/libretroshare.git
synced 2026-09-12 19:50:03 +05:00
Fix UnitTest Compilation and Travis Error.
This commit is contained in:
parent
86dc0a1db1
commit
1e20e26699
@ -335,38 +335,3 @@ void tearDown(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool operator ==(const RsGxsGrpMetaData& l, const RsGxsGrpMetaData& r)
|
||||
{
|
||||
if(!(l.signSet == r.signSet)) return false;
|
||||
if(!(l.keys == r.keys)) return false;
|
||||
if(l.mGroupFlags != r.mGroupFlags) return false;
|
||||
if(l.mPublishTs != r.mPublishTs) return false;
|
||||
if(l.mAuthorId != r.mAuthorId) return false;
|
||||
if(l.mGroupName != r.mGroupName) return false;
|
||||
if(l.mGroupId != r.mGroupId) return false;
|
||||
if(l.mGroupStatus != r.mGroupStatus) return false;
|
||||
if(l.mPop != r.mPop) return false;
|
||||
if(l.mMsgCount != r.mMsgCount) return false;
|
||||
if(l.mSubscribeFlags != r.mSubscribeFlags) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool operator ==(const RsGxsMsgMetaData& l, const RsGxsMsgMetaData& r)
|
||||
{
|
||||
|
||||
if(!(l.signSet == r.signSet)) return false;
|
||||
if(l.mGroupId != r.mGroupId) return false;
|
||||
if(l.mAuthorId != r.mAuthorId) return false;
|
||||
if(l.mParentId != r.mParentId) return false;
|
||||
if(l.mOrigMsgId != r.mOrigMsgId) return false;
|
||||
if(l.mThreadId != r.mThreadId) return false;
|
||||
if(l.mMsgId != r.mMsgId) return false;
|
||||
if(l.mMsgName != r.mMsgName) return false;
|
||||
if(l.mPublishTs != r.mPublishTs) return false;
|
||||
if(l.mMsgFlags != r.mMsgFlags) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ void init_item(RsGxsGrpMetaData* metaGrp)
|
||||
randString(SHORT_STR, metaGrp->mGroupName);
|
||||
randString(SHORT_STR, metaGrp->mServiceString);
|
||||
|
||||
init_item(metaGrp->signSet);
|
||||
init_item(metaGrp->signSet);// This is not stored in db.
|
||||
init_item(metaGrp->keys);
|
||||
|
||||
metaGrp->mPublishTs = rand()%3452;
|
||||
@ -115,9 +115,10 @@ void init_item(RsGxsGrpMetaData* metaGrp)
|
||||
metaGrp->mGroupStatus = rand()%313;
|
||||
metaGrp->mRecvTS = rand()%313;
|
||||
|
||||
metaGrp->mOriginator = RsPeerId::random() ;
|
||||
metaGrp->mInternalCircle = RsGxsCircleId::random() ;
|
||||
metaGrp->mHash = RsFileHash::random() ;
|
||||
metaGrp->mOriginator = RsPeerId::random();
|
||||
metaGrp->mInternalCircle = RsGxsCircleId::random();
|
||||
metaGrp->mHash = RsFileHash::random();
|
||||
metaGrp->mGrpSize = 0;// This was calculated on db read.
|
||||
}
|
||||
|
||||
void init_item(RsGxsMsgMetaData* metaMsg)
|
||||
|
||||
@ -107,6 +107,11 @@ void test_groupStoreAndRetrieve(){
|
||||
RsGxsGrpMetaData *l_Meta = mit->second,
|
||||
*r_Meta = grpMetaR[grpId];
|
||||
|
||||
// assign signSet and mGrpSize
|
||||
// to right as these values are not stored in db
|
||||
r_Meta->signSet = l_Meta->signSet;
|
||||
r_Meta->mGrpSize = l_Meta->mGrpSize;
|
||||
|
||||
if(!(*l_Meta == *r_Meta))
|
||||
{
|
||||
grpMetaMatch = false;
|
||||
|
||||
@ -81,6 +81,7 @@ void GxsTestStats::testServiceStatistics()
|
||||
RsDummyGrp* dgrp2 = new RsDummyGrp();
|
||||
|
||||
init(*dgrp1);
|
||||
init(*dgrp2);
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = 45000;
|
||||
uint32_t token;
|
||||
|
||||
@ -110,7 +110,7 @@ namespace rs_nxs_test
|
||||
bool loadReputation(const RsGxsId &id, const std::list<RsPeerId>& peers);
|
||||
bool getReputation(const RsGxsId &id, GixsReputation &rep);
|
||||
|
||||
virtual RsReputations::ReputationLevel overallReputationLevel(const RsGxsId&) { return RsReputations::REPUTATION_NEUTRAL ; }
|
||||
virtual RsReputations::ReputationLevel overallReputationLevel(const RsGxsId&,uint32_t */*identity_flags*/=NULL) { return RsReputations::REPUTATION_NEUTRAL ; }
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@ -68,14 +68,11 @@ void init_item(RsTlvSecurityKeySet& ks)
|
||||
randString(SHORT_STR, ks.groupId);
|
||||
for(int i=1; i<n; i++)
|
||||
{
|
||||
RsGxsId pub_str;
|
||||
RsGxsId pri_str;
|
||||
pub_str = RsGxsId::random();
|
||||
pri_str = RsGxsId::random();
|
||||
|
||||
RsTlvPublicRSAKey& pub_key = ks.public_keys[pub_str];
|
||||
RsTlvPrivateRSAKey& pri_key = ks.private_keys[pri_str];
|
||||
RsTlvPublicRSAKey pub_key;
|
||||
RsTlvPrivateRSAKey pri_key;
|
||||
GxsSecurity::generateKeyPair(pub_key, pri_key);
|
||||
ks.public_keys[pub_key.keyId] = pub_key;
|
||||
ks.private_keys[pri_key.keyId] = pri_key;
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,8 +92,6 @@ bool operator==(const RsTlvSecurityKeySet& l, const RsTlvSecurityKeySet& r)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool operator==(const RsTlvPublicRSAKey& sk1, const RsTlvPublicRSAKey& sk2)
|
||||
{
|
||||
|
||||
@ -209,7 +204,6 @@ void init_item(RsTlvKeySignatureSet &kss)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool operator==(const RsTlvImage& img1, const RsTlvImage& img2)
|
||||
{
|
||||
if(img1.image_type != img2.image_type) return false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user