mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 15:35:49 -04:00
merge of branch v0.6-idclean 7180
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7187 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7815efb16f
commit
0f29d28b1b
397 changed files with 6503 additions and 5702 deletions
|
@ -30,7 +30,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <serialiser/rstunnelitems.h>
|
||||
#include <serialiser/rstlvutil.h>
|
||||
#include "util/utest.h"
|
||||
#include "support.h"
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include "turtle/rsturtleitem.h"
|
||||
#include "ft/ftturtlefiletransferitem.h"
|
||||
#include <serialiser/rstlvutil.h>
|
||||
#include "support.h"
|
||||
#include "util/utest.h"
|
||||
|
|
|
@ -107,7 +107,7 @@ bool operator==(const RsTlvKeySignatureSet& kss1, const RsTlvKeySignatureSet& ks
|
|||
|
||||
bool operator==(const RsTlvPeerIdSet& pids1, const RsTlvPeerIdSet& pids2)
|
||||
{
|
||||
std::list<std::string>::const_iterator it1 = pids1.ids.begin(),
|
||||
std::list<RsPeerId>::const_iterator it1 = pids1.ids.begin(),
|
||||
it2 = pids2.ids.begin();
|
||||
|
||||
|
||||
|
@ -204,37 +204,23 @@ bool operator==(const RsTlvImage& img1, const RsTlvImage& img2)
|
|||
|
||||
void init_item(RsTlvHashSet& hs)
|
||||
{
|
||||
std::string hash;
|
||||
|
||||
for(int i=0; i < 10; i++)
|
||||
{
|
||||
randString(SHORT_STR, hash);
|
||||
hs.ids.push_back(hash);
|
||||
}
|
||||
hs.ids.push_back(RsFileHash::random());
|
||||
|
||||
hs.mType = TLV_TYPE_HASHSET;
|
||||
return;
|
||||
}
|
||||
|
||||
void init_item(RsTlvPeerIdSet& ps)
|
||||
{
|
||||
std::string peer;
|
||||
|
||||
for(int i=0; i < 10; i++)
|
||||
{
|
||||
randString(SHORT_STR, peer);
|
||||
ps.ids.push_back(peer);
|
||||
}
|
||||
ps.ids.push_back(RsPeerId::random());
|
||||
|
||||
ps.mType = TLV_TYPE_PEERSET;
|
||||
return;
|
||||
}
|
||||
|
||||
bool operator==(const RsTlvHashSet& hs1,const RsTlvHashSet& hs2)
|
||||
{
|
||||
if(hs1.mType != hs2.mType) return false;
|
||||
|
||||
std::list<std::string>::const_iterator it1 = hs1.ids.begin(),
|
||||
std::list<RsFileHash>::const_iterator it1 = hs1.ids.begin(),
|
||||
it2 = hs2.ids.begin();
|
||||
|
||||
for(; ((it1 != hs1.ids.end()) && (it2 != hs2.ids.end())); it1++, it2++)
|
||||
|
@ -249,7 +235,7 @@ void init_item(RsTlvFileItem& fi)
|
|||
{
|
||||
fi.age = rand()%200;
|
||||
fi.filesize = rand()%34030313;
|
||||
randString(SHORT_STR, fi.hash);
|
||||
fi.hash = RsFileHash::random();
|
||||
randString(SHORT_STR, fi.name);
|
||||
randString(SHORT_STR, fi.path);
|
||||
fi.piecesize = rand()%232;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <openssl/rand.h>
|
||||
#include "util/rscompress.h"
|
||||
#include "util/rsdir.h"
|
||||
#include "util/utest.h"
|
||||
|
@ -183,6 +184,14 @@ int main(int argc,char *argv[])
|
|||
temp/linux-g++-64/obj/p3photoservice.o \
|
||||
temp/linux-g++-64/obj/rsphotoitems.o" ;
|
||||
|
||||
for(int i=0;i<5;++i)
|
||||
source_string = source_string+source_string ;
|
||||
|
||||
source_string = source_string.substr(0,550000) ;
|
||||
|
||||
for(int i=0;i<source_string.length()/10;++i)
|
||||
source_string[lrand48()%(source_string.length())] = lrand48()&0xff ;
|
||||
|
||||
std::cerr << "Input string: length=" << source_string.length() << std::endl;
|
||||
std::cerr << "Input string: hash =" << RsDirUtil::sha1sum((uint8_t*)source_string.c_str(),source_string.length()).toStdString() << std::endl;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue