mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-20 04:14:27 -04:00
Fix all warnings in UnitTest
This commit is contained in:
parent
e3240de8e0
commit
aa05d60894
25 changed files with 95 additions and 93 deletions
|
@ -40,7 +40,7 @@ bool AuthorPending::expired() const
|
||||||
return time(NULL) > (mTimeStamp + EXPIRY_PERIOD_OFFSET);
|
return time(NULL) > (mTimeStamp + EXPIRY_PERIOD_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AuthorPending::getAuthorRep(GixsReputation& rep, const RsGxsId& authorId, const RsPeerId& peerId)
|
bool AuthorPending::getAuthorRep(GixsReputation& rep, const RsGxsId& authorId, const RsPeerId& /*peerId*/)
|
||||||
{
|
{
|
||||||
rep.id = authorId ;
|
rep.id = authorId ;
|
||||||
rep.reputation_level = mRep->overallReputationLevel(authorId);
|
rep.reputation_level = mRep->overallReputationLevel(authorId);
|
||||||
|
@ -96,7 +96,7 @@ bool MsgRespPending::accepted()
|
||||||
GixsReputation rep;
|
GixsReputation rep;
|
||||||
if(getAuthorRep(rep, entry.mAuthorId, mPeerId))
|
if(getAuthorRep(rep, entry.mAuthorId, mPeerId))
|
||||||
{
|
{
|
||||||
if(rep.reputation_level >= mCutOff)
|
if(rep.reputation_level >= (uint32_t)mCutOff)
|
||||||
{
|
{
|
||||||
entry.mPassedVetting = true;
|
entry.mPassedVetting = true;
|
||||||
count++;
|
count++;
|
||||||
|
@ -131,7 +131,7 @@ bool GrpRespPending::accepted()
|
||||||
|
|
||||||
if(getAuthorRep(rep, entry.mAuthorId, mPeerId))
|
if(getAuthorRep(rep, entry.mAuthorId, mPeerId))
|
||||||
{
|
{
|
||||||
if(rep.reputation_level >= mCutOff)
|
if(rep.reputation_level >= (uint32_t)mCutOff)
|
||||||
{
|
{
|
||||||
entry.mPassedVetting = true;
|
entry.mPassedVetting = true;
|
||||||
count++;
|
count++;
|
||||||
|
|
|
@ -91,9 +91,9 @@ public:
|
||||||
|
|
||||||
virtual ~RsGxsReputationSetItem_deprecated3() {}
|
virtual ~RsGxsReputationSetItem_deprecated3() {}
|
||||||
virtual void clear() {}
|
virtual void clear() {}
|
||||||
std::ostream &print(std::ostream &out, uint16_t indent = 0) { return out;}
|
std::ostream &print(std::ostream &out, uint16_t /*indent*/ = 0) { return out;}
|
||||||
|
|
||||||
virtual bool serialise(void *data,uint32_t& size) const { return false ;}
|
virtual bool serialise(void */*data*/,uint32_t& /*size*/) const { return false ;}
|
||||||
virtual uint32_t serial_size() const { return 0;}
|
virtual uint32_t serial_size() const { return 0;}
|
||||||
|
|
||||||
RsGxsId mGxsId;
|
RsGxsId mGxsId;
|
||||||
|
|
|
@ -18,7 +18,7 @@ class RsSharedPtr
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
RsSharedPtr() : mShared(NULL), mCount(NULL) {}
|
RsSharedPtr() : mShared(NULL), mCount(NULL), mSharedPtrMutex(NULL){}
|
||||||
|
|
||||||
RsSharedPtr(T* shared)
|
RsSharedPtr(T* shared)
|
||||||
: mShared(shared), mCount(new int(0)), mSharedPtrMutex(new RsMutex("SharedMutex"))
|
: mShared(shared), mCount(new int(0)), mSharedPtrMutex(new RsMutex("SharedMutex"))
|
||||||
|
@ -96,8 +96,8 @@ private:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int* mCount;
|
|
||||||
T* mShared;
|
T* mShared;
|
||||||
|
int* mCount;
|
||||||
RsMutex* mSharedPtrMutex;
|
RsMutex* mSharedPtrMutex;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1391,7 +1391,7 @@ void GxsForumThreadWidget::fillThreads(QList<QTreeWidgetItem *> &threadList, boo
|
||||||
|
|
||||||
//(csoler) QTreeWidget::findItems apparently does not always work so I need to make the search manually, which I do using a map for efficiency reasons.
|
//(csoler) QTreeWidget::findItems apparently does not always work so I need to make the search manually, which I do using a map for efficiency reasons.
|
||||||
std::map<QString,QTreeWidgetItem*> oldThreadMap;
|
std::map<QString,QTreeWidgetItem*> oldThreadMap;
|
||||||
for(uint32_t i=0;i<ui->threadTreeWidget->topLevelItemCount();++i)
|
for(int i=0; i<ui->threadTreeWidget->topLevelItemCount(); ++i)
|
||||||
oldThreadMap[ui->threadTreeWidget->topLevelItem(i)->data(COLUMN_THREAD_MSGID, Qt::DisplayRole).toString()] = ui->threadTreeWidget->topLevelItem(i);
|
oldThreadMap[ui->threadTreeWidget->topLevelItem(i)->data(COLUMN_THREAD_MSGID, Qt::DisplayRole).toString()] = ui->threadTreeWidget->topLevelItem(i);
|
||||||
|
|
||||||
// iterate all new threads
|
// iterate all new threads
|
||||||
|
|
|
@ -97,7 +97,7 @@ SetPacket &SetServiceTester::examinePacket(uint32_t idx)
|
||||||
return mPackets[idx];
|
return mPackets[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SetServiceTester::injectPacket(const SetPacket &pkt)
|
bool SetServiceTester::injectPacket(const SetPacket &/*pkt*/)
|
||||||
{
|
{
|
||||||
std::cerr << "SetServiceTester::injectPacket() Incomplete";
|
std::cerr << "SetServiceTester::injectPacket() Incomplete";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
|
@ -124,7 +124,7 @@ void test_groupStoreAndRetrieve(){
|
||||||
|
|
||||||
grpMetaR.clear();
|
grpMetaR.clear();
|
||||||
|
|
||||||
EXPECT_TRUE(grpMatch);
|
EXPECT_TRUE(grpMatch && grpMetaMatch);
|
||||||
tearDown();
|
tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,12 +225,12 @@ void test_messageStoresAndRetrieve()
|
||||||
std::vector<RsNxsMsg*>& result0 = msgResult[grpId0];
|
std::vector<RsNxsMsg*>& result0 = msgResult[grpId0];
|
||||||
std::vector<RsNxsMsg*>& result1 = msgResult[grpId1];
|
std::vector<RsNxsMsg*>& result1 = msgResult[grpId1];
|
||||||
std::vector<RsGxsMsgMetaData*>& resultMeta0 = msgMetaResult[grpId0];
|
std::vector<RsGxsMsgMetaData*>& resultMeta0 = msgMetaResult[grpId0];
|
||||||
std::vector<RsGxsMsgMetaData*>& resultMeta1 = msgMetaResult[grpId1];
|
//std::vector<RsGxsMsgMetaData*>& resultMeta1 = msgMetaResult[grpId1];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool msgGrpId0_Match = true, msgGrpId1_Match = true;
|
bool msgGrpId0_Match = true, msgGrpId1_Match = true;
|
||||||
bool msgMetaGrpId0_Match = true, msgMetaGrpId1_Match = true;
|
bool msgMetaGrpId0_Match = true/*, msgMetaGrpId1_Match = true*/;
|
||||||
|
|
||||||
// MSG test, selective retrieval
|
// MSG test, selective retrieval
|
||||||
for(std::vector<RsNxsMsg*>::size_type i = 0; i < result0.size(); i++)
|
for(std::vector<RsNxsMsg*>::size_type i = 0; i < result0.size(); i++)
|
||||||
|
|
|
@ -334,7 +334,8 @@ void GenExchangeTest::init(RsGroupMetaData& grpMetaData) const
|
||||||
randString(SHORT_STR, grpMetaData.mServiceString);
|
randString(SHORT_STR, grpMetaData.mServiceString);
|
||||||
|
|
||||||
|
|
||||||
grpMetaData.mGroupFlags = randNum();
|
grpMetaData.mGroupFlags = randNum() & (0x00000007);//See GXS_SERV::FLAG_PRIVACY_XXX values /libretroshare/src/retroshare/rsgxsflags.h:21
|
||||||
|
if (grpMetaData.mGroupFlags == 0) grpMetaData.mGroupFlags = GXS_SERV::FLAG_PRIVACY_PRIVATE;
|
||||||
grpMetaData.mLastPost = randNum();
|
grpMetaData.mLastPost = randNum();
|
||||||
grpMetaData.mGroupStatus = randNum();
|
grpMetaData.mGroupStatus = randNum();
|
||||||
grpMetaData.mVisibleMsgCount = randNum();
|
grpMetaData.mVisibleMsgCount = randNum();
|
||||||
|
@ -595,7 +596,7 @@ bool operator ==(const RsDummyMsg& lMsg, const RsDummyMsg& rMsg)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator ==(const RsGxsGrpItem& lGrp, const RsGxsGrpItem& rGrp)
|
bool operator ==(const RsGxsGrpItem& /*lGrp*/, const RsGxsGrpItem& /*rGrp*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ RsServiceInfo GenExchangeTestService::getServiceInfo()
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenExchangeTestService::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
void GenExchangeTestService::notifyChanges(std::vector<RsGxsNotify *> &/*changes*/)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ void GenExchangeTestService::publishDummyGrp(uint32_t &token, RsDummyGrp *grp)
|
||||||
publishGroup(token, grp);
|
publishGroup(token, grp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenExchangeTestService::updateDummyGrp(uint32_t &token, RsGxsGroupUpdateMeta &updateMeta, RsDummyGrp *group)
|
void GenExchangeTestService::updateDummyGrp(uint32_t &token, RsGxsGroupUpdateMeta &/*updateMeta*/, RsDummyGrp *group)
|
||||||
{
|
{
|
||||||
//updateGroup(token, updateMeta, group);
|
//updateGroup(token, updateMeta, group);
|
||||||
updateGroup(token, group);
|
updateGroup(token, group);
|
||||||
|
|
|
@ -15,18 +15,18 @@ public:
|
||||||
RsDummyNetService(){ return;}
|
RsDummyNetService(){ return;}
|
||||||
virtual ~RsDummyNetService() { }
|
virtual ~RsDummyNetService() { }
|
||||||
|
|
||||||
void setSyncAge(const RsGxsGroupId& id,uint32_t age_in_secs){}
|
void setSyncAge(const RsGxsGroupId& /*id*/,uint32_t /*age_in_secs*/){}
|
||||||
void setKeepAge(const RsGxsGroupId& id,uint32_t age_in_secs){}
|
void setKeepAge(const RsGxsGroupId& /*id*/,uint32_t /*age_in_secs*/){}
|
||||||
|
|
||||||
void requestGroupsOfPeer(const std::string& peerId){}
|
void requestGroupsOfPeer(const std::string& /*peerId*/){}
|
||||||
|
|
||||||
void requestMessagesOfPeer(const std::string& peerId, const std::string& grpId){}
|
void requestMessagesOfPeer(const std::string& /*peerId*/, const std::string& /*grpId*/){}
|
||||||
|
|
||||||
void pauseSynchronisation(bool enabled) {}
|
void pauseSynchronisation(bool /*enabled*/) {}
|
||||||
|
|
||||||
int requestMsg(const std::string& msgId, uint8_t hops){ return 0;}
|
int requestMsg(const std::string& /*msgId*/, uint8_t /*hops*/){ return 0;}
|
||||||
|
|
||||||
int requestGrp(const std::list<std::string>& grpId, uint8_t hops) { return 0;}
|
int requestGrp(const std::list<std::string>& /*grpId*/, uint8_t /*hops*/) { return 0;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public:
|
||||||
|
|
||||||
std::string msgData;
|
std::string msgData;
|
||||||
|
|
||||||
std::ostream &print(std::ostream &out, uint16_t indent = 0){ return out; }
|
std::ostream &print(std::ostream &out, uint16_t /*indent*/ = 0){ return out; }
|
||||||
void clear() { msgData.clear(); }
|
void clear() { msgData.clear(); }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -59,7 +59,7 @@ public:
|
||||||
|
|
||||||
std::string grpData;
|
std::string grpData;
|
||||||
void clear() { grpData.clear(); }
|
void clear() { grpData.clear(); }
|
||||||
std::ostream &print(std::ostream &out, uint16_t indent = 0){ return out; }
|
std::ostream &print(std::ostream &out, uint16_t /*indent*/ = 0){ return out; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ public:
|
||||||
* @param
|
* @param
|
||||||
* @param dummyId This is is the only id thats exists in this dummy interface
|
* @param dummyId This is is the only id thats exists in this dummy interface
|
||||||
*/
|
*/
|
||||||
RsGixsDummy(const RsGxsId& incomingId, const RsGxsId& outgoingId){}
|
RsGixsDummy(const RsGxsId& /*incomingId*/, const RsGxsId& /*outgoingId*/){}
|
||||||
|
|
||||||
virtual ~RsGixsDummy(){}
|
virtual ~RsGixsDummy(){}
|
||||||
|
|
||||||
|
@ -130,14 +130,14 @@ public:
|
||||||
* @param keyref the keyref of key that is being checked for
|
* @param keyref the keyref of key that is being checked for
|
||||||
* @return true if available, false otherwise
|
* @return true if available, false otherwise
|
||||||
*/
|
*/
|
||||||
bool haveKey(const RsGxsId &id){ return false;}
|
bool haveKey(const RsGxsId &/*id*/){ return false;}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Use to query whether private key member of the given key reference is available
|
* Use to query whether private key member of the given key reference is available
|
||||||
* @param keyref the KeyRef of the key being checked for
|
* @param keyref the KeyRef of the key being checked for
|
||||||
* @return true if private key is held here, false otherwise
|
* @return true if private key is held here, false otherwise
|
||||||
*/
|
*/
|
||||||
bool havePrivateKey(const RsGxsId &id){ return false; }
|
bool havePrivateKey(const RsGxsId &/*id*/){ return false; }
|
||||||
|
|
||||||
// The fetchKey has an optional peerList.. this is people that had the msg with the signature.
|
// The fetchKey has an optional peerList.. this is people that had the msg with the signature.
|
||||||
// These same people should have the identity - so we ask them first.
|
// These same people should have the identity - so we ask them first.
|
||||||
|
@ -146,8 +146,8 @@ public:
|
||||||
* @param keyref the KeyRef of the key being requested
|
* @param keyref the KeyRef of the key being requested
|
||||||
* @return will
|
* @return will
|
||||||
*/
|
*/
|
||||||
bool requestKey(const RsGxsId &id, const std::list<RsPeerId> &peers){ return false ;}
|
bool requestKey(const RsGxsId &/*id*/, const std::list<RsPeerId> &/*peers*/){ return false ;}
|
||||||
bool requestPrivateKey(const RsGxsId &id){ return false;}
|
bool requestPrivateKey(const RsGxsId &/*id*/){ return false;}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -156,8 +156,8 @@ public:
|
||||||
* @return a pointer to a valid profile if successful, otherwise NULL
|
* @return a pointer to a valid profile if successful, otherwise NULL
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool getKey(const RsGxsId &id, RsTlvPublicRSAKey& key){ return false; }
|
bool getKey(const RsGxsId &/*id*/, RsTlvPublicRSAKey& /*key*/){ return false; }
|
||||||
bool getPrivateKey(const RsGxsId &id, RsTlvPrivateRSAKey& key){ return false; } // For signing outgoing messages.
|
bool getPrivateKey(const RsGxsId &/*id*/, RsTlvPrivateRSAKey& /*key*/){ return false; } // For signing outgoing messages.
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -14,53 +14,54 @@ rs_nxs_test::RsNxsSimpleDummyCircles::RsNxsSimpleDummyCircles() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rs_nxs_test::RsNxsSimpleDummyCircles::isLoaded(
|
bool rs_nxs_test::RsNxsSimpleDummyCircles::isLoaded(
|
||||||
const RsGxsCircleId& circleId) {
|
const RsGxsCircleId& /*circleId*/) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rs_nxs_test::RsNxsSimpleDummyCircles::loadCircle(
|
bool rs_nxs_test::RsNxsSimpleDummyCircles::loadCircle(
|
||||||
const RsGxsCircleId& circleId) {
|
const RsGxsCircleId& /*circleId*/) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rs_nxs_test::RsNxsSimpleDummyCircles::canSend(const RsGxsCircleId& circleId,
|
int rs_nxs_test::RsNxsSimpleDummyCircles::canSend(const RsGxsCircleId& /*circleId*/,
|
||||||
const RsPgpId& id, bool &should_encrypt) {
|
const RsPgpId& /*id*/, bool &/*should_encrypt*/) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rs_nxs_test::RsNxsSimpleDummyCircles::canReceive(
|
int rs_nxs_test::RsNxsSimpleDummyCircles::canReceive(
|
||||||
const RsGxsCircleId& circleId, const RsPgpId& id) {
|
const RsGxsCircleId& /*circleId*/, const RsPgpId& /*id*/) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rs_nxs_test::RsNxsSimpleDummyCircles::isRecipient(const RsGxsCircleId &circleId, const RsGxsGroupId &destination_group, const RsGxsId& id)
|
bool rs_nxs_test::RsNxsSimpleDummyCircles::isRecipient(const RsGxsCircleId &/*circleId*/, const RsGxsGroupId &/*destination_group*/, const RsGxsId& /*id*/)
|
||||||
{
|
{
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rs_nxs_test::RsNxsSimpleDummyCircles::recipients(
|
bool rs_nxs_test::RsNxsSimpleDummyCircles::recipients(
|
||||||
const RsGxsCircleId& circleId, std::list<RsPgpId>& friendlist) {
|
const RsGxsCircleId& /*circleId*/, std::list<RsPgpId>& /*friendlist*/) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rs_nxs_test::RsNxsSimpleDummyCircles::recipients(const RsGxsCircleId& circleId, const RsGxsGroupId &destination_group, std::list<RsGxsId>& friendlist) {
|
bool rs_nxs_test::RsNxsSimpleDummyCircles::recipients(const RsGxsCircleId& /*circleId*/, const RsGxsGroupId &/*destination_group*/, std::list<RsGxsId>& /*friendlist*/) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
rs_nxs_test::RsNxsSimpleDummyReputation::RsNxsSimpleDummyReputation(
|
rs_nxs_test::RsNxsSimpleDummyReputation::RsNxsSimpleDummyReputation(
|
||||||
RepMap& repMap, bool cached) {
|
RepMap& /*repMap*/, bool /*cached*/) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rs_nxs_test::RsNxsSimpleDummyReputation::haveReputation(
|
bool rs_nxs_test::RsNxsSimpleDummyReputation::haveReputation(
|
||||||
const RsGxsId& id) {
|
const RsGxsId& /*id*/) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rs_nxs_test::RsNxsSimpleDummyReputation::loadReputation(const RsGxsId& id,
|
bool rs_nxs_test::RsNxsSimpleDummyReputation::loadReputation(const RsGxsId& /*id*/,
|
||||||
const std::list<RsPeerId>& peers) {
|
const std::list<RsPeerId>& /*peers*/) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rs_nxs_test::RsNxsSimpleDummyReputation::getReputation(const RsGxsId& id,
|
bool rs_nxs_test::RsNxsSimpleDummyReputation::getReputation(const RsGxsId& /*id*/,
|
||||||
GixsReputation& rep) {
|
GixsReputation& rep) {
|
||||||
rep.reputation_level = 5;
|
rep.reputation_level = 5;
|
||||||
return true;
|
return true;
|
||||||
|
@ -84,17 +85,17 @@ bool rs_nxs_test::RsNxsDelayedDummyCircles::loadCircle(
|
||||||
return allowed(circleId);
|
return allowed(circleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
int rs_nxs_test::RsNxsDelayedDummyCircles::canSend(const RsGxsCircleId& circleId, const RsPgpId& id, bool &should_encrypt) {
|
int rs_nxs_test::RsNxsDelayedDummyCircles::canSend(const RsGxsCircleId& circleId, const RsPgpId& /*id*/, bool &/*should_encrypt*/) {
|
||||||
return allowed(circleId);
|
return allowed(circleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
int rs_nxs_test::RsNxsDelayedDummyCircles::canReceive(
|
int rs_nxs_test::RsNxsDelayedDummyCircles::canReceive(
|
||||||
const RsGxsCircleId& circleId, const RsPgpId& id) {
|
const RsGxsCircleId& circleId, const RsPgpId& /*id*/) {
|
||||||
return allowed(circleId);
|
return allowed(circleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rs_nxs_test::RsNxsDelayedDummyCircles::recipients(
|
bool rs_nxs_test::RsNxsDelayedDummyCircles::recipients(
|
||||||
const RsGxsCircleId& circleId, std::list<RsPgpId>& friendlist) {
|
const RsGxsCircleId& circleId, std::list<RsPgpId>& /*friendlist*/) {
|
||||||
return allowed(circleId);
|
return allowed(circleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace rs_nxs_test
|
||||||
virtual bool recipients(const RsGxsCircleId &circleId, std::list<RsPgpId> &friendlist);
|
virtual bool recipients(const RsGxsCircleId &circleId, std::list<RsPgpId> &friendlist);
|
||||||
virtual bool recipients(const RsGxsCircleId &circleId, const RsGxsGroupId& destination_group, std::list<RsGxsId>& idlist) ;
|
virtual bool recipients(const RsGxsCircleId &circleId, const RsGxsGroupId& destination_group, std::list<RsGxsId>& idlist) ;
|
||||||
virtual bool isRecipient(const RsGxsCircleId &circleId, const RsGxsGroupId& destination_group, const RsGxsId& id) ;
|
virtual bool isRecipient(const RsGxsCircleId &circleId, const RsGxsGroupId& destination_group, const RsGxsId& id) ;
|
||||||
virtual bool getLocalCircleServerUpdateTS(const RsGxsCircleId& gid,time_t& grp_server_update_TS,time_t& msg_server_update_TS) { return true ; }
|
virtual bool getLocalCircleServerUpdateTS(const RsGxsCircleId& /*gid*/,time_t& /*grp_server_update_TS*/,time_t& /*msg_server_update_TS*/) { return true ; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -71,9 +71,9 @@ namespace rs_nxs_test
|
||||||
int canSend(const RsGxsCircleId &circleId, const RsPgpId &id,bool& should_encrypt);
|
int canSend(const RsGxsCircleId &circleId, const RsPgpId &id,bool& should_encrypt);
|
||||||
int canReceive(const RsGxsCircleId &circleId, const RsPgpId &id);
|
int canReceive(const RsGxsCircleId &circleId, const RsPgpId &id);
|
||||||
virtual bool recipients(const RsGxsCircleId &circleId, std::list<RsPgpId> &friendlist);
|
virtual bool recipients(const RsGxsCircleId &circleId, std::list<RsPgpId> &friendlist);
|
||||||
virtual bool recipients(const RsGxsCircleId &circleId, const RsGxsGroupId& destination_group, std::list<RsGxsId>& idlist) { return true ;}
|
virtual bool recipients(const RsGxsCircleId &/*circleId*/, const RsGxsGroupId& /*destination_group*/, std::list<RsGxsId>& /*idlist*/) { return true ;}
|
||||||
virtual bool isRecipient(const RsGxsCircleId &circleId, const RsGxsGroupId& destination_group, const RsGxsId& id) { return allowed(circleId) ; }
|
virtual bool isRecipient(const RsGxsCircleId &circleId, const RsGxsGroupId& /*destination_group*/, const RsGxsId& /*id*/) { return allowed(circleId) ; }
|
||||||
virtual bool getLocalCircleServerUpdateTS(const RsGxsCircleId& gid,time_t& grp_server_update_TS,time_t& msg_server_update_TS) { return true ; }
|
virtual bool getLocalCircleServerUpdateTS(const RsGxsCircleId& /*gid*/,time_t& /*grp_server_update_TS*/,time_t& /*msg_server_update_TS*/) { return true ; }
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool allowed(const RsGxsCircleId& circleId);
|
bool allowed(const RsGxsCircleId& circleId);
|
||||||
|
@ -130,7 +130,7 @@ namespace rs_nxs_test
|
||||||
|
|
||||||
}
|
}
|
||||||
const RsPeerId& getOwnId() { return mOwnId; }
|
const RsPeerId& getOwnId() { return mOwnId; }
|
||||||
void getOnlineList(const uint32_t serviceId, std::set<RsPeerId>& ssl_peers)
|
void getOnlineList(const uint32_t /*serviceId*/, std::set<RsPeerId>& ssl_peers)
|
||||||
{
|
{
|
||||||
RsPeerId::std_list::iterator lit = mPeers.begin();
|
RsPeerId::std_list::iterator lit = mPeers.begin();
|
||||||
|
|
||||||
|
|
|
@ -114,12 +114,12 @@ RsNxsNetMgr* NxsGrpSync::getDummyNetManager(const RsPeerId& peerId)
|
||||||
return mNxsNetMgrs[peerId];
|
return mNxsNetMgrs[peerId];
|
||||||
}
|
}
|
||||||
|
|
||||||
RsGcxs* NxsGrpSync::getDummyCircles(const RsPeerId& peerId)
|
RsGcxs* NxsGrpSync::getDummyCircles(const RsPeerId& /*peerId*/)
|
||||||
{
|
{
|
||||||
return mCircles;
|
return mCircles;
|
||||||
}
|
}
|
||||||
|
|
||||||
RsGixsReputation* NxsGrpSync::getDummyReputations(const RsPeerId& peerId)
|
RsGixsReputation* NxsGrpSync::getDummyReputations(const RsPeerId& /*peerId*/)
|
||||||
{
|
{
|
||||||
return mRep;
|
return mRep;
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,12 +129,12 @@ RsNxsNetMgr* rs_nxs_test::NxsMsgSync::getDummyNetManager(
|
||||||
return mNxsNetMgrs[peerId];
|
return mNxsNetMgrs[peerId];
|
||||||
}
|
}
|
||||||
|
|
||||||
RsGcxs* rs_nxs_test::NxsMsgSync::getDummyCircles(const RsPeerId& peerId) {
|
RsGcxs* rs_nxs_test::NxsMsgSync::getDummyCircles(const RsPeerId& /*peerId*/) {
|
||||||
return mCircles;
|
return mCircles;
|
||||||
}
|
}
|
||||||
|
|
||||||
RsGixsReputation* rs_nxs_test::NxsMsgSync::getDummyReputations(
|
RsGixsReputation* rs_nxs_test::NxsMsgSync::getDummyReputations(
|
||||||
const RsPeerId& peerId) {
|
const RsPeerId& /*peerId*/) {
|
||||||
return mRep;
|
return mRep;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ void rs_nxs_test::NxsTestHub::notifyNewMessages(const RsPeerId& pid,
|
||||||
meta->mChildTs = 0;
|
meta->mChildTs = 0;
|
||||||
meta->recvTS = 0;
|
meta->recvTS = 0;
|
||||||
meta->validated = false;
|
meta->validated = false;
|
||||||
bool ok = meta->deserialise(msg->meta.bin_data, &(msg->meta.bin_len));
|
meta->deserialise(msg->meta.bin_data, &(msg->meta.bin_len));
|
||||||
toStore.insert(std::make_pair(msg, meta));
|
toStore.insert(std::make_pair(msg, meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ void rs_nxs_test::NxsTestHub::notifyNewGroups(const RsPeerId& pid, std::vector<R
|
||||||
{
|
{
|
||||||
RsNxsGrp* grp = *it;
|
RsNxsGrp* grp = *it;
|
||||||
RsGxsGrpMetaData* meta = new RsGxsGrpMetaData();
|
RsGxsGrpMetaData* meta = new RsGxsGrpMetaData();
|
||||||
bool ok = meta->deserialise(grp->meta.bin_data, grp->meta.bin_len);
|
meta->deserialise(grp->meta.bin_data, grp->meta.bin_len);
|
||||||
toStore.insert(std::make_pair(grp, meta));
|
toStore.insert(std::make_pair(grp, meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,9 +103,9 @@ namespace rs_nxs_test
|
||||||
|
|
||||||
typedef std::map<RsPeerId, RsGxsNetService::pointer > PeerNxsMap ;
|
typedef std::map<RsPeerId, RsGxsNetService::pointer > PeerNxsMap ;
|
||||||
|
|
||||||
|
NxsTestScenario::pointer mTestScenario;
|
||||||
RsMutex mMtx;
|
RsMutex mMtx;
|
||||||
PeerNxsMap mPeerNxsMap;
|
PeerNxsMap mPeerNxsMap;
|
||||||
NxsTestScenario::pointer mTestScenario;
|
|
||||||
std::queue<PayLoad> mPayLoad;
|
std::queue<PayLoad> mPayLoad;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -93,7 +93,7 @@ TEST(libretroshare_gxs, GxsSecurity)
|
||||||
|
|
||||||
// Check that decrypted data is equal to original data.
|
// Check that decrypted data is equal to original data.
|
||||||
//
|
//
|
||||||
EXPECT_TRUE((int)data_len == outlen2) ;
|
EXPECT_TRUE(data_len == outlen2) ;
|
||||||
EXPECT_TRUE(!memcmp(data,out2,outlen2)) ;
|
EXPECT_TRUE(!memcmp(data,out2,outlen2)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ bool test_StepThroughTlvStack(std::ostream &str, void *data, int size)
|
||||||
{
|
{
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
uint32_t index = 0;
|
uint32_t index = 0;
|
||||||
while (offset + 4 <= size)
|
while (offset + 4 <= (uint32_t)size)
|
||||||
{
|
{
|
||||||
uint16_t tlvtype = GetTlvType( &(((uint8_t *) data)[offset]) );
|
uint16_t tlvtype = GetTlvType( &(((uint8_t *) data)[offset]) );
|
||||||
uint16_t tlvsize = GetTlvSize( &(((uint8_t *) data)[offset]) );
|
uint16_t tlvsize = GetTlvSize( &(((uint8_t *) data)[offset]) );
|
||||||
|
@ -123,7 +123,7 @@ bool test_StepThroughTlvStack(std::ostream &str, void *data, int size)
|
||||||
|
|
||||||
offset += tlvsize ;
|
offset += tlvsize ;
|
||||||
}
|
}
|
||||||
EXPECT_TRUE(offset == size); /* we match up exactly */
|
EXPECT_TRUE(offset == (uint32_t)size); /* we match up exactly */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ TEST(libretroshare_serialiser, test_RsTlvBase)
|
||||||
uint16_t data5[6 + 20];
|
uint16_t data5[6 + 20];
|
||||||
uint32_t pos =0;
|
uint32_t pos =0;
|
||||||
uint32_t* offset = &pos;
|
uint32_t* offset = &pos;
|
||||||
uint32_t pre_pos = pos;
|
//uint32_t pre_pos = pos;
|
||||||
SetTlvString((void*)data5, sizeof(data5), offset, TLV_TYPE_STR_NAME, teststring);
|
SetTlvString((void*)data5, sizeof(data5), offset, TLV_TYPE_STR_NAME, teststring);
|
||||||
uint32_t tlvsize = GetTlvStringSize(teststring);
|
uint32_t tlvsize = GetTlvStringSize(teststring);
|
||||||
EXPECT_TRUE(tlvsize == *offset);
|
EXPECT_TRUE(tlvsize == *offset);
|
||||||
|
|
|
@ -108,7 +108,7 @@ bool FakePgpAuxUtils::getGPGAllList(std::list<RsPgpId> &ids)
|
||||||
|
|
||||||
bool FakePgpAuxUtils::askForDeferredSelfSignature(const void* /*data*/, const uint32_t /*len*/, unsigned char *sign, unsigned int *signlen,int& signature_result, std::string /*reason = ""*/ )
|
bool FakePgpAuxUtils::askForDeferredSelfSignature(const void* /*data*/, const uint32_t /*len*/, unsigned char *sign, unsigned int *signlen,int& signature_result, std::string /*reason = ""*/ )
|
||||||
{
|
{
|
||||||
for(int i = 0; i < *signlen; i++)
|
for(unsigned int i = 0; i < *signlen; i++)
|
||||||
{
|
{
|
||||||
sign[i] = 0;
|
sign[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,11 +28,11 @@ GxsIsolatedServiceTester::GxsIsolatedServiceTester(const RsPeerId &ownId, const
|
||||||
{
|
{
|
||||||
// extract bits we need.
|
// extract bits we need.
|
||||||
PeerNode *node = getPeerNode();
|
PeerNode *node = getPeerNode();
|
||||||
p3PeerMgr *peerMgr = node->getPeerMgr();
|
//p3PeerMgr *peerMgr = node->getPeerMgr();
|
||||||
p3LinkMgr *linkMgr = node->getLinkMgr();
|
//p3LinkMgr *linkMgr = node->getLinkMgr();
|
||||||
p3NetMgr *netMgr = node->getNetMgr();
|
//p3NetMgr *netMgr = node->getNetMgr();
|
||||||
RsNxsNetMgr *nxsMgr = node->getNxsNetMgr();
|
RsNxsNetMgr *nxsMgr = node->getNxsNetMgr();
|
||||||
p3ServiceControl *serviceCtrl = node->getServiceControl();
|
//p3ServiceControl *serviceCtrl = node->getServiceControl();
|
||||||
|
|
||||||
// Create Service for Testing.
|
// Create Service for Testing.
|
||||||
// Specific Testing service here.
|
// Specific Testing service here.
|
||||||
|
|
|
@ -104,7 +104,7 @@ void GxsPairServiceTester::PrintCapturedPackets()
|
||||||
std::cerr << "#Packets: " << getPacketCount();
|
std::cerr << "#Packets: " << getPacketCount();
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
for(int i = 0; i < getPacketCount(); i++)
|
for(uint32_t i = 0; i < getPacketCount(); i++)
|
||||||
{
|
{
|
||||||
SetPacket &pkt = examinePacket(i);
|
SetPacket &pkt = examinePacket(i);
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,11 @@ GxsPeerNode::GxsPeerNode(const RsPeerId &ownId, const std::list<RsPeerId> &frien
|
||||||
mTestNs(NULL)
|
mTestNs(NULL)
|
||||||
{
|
{
|
||||||
// extract bits we need.
|
// extract bits we need.
|
||||||
p3PeerMgr *peerMgr = getPeerMgr();
|
//p3PeerMgr *peerMgr = getPeerMgr();
|
||||||
p3LinkMgr *linkMgr = getLinkMgr();
|
//p3LinkMgr *linkMgr = getLinkMgr();
|
||||||
p3NetMgr *netMgr = getNetMgr();
|
//p3NetMgr *netMgr = getNetMgr();
|
||||||
RsNxsNetMgr *nxsMgr = getNxsNetMgr();
|
RsNxsNetMgr *nxsMgr = getNxsNetMgr();
|
||||||
p3ServiceControl *serviceCtrl = getServiceControl();
|
//p3ServiceControl *serviceCtrl = getServiceControl();
|
||||||
|
|
||||||
// Create Service for Testing.
|
// Create Service for Testing.
|
||||||
// Specific Testing service here.
|
// Specific Testing service here.
|
||||||
|
@ -165,7 +165,7 @@ GxsPeerNode::~GxsPeerNode()
|
||||||
RsDirUtil::cleanupDirectory(mGxsDir, filesToKeep);
|
RsDirUtil::cleanupDirectory(mGxsDir, filesToKeep);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GxsPeerNode::checkTestServiceAllowedGroups(const RsPeerId &peerId)
|
bool GxsPeerNode::checkTestServiceAllowedGroups(const RsPeerId &/*peerId*/)
|
||||||
{
|
{
|
||||||
#ifdef USER_NETSERVICE_WRAPPER
|
#ifdef USER_NETSERVICE_WRAPPER
|
||||||
std::vector<RsGxsGroupId> groups;
|
std::vector<RsGxsGroupId> groups;
|
||||||
|
@ -178,7 +178,7 @@ bool GxsPeerNode::checkTestServiceAllowedGroups(const RsPeerId &peerId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GxsPeerNode::checkCircleServiceAllowedGroups(const RsPeerId &peerId)
|
bool GxsPeerNode::checkCircleServiceAllowedGroups(const RsPeerId &/*peerId*/)
|
||||||
{
|
{
|
||||||
#ifdef USER_NETSERVICE_WRAPPER
|
#ifdef USER_NETSERVICE_WRAPPER
|
||||||
std::vector<RsGxsGroupId> groups;
|
std::vector<RsGxsGroupId> groups;
|
||||||
|
|
|
@ -54,7 +54,7 @@ RsServiceInfo GxsTestService::getServiceInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32_t GxsTestService::testAuthenPolicy(uint32_t testMode)
|
uint32_t GxsTestService::testAuthenPolicy(uint32_t /*testMode*/)
|
||||||
{
|
{
|
||||||
uint32_t policy = 0;
|
uint32_t policy = 0;
|
||||||
uint8_t flag = 0;
|
uint8_t flag = 0;
|
||||||
|
@ -304,7 +304,7 @@ std::ostream &operator<<(std::ostream &out, const RsTestMsg &msg)
|
||||||
|
|
||||||
|
|
||||||
// Overloaded from RsTickEvent for Event callbacks.
|
// Overloaded from RsTickEvent for Event callbacks.
|
||||||
void GxsTestService::handle_event(uint32_t event_type, const std::string &elabel)
|
void GxsTestService::handle_event(uint32_t event_type, const std::string &/*elabel*/)
|
||||||
{
|
{
|
||||||
std::cerr << "GxsTestService::handle_event(" << event_type << ")";
|
std::cerr << "GxsTestService::handle_event(" << event_type << ")";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
|
@ -45,7 +45,7 @@ uint32_t RsGxsTestSerialiser::size(RsItem *item)
|
||||||
{
|
{
|
||||||
return sizeGxsTestMsgItem(msg_item);
|
return sizeGxsTestMsgItem(msg_item);
|
||||||
}
|
}
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RsGxsTestSerialiser::serialise(RsItem *item, void *data, uint32_t *size)
|
bool RsGxsTestSerialiser::serialise(RsItem *item, void *data, uint32_t *size)
|
||||||
|
|
|
@ -27,9 +27,9 @@ TEST(libretroshare_services, Status_test1)
|
||||||
|
|
||||||
// extract bits we need.
|
// extract bits we need.
|
||||||
PeerNode *node = tester.getPeerNode();
|
PeerNode *node = tester.getPeerNode();
|
||||||
p3PeerMgr *peerMgr = node->getPeerMgr();
|
//p3PeerMgr *peerMgr = node->getPeerMgr();
|
||||||
p3LinkMgr *linkMgr = node->getLinkMgr();
|
//p3LinkMgr *linkMgr = node->getLinkMgr();
|
||||||
p3NetMgr *netMgr = node->getNetMgr();
|
//p3NetMgr *netMgr = node->getNetMgr();
|
||||||
p3ServiceControl *serviceCtrl = node->getServiceControl();
|
p3ServiceControl *serviceCtrl = node->getServiceControl();
|
||||||
|
|
||||||
// add in service.
|
// add in service.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue