mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 15:35:49 -04:00
merging gxs_phase2 branch
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6401 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1150366913
commit
325fa4f222
116 changed files with 6050 additions and 3596 deletions
178
libretroshare/src/tests/gxs/gen_exchange/genexchange_test.pro
Normal file
178
libretroshare/src/tests/gxs/gen_exchange/genexchange_test.pro
Normal file
|
@ -0,0 +1,178 @@
|
|||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2012-05-06T09:19:26
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
|
||||
#
|
||||
QT += core network
|
||||
|
||||
QT -= gui
|
||||
|
||||
CONFIG += gen_exchange_target
|
||||
|
||||
|
||||
CONFIG += bitdht
|
||||
|
||||
|
||||
|
||||
TARGET = gen_exchange_test
|
||||
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
CONFIG += debug
|
||||
|
||||
debug {
|
||||
# DEFINES *= DEBUG
|
||||
# DEFINES *= OPENDHT_DEBUG DHT_DEBUG CONN_DEBUG DEBUG_UDP_SORTER P3DISC_DEBUG DEBUG_UDP_LAYER FT_DEBUG EXTADDRSEARCH_DEBUG
|
||||
# DEFINES *= CONTROL_DEBUG FT_DEBUG DEBUG_FTCHUNK P3TURTLE_DEBUG
|
||||
# DEFINES *= P3TURTLE_DEBUG
|
||||
# DEFINES *= NET_DEBUG
|
||||
# DEFINES *= DISTRIB_DEBUG
|
||||
# DEFINES *= P3TURTLE_DEBUG FT_DEBUG DEBUG_FTCHUNK MPLEX_DEBUG
|
||||
# DEFINES *= STATUS_DEBUG SERV_DEBUG RSSERIAL_DEBUG #CONN_DEBUG
|
||||
|
||||
QMAKE_CXXFLAGS -= -O2 -fomit-frame-pointer
|
||||
QMAKE_CXXFLAGS *= -g -fno-omit-frame-pointer
|
||||
}
|
||||
################################# Linux ##########################################
|
||||
# Put lib dir in QMAKE_LFLAGS so it appears before -L/usr/lib
|
||||
linux-* {
|
||||
#CONFIG += version_detail_bash_script
|
||||
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
||||
|
||||
system(which gpgme-config >/dev/null 2>&1) {
|
||||
INCLUDEPATH += $$system(gpgme-config --cflags | sed -e "s/-I//g")
|
||||
} else {
|
||||
message(Could not find gpgme-config on your system, assuming gpgme.h is in /usr/include)
|
||||
}
|
||||
|
||||
PRE_TARGETDEPS *= ../../../lib/libretroshare.a
|
||||
|
||||
LIBS += ../../../lib/libretroshare.a
|
||||
LIBS += ../../../../../libbitdht/src/lib/libbitdht.a
|
||||
LIBS += ../../../../../openpgpsdk/src/lib/libops.a
|
||||
LIBS += -lssl -lgpgme -lupnp -lixml -lgnome-keyring -lsqlite3 -lbz2
|
||||
LIBS *= -rdynamic -frtti
|
||||
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
||||
DEFINES *= UBUNTU
|
||||
}
|
||||
|
||||
linux-g++ {
|
||||
OBJECTS_DIR = temp/linux-g++/obj
|
||||
}
|
||||
|
||||
linux-g++-64 {
|
||||
OBJECTS_DIR = temp/linux-g++-64/obj
|
||||
}
|
||||
|
||||
#################################### Windows #####################################
|
||||
|
||||
win32 {
|
||||
|
||||
DEFINES *= WINDOWS_SYS \
|
||||
WIN32 \
|
||||
STATICLIB \
|
||||
MINGW
|
||||
# Switch on extra warnings
|
||||
QMAKE_CFLAGS += -Wextra
|
||||
QMAKE_CXXFLAGS += -Wextra
|
||||
|
||||
# Switch off optimization for release version
|
||||
QMAKE_CXXFLAGS_RELEASE -= -O2
|
||||
QMAKE_CXXFLAGS_RELEASE += -O0
|
||||
QMAKE_CFLAGS_RELEASE -= -O2
|
||||
QMAKE_CFLAGS_RELEASE += -O0
|
||||
|
||||
# Switch on optimization for debug version
|
||||
#QMAKE_CXXFLAGS_DEBUG += -O2
|
||||
#QMAKE_CFLAGS_DEBUG += -O2
|
||||
|
||||
# PRE_TARGETDEPS += ../../libretroshare/src/lib/libretroshare.a
|
||||
PRE_TARGETDEPS += ../../../../../libretroshare/libretroshare-build-desktop/lib/libretroshare.a
|
||||
|
||||
LIBS += ../../../../../libretroshare/libretroshare-build-desktop/lib/libretroshare.a
|
||||
LIBS += C:\Development\Rs\v0.5-gxs-b1\openpgpsdk\openpgpsdk-build-desktop\lib\libops.a
|
||||
LIBS += C:\Development\Libraries\sqlite\sqlite-autoconf-3070900\lib\libsqlite3.a
|
||||
LIBS += -L"../../../../../lib"
|
||||
LIBS += -lssl -lcrypto -lgpgme -lpthreadGC2d -lminiupnpc -lz -lbz2
|
||||
# added after bitdht
|
||||
# LIBS += -lws2_32
|
||||
LIBS += -luuid -lole32 -liphlpapi -lcrypt32-cygwin -lgdi32
|
||||
LIBS += -lole32 -lwinmm
|
||||
|
||||
# export symbols for the plugins
|
||||
#LIBS += -Wl,--export-all-symbols,--out-implib,lib/libretroshare-gui.a
|
||||
|
||||
GPG_ERROR_DIR = ../../../../libgpg-error-1.7
|
||||
GPGME_DIR = ../../../../gpgme-1.1.8
|
||||
GPG_ERROR_DIR = ../../../../lib/libgpg-error-1.7
|
||||
GPGME_DIR = ../../../../lib/gpgme-1.1.8
|
||||
SSL_DIR = ../../../../../OpenSSL
|
||||
OPENPGPSDK_DIR = ../../../../openpgpsdk/src
|
||||
INCLUDEPATH += . $${SSL_DIR}/include $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src \
|
||||
$${OPENPGPSDK_DIR}
|
||||
|
||||
SQLITE_DIR = ../../../../../../Libraries/sqlite/sqlite-autoconf-3070900
|
||||
INCLUDEPATH += . \
|
||||
$${SQLITE_DIR}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
bitdht {
|
||||
|
||||
# Chris version.
|
||||
#LIBS += ../../libbitdht/libbitdht-build-desktop/lib/libbitdht.a
|
||||
#PRE_TARGETDEPS *= ../../libbitdht/libbitdht-build-desktop/lib/libbitdht.a
|
||||
}
|
||||
|
||||
win32 {
|
||||
# must be added after bitdht
|
||||
LIBS += -lws2_32
|
||||
}
|
||||
|
||||
version_detail_bash_script {
|
||||
DEFINES += ADD_LIBRETROSHARE_VERSION_INFO
|
||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||
PRE_TARGETDEPS = write_version_detail
|
||||
write_version_detail.commands = ./version_detail.sh
|
||||
}
|
||||
|
||||
install_rs {
|
||||
INSTALLS += binary_rs
|
||||
binary_rs.path = $$(PREFIX)/usr/bin
|
||||
binary_rs.files = ./RetroShare
|
||||
}
|
||||
|
||||
|
||||
gen_exchange_target {
|
||||
|
||||
SOURCES += \
|
||||
../common/support.cc \
|
||||
genexchangetester.cpp \
|
||||
genexchangetestservice.cpp \
|
||||
rsdummyservices.cc \
|
||||
gxspublishgrouptest.cc \
|
||||
gxspublishmsgtest.cc \
|
||||
rsgenexchange_test.cc
|
||||
|
||||
HEADERS += ../common/support.h \
|
||||
../data_service/rsdataservice_test.h \
|
||||
gxspublishgrouptest.h \
|
||||
gxspublishmsgtest.h \
|
||||
rsdummyservices.h \
|
||||
../common/data_support.h \
|
||||
../common/support.h
|
||||
|
||||
}
|
||||
|
||||
|
||||
INCLUDEPATH += ../../../
|
||||
INCLUDEPATH += ../common
|
588
libretroshare/src/tests/gxs/gen_exchange/genexchangetester.cpp
Normal file
588
libretroshare/src/tests/gxs/gen_exchange/genexchangetester.cpp
Normal file
|
@ -0,0 +1,588 @@
|
|||
#include "genexchangetester.h"
|
||||
#include "support.h"
|
||||
#include "gxs/rsdataservice.h"
|
||||
#include "retroshare/rsgxsflags.h"
|
||||
|
||||
|
||||
GenExchangeTest::GenExchangeTest(GenExchangeTestService* const mTestService, RsGeneralDataService* dataService, int pollingTO)
|
||||
: mDataService(dataService), mTestService(mTestService), mTokenService(mTestService->getTokenService()),
|
||||
mPollingTO(pollingTO)
|
||||
{
|
||||
}
|
||||
|
||||
GenExchangeTest::~GenExchangeTest()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::pollForToken(uint32_t token, const RsTokReqOptions &opts, bool fill)
|
||||
{
|
||||
double timeDelta = 0.2;
|
||||
time_t now = time(NULL);
|
||||
time_t stopw = now + mPollingTO;
|
||||
|
||||
while(now < stopw)
|
||||
{
|
||||
#ifndef WINDOWS_SYS
|
||||
usleep((int) (timeDelta * 1000000));
|
||||
#else
|
||||
Sleep((int) (timeDelta * 1000));
|
||||
#endif
|
||||
|
||||
if((RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE == mTokenService->requestStatus(token)))
|
||||
{
|
||||
switch(opts.mReqType)
|
||||
{
|
||||
case GXS_REQUEST_TYPE_GROUP_DATA:
|
||||
if(fill)
|
||||
mTestService->getGroupDataTS(token, mGrpDataIn);
|
||||
break;
|
||||
case GXS_REQUEST_TYPE_GROUP_META:
|
||||
if(fill)
|
||||
mTestService->getGroupMetaTS(token, mGrpMetaDataIn);
|
||||
break;
|
||||
case GXS_REQUEST_TYPE_GROUP_IDS:
|
||||
if(fill)
|
||||
mTestService->getGroupListTS(token, mGrpIdsIn);
|
||||
break;
|
||||
case GXS_REQUEST_TYPE_MSG_DATA:
|
||||
if(fill)
|
||||
mTestService->getMsgDataTS(token, mMsgDataIn);
|
||||
break;
|
||||
case GXS_REQUEST_TYPE_MSG_META:
|
||||
if(fill)
|
||||
mTestService->getMsgMetaTS(token, mMsgMetaDataIn);
|
||||
break;
|
||||
case GXS_REQUEST_TYPE_MSG_IDS:
|
||||
if(fill)
|
||||
mTestService->getMsgListTS(token, mMsgIdsIn);
|
||||
break;
|
||||
case GXS_REQUEST_TYPE_MSG_RELATED_IDS:
|
||||
if(fill)
|
||||
mTestService->getMsgRelatedListTS(token, mMsgRelatedIdsIn);
|
||||
break;
|
||||
case GXS_REQUEST_TYPE_MSG_RELATED_DATA:
|
||||
if(fill)
|
||||
mTestService->getMsgRelatedDataTS(token, mMsgRelatedDataMapIn);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if(RsTokenService::GXS_REQUEST_V2_STATUS_FAILED == mTokenService->requestStatus(token))
|
||||
{
|
||||
mTokenService->cancelRequest(token);
|
||||
break;
|
||||
}
|
||||
now = time(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool GenExchangeTest::pollForMsgAcknowledgement(uint32_t token,
|
||||
RsGxsGrpMsgIdPair& msgId)
|
||||
{
|
||||
double timeDelta = 0.2;
|
||||
|
||||
time_t now = time(NULL);
|
||||
time_t stopw = now + mPollingTO;
|
||||
|
||||
while(now < stopw)
|
||||
{
|
||||
#ifndef WINDOWS_SYS
|
||||
usleep((int) (timeDelta * 1000000));
|
||||
#else
|
||||
Sleep((int) (timeDelta * 1000));
|
||||
#endif
|
||||
|
||||
if((RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE == mTokenService->requestStatus(token)))
|
||||
{
|
||||
mTestService->acknowledgeTokenMsg(token, msgId);
|
||||
return true;
|
||||
}
|
||||
else if(RsTokenService::GXS_REQUEST_V2_STATUS_FAILED == mTokenService->requestStatus(token))
|
||||
{
|
||||
mTokenService->cancelRequest(token);
|
||||
return false;
|
||||
}
|
||||
now = time(NULL);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
GenExchangeTestService* GenExchangeTest::getTestService()
|
||||
{
|
||||
return mTestService;
|
||||
}
|
||||
|
||||
RsTokenService* GenExchangeTest::getTokenService()
|
||||
{
|
||||
return mTokenService;
|
||||
}
|
||||
bool GenExchangeTest::pollForGrpAcknowledgement(uint32_t token,
|
||||
RsGxsGroupId& grpId)
|
||||
{
|
||||
double timeDelta = 0.2;
|
||||
time_t now = time(NULL);
|
||||
time_t stopw = now + mPollingTO;
|
||||
while(now < stopw)
|
||||
{
|
||||
#ifndef WINDOWS_SYS
|
||||
usleep((int) (timeDelta * 1000000));
|
||||
#else
|
||||
Sleep((int) (timeDelta * 1000));
|
||||
#endif
|
||||
|
||||
if((RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE == mTokenService->requestStatus(token)))
|
||||
{
|
||||
mTestService->acknowledgeTokenGrp(token, grpId);
|
||||
return true;
|
||||
}
|
||||
else if(RsTokenService::GXS_REQUEST_V2_STATUS_FAILED == mTokenService->requestStatus(token))
|
||||
{
|
||||
mTokenService->cancelRequest(token);
|
||||
return false;
|
||||
}
|
||||
now = time(NULL);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void GenExchangeTest::setUp()
|
||||
{
|
||||
mDataService->resetDataStore();
|
||||
|
||||
// would be useful for genexchange services
|
||||
// to have a protected reset button
|
||||
mTestService->start();
|
||||
}
|
||||
|
||||
void GenExchangeTest::breakDown()
|
||||
{
|
||||
mTestService->join();
|
||||
clearAllData();
|
||||
}
|
||||
|
||||
bool msgDataSort(const RsDummyMsg* m1, const RsDummyMsg* m2)
|
||||
{
|
||||
return m1->meta.mMsgId < m2->meta.mMsgId;
|
||||
}
|
||||
|
||||
bool GenExchangeTest::compareMsgDataMaps()
|
||||
{
|
||||
DummyMsgMap::iterator mit = mMsgDataOut.begin();
|
||||
|
||||
bool ok = true;
|
||||
for(; mit != mMsgDataOut.end(); mit++)
|
||||
{
|
||||
const RsGxsGroupId& grpId = mit->first;
|
||||
std::vector<RsDummyMsg*>& v1 = mit->second,
|
||||
&v2 = mMsgDataIn[grpId];
|
||||
|
||||
if(v1.size() != v2.size())
|
||||
return false;
|
||||
|
||||
std::sort(v1.begin(), v1.end(), msgDataSort);
|
||||
std::sort(v2.begin(), v2.end(), msgDataSort);
|
||||
|
||||
ok &= Comparison<std::vector<RsDummyMsg*>, RsDummyMsg*>::comparison(v1, v2);
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
bool GenExchangeTest::compareMsgIdMaps()
|
||||
{
|
||||
GxsMsgIdResult::const_iterator mit = mMsgIdsOut.begin();
|
||||
bool ok = true;
|
||||
for(; mit != mMsgIdsOut.end(); mit++)
|
||||
{
|
||||
const RsGxsGroupId& grpId = mit->first;
|
||||
const std::vector<RsGxsMessageId>& v1 = mit->second,
|
||||
&v2 = mMsgIdsIn[grpId];
|
||||
|
||||
ok &= Comparison<std::vector<RsGxsMessageId>, RsGxsMessageId>::comparison(v1, v2);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
bool GenExchangeTest::compareMsgMetaMaps()
|
||||
{
|
||||
GxsMsgMetaMap::iterator mit = mMsgMetaDataOut.begin();
|
||||
bool ok = true;
|
||||
for(; mit != mMsgMetaDataOut.end(); mit++)
|
||||
{
|
||||
const RsGxsGroupId& grpId = mit->first;
|
||||
const std::vector<RsMsgMetaData>& v1 = mit->second,
|
||||
&v2 = mMsgMetaDataOut[grpId];
|
||||
ok &= Comparison<std::vector<RsMsgMetaData>, RsMsgMetaData>::comparison(v1, v2);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
bool GenExchangeTest::compareMsgRelateIdsMap()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GenExchangeTest::compareMsgRelatedDataMap()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool grpDataSort(const RsDummyGrp* g1, const RsDummyGrp* g2)
|
||||
{
|
||||
return g1->meta.mGroupId < g2->meta.mGroupId;
|
||||
}
|
||||
|
||||
bool GenExchangeTest::compareGrpData()
|
||||
{
|
||||
|
||||
std::sort(mGrpDataIn.begin(), mGrpDataIn.end(), grpDataSort);
|
||||
std::sort(mGrpDataOut.begin(), mGrpDataOut.end(), grpDataSort);
|
||||
bool ok = Comparison<std::vector<RsDummyGrp*>, RsDummyGrp*>::comparison
|
||||
(mGrpDataIn, mGrpDataOut);
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool operator<(const RsGroupMetaData& l, const RsGroupMetaData& r)
|
||||
{
|
||||
return l.mGroupId < r.mGroupId;
|
||||
}
|
||||
|
||||
bool GenExchangeTest::compareGrpMeta()
|
||||
{
|
||||
|
||||
mGrpMetaDataIn.sort();
|
||||
mGrpMetaDataOut.sort();
|
||||
|
||||
bool ok = Comparison<std::list<RsGroupMetaData>, RsGroupMetaData>::comparison
|
||||
(mGrpMetaDataIn, mGrpMetaDataOut);
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
bool GenExchangeTest::compareGrpIds()
|
||||
{
|
||||
mGrpIdsIn.sort();
|
||||
mGrpIdsOut.sort();
|
||||
bool ok = Comparison<std::list<RsGxsGroupId>, RsGxsGroupId>::comparison
|
||||
(mGrpIdsIn, mGrpIdsOut);
|
||||
return ok;
|
||||
}
|
||||
|
||||
void GenExchangeTest::createGrps(uint32_t nGrps,
|
||||
std::list<RsGxsGroupId>& groupId)
|
||||
{
|
||||
// create n groups and publish all nGrps and collect id information
|
||||
for(uint32_t i=0; i < nGrps; i++)
|
||||
{
|
||||
RsDummyGrp* grp = new RsDummyGrp();
|
||||
init(*grp);
|
||||
uint32_t token;
|
||||
mTestService->publishDummyGrp(token, grp);
|
||||
RsGxsGroupId grpId;
|
||||
pollForGrpAcknowledgement(token, grpId);
|
||||
groupId.push_back(grpId);
|
||||
}
|
||||
}
|
||||
|
||||
void GenExchangeTest::init(RsMsgMetaData& msgMetaData) const
|
||||
{
|
||||
//randString(SHORT_STR, msgMeta.mAuthorId);
|
||||
randString(SHORT_STR, msgMetaData.mMsgName);
|
||||
randString(SHORT_STR, msgMetaData.mServiceString);
|
||||
randString(SHORT_STR, msgMetaData.mOrigMsgId);
|
||||
randString(SHORT_STR, msgMetaData.mParentId);
|
||||
randString(SHORT_STR, msgMetaData.mThreadId);
|
||||
randString(SHORT_STR, msgMetaData.mGroupId);
|
||||
|
||||
msgMetaData.mChildTs = randNum();
|
||||
msgMetaData.mMsgStatus = randNum();
|
||||
msgMetaData.mMsgFlags = randNum();
|
||||
msgMetaData.mPublishTs = randNum();
|
||||
}
|
||||
|
||||
uint32_t GenExchangeTest::randNum() const
|
||||
{
|
||||
return rand()%23562424;
|
||||
}
|
||||
|
||||
void GenExchangeTest::init(RsGroupMetaData& grpMetaData) const
|
||||
{
|
||||
randString(SHORT_STR, grpMetaData.mGroupId);
|
||||
//randString(SHORT_STR, grpMetaData.mAuthorId);
|
||||
randString(SHORT_STR, grpMetaData.mGroupName);
|
||||
randString(SHORT_STR, grpMetaData.mServiceString);
|
||||
|
||||
|
||||
grpMetaData.mGroupFlags = randNum();
|
||||
grpMetaData.mLastPost = randNum();
|
||||
grpMetaData.mGroupStatus = randNum();
|
||||
grpMetaData.mMsgCount = randNum();
|
||||
grpMetaData.mPop = randNum();
|
||||
grpMetaData.mSignFlags = randNum();
|
||||
grpMetaData.mPublishTs = randNum();
|
||||
grpMetaData.mSubscribeFlags = GXS_SERV::GROUP_SUBSCRIBE_ADMIN;
|
||||
}
|
||||
|
||||
void GenExchangeTest::init(RsDummyGrp& grpItem) const
|
||||
{
|
||||
randString(SHORT_STR, grpItem.grpData);
|
||||
init(grpItem.meta);
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::init(RsDummyMsg& msgItem) const
|
||||
{
|
||||
randString(SHORT_STR, msgItem.msgData);
|
||||
init(msgItem.meta);
|
||||
}
|
||||
|
||||
void GenExchangeTest::storeToMsgDataOutMaps(const DummyMsgMap& msgDataOut)
|
||||
{
|
||||
mMsgDataOut.insert(msgDataOut.begin(), msgDataOut.end());
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::storeToMsgIdsOutMaps(const GxsMsgIdResult& msgIdsOut)
|
||||
{
|
||||
mMsgIdsOut.insert(msgIdsOut.begin(), msgIdsOut.end());
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::storeToMsgMetaOutMaps(const GxsMsgMetaMap& msgMetaOut)
|
||||
{
|
||||
mMsgMetaDataOut.insert(msgMetaOut.begin(), msgMetaOut.end());
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::storeToMsgDataInMaps(const DummyMsgMap& msgDataIn)
|
||||
{
|
||||
mMsgDataIn.insert(msgDataIn.begin(), msgDataIn.end());
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::storeToMsgIdsInMaps(const GxsMsgIdResult& msgIdsIn)
|
||||
{
|
||||
mMsgIdsIn.insert(msgIdsIn.begin(), msgIdsIn.end());
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::storeToMsgMetaInMaps(const GxsMsgMetaMap& msgMetaIn)
|
||||
{
|
||||
mMsgMetaDataIn.insert(msgMetaIn.begin(), msgMetaIn.end());
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::storeToGrpIdsOutList(
|
||||
const std::list<RsGxsGroupId>& grpIdOut)
|
||||
{
|
||||
mGrpIdsOut.insert(mGrpIdsOut.end(), grpIdOut.begin(), grpIdOut.end());
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::storeToGrpMetaOutList(
|
||||
const std::list<RsGroupMetaData>& grpMetaOut)
|
||||
{
|
||||
mGrpMetaDataOut.insert(mGrpMetaDataOut.end(), grpMetaOut.begin(), grpMetaOut.end());
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::storeToGrpDataOutList(
|
||||
const std::vector<RsDummyGrp*>& grpDataOut)
|
||||
{
|
||||
mGrpDataOut.insert(mGrpDataOut.end(), grpDataOut.begin(), grpDataOut.end());
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::storeToGrpIdsInList(
|
||||
const std::list<RsGxsGroupId>& grpIdIn)
|
||||
{
|
||||
mGrpIdsIn.insert(mGrpIdsIn.end(), grpIdIn.begin(), grpIdIn.end());
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::storeToGrpMetaInList(
|
||||
const std::list<RsGroupMetaData>& grpMetaIn)
|
||||
{
|
||||
mGrpMetaDataIn.insert(mGrpMetaDataIn.end(), grpMetaIn.begin(), grpMetaIn.end());
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::storeToGrpDataInList(
|
||||
const std::vector<RsDummyGrp*>& grpDataIn)
|
||||
{
|
||||
mGrpDataIn.insert(mGrpDataIn.begin(), grpDataIn.begin(), grpDataIn.end());
|
||||
}
|
||||
void GenExchangeTest::clearAllData()
|
||||
{
|
||||
clearMsgDataInMap();
|
||||
clearMsgDataOutMap();
|
||||
clearMsgIdInMap();
|
||||
clearMsgIdOutMap();
|
||||
clearMsgMetaInMap();
|
||||
clearMsgMetaOutMap();
|
||||
clearGrpDataInList();
|
||||
clearGrpDataOutList();
|
||||
clearGrpMetaInList();
|
||||
clearGrpMetaOutList();
|
||||
clearGrpIdInList();
|
||||
clearGrpIdOutList();
|
||||
}
|
||||
void GenExchangeTest::clearMsgDataInMap()
|
||||
{
|
||||
mMsgDataIn.clear();
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::clearMsgDataOutMap()
|
||||
{
|
||||
|
||||
clearMsgDataMap(mMsgDataOut);
|
||||
}
|
||||
|
||||
void GenExchangeTest::clearMsgDataMap(DummyMsgMap& msgDataMap) const
|
||||
{
|
||||
DummyMsgMap::iterator it = msgDataMap.begin();
|
||||
|
||||
for(; it != msgDataMap.end(); it++)
|
||||
{
|
||||
deleteResVector<RsDummyMsg>(it->second);
|
||||
}
|
||||
}
|
||||
|
||||
void GenExchangeTest::clearMsgMetaInMap()
|
||||
{
|
||||
mMsgMetaDataIn.clear();
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::clearMsgMetaOutMap()
|
||||
{
|
||||
mMsgMetaDataOut.clear();
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::clearMsgIdInMap()
|
||||
{
|
||||
mMsgIdsIn.clear();
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::clearMsgIdOutMap()
|
||||
{
|
||||
mMsgIdsOut.clear();
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::clearMsgRelatedIdInMap()
|
||||
{
|
||||
mMsgRelatedIdsIn.clear();
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::clearGrpDataInList()
|
||||
{
|
||||
clearGrpDataList(mGrpDataIn);
|
||||
}
|
||||
|
||||
void GenExchangeTest::clearGrpDataList(std::vector<RsDummyGrp*>& grpData) const
|
||||
{
|
||||
deleteResVector<RsDummyGrp>(grpData);
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::clearGrpDataOutList()
|
||||
{
|
||||
clearGrpDataList(mGrpDataOut);
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::clearGrpMetaInList()
|
||||
{
|
||||
mGrpMetaDataIn.clear();
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::clearGrpMetaOutList()
|
||||
{
|
||||
mGrpMetaDataOut.clear();
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::clearGrpIdInList()
|
||||
{
|
||||
mGrpIdsIn.clear();
|
||||
}
|
||||
|
||||
|
||||
void GenExchangeTest::clearGrpIdOutList()
|
||||
{
|
||||
mGrpIdsOut.clear();
|
||||
}
|
||||
|
||||
|
||||
bool operator ==(const RsMsgMetaData& lMeta, const RsMsgMetaData& rMeta)
|
||||
{
|
||||
|
||||
if(lMeta.mAuthorId != rMeta.mAuthorId) return false;
|
||||
if(lMeta.mChildTs != rMeta.mChildTs) return false;
|
||||
if(lMeta.mGroupId != rMeta.mGroupId) return false;
|
||||
if(lMeta.mMsgFlags != rMeta.mMsgFlags) return false;
|
||||
if(lMeta.mMsgId != rMeta.mMsgId) return false;
|
||||
if(lMeta.mMsgName != rMeta.mMsgName) return false;
|
||||
//if(lMeta.mMsgStatus != rMeta.mMsgStatus) return false;
|
||||
if(lMeta.mOrigMsgId != rMeta.mOrigMsgId) return false;
|
||||
if(lMeta.mParentId != rMeta.mParentId) return false;
|
||||
//if(lMeta.mPublishTs != rMeta.mPublishTs) return false; // don't compare this as internally set in gxs
|
||||
if(lMeta.mThreadId != rMeta.mThreadId) return false;
|
||||
if(lMeta.mServiceString != rMeta.mServiceString) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool operator ==(const RsGroupMetaData& lMeta, const RsGroupMetaData& rMeta)
|
||||
{
|
||||
if(lMeta.mAuthorId != rMeta.mAuthorId) return false;
|
||||
if(lMeta.mGroupFlags != rMeta.mGroupFlags) return false;
|
||||
if(lMeta.mGroupId != rMeta.mGroupId) return false;
|
||||
if(lMeta.mGroupName != rMeta.mGroupName) return false;
|
||||
if(lMeta.mGroupStatus != rMeta.mGroupStatus) return false;
|
||||
if(lMeta.mLastPost != rMeta.mLastPost) return false;
|
||||
if(lMeta.mMsgCount != rMeta.mMsgCount) return false;
|
||||
if(lMeta.mPop != rMeta.mPop) return false;
|
||||
// if(lMeta.mPublishTs != rMeta.mPublishTs) return false; set in gxs
|
||||
if(lMeta.mServiceString != rMeta.mServiceString) return false;
|
||||
if(lMeta.mSignFlags != rMeta.mSignFlags) return false;
|
||||
// if(lMeta.mSubscribeFlags != rMeta.mSubscribeFlags) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool operator ==(const RsDummyGrp& lGrp, const RsDummyGrp& rGrp)
|
||||
{
|
||||
|
||||
if(lGrp.grpData != rGrp.grpData) return false;
|
||||
if(! (lGrp.meta == rGrp.meta)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool operator ==(const RsDummyMsg& lMsg, const RsDummyMsg& rMsg)
|
||||
{
|
||||
if(lMsg.msgData != rMsg.msgData) return false;
|
||||
if(!(lMsg.meta == rMsg.meta)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool operator ==(const RsGxsGrpItem& lGrp, const RsGxsGrpItem& rGrp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
278
libretroshare/src/tests/gxs/gen_exchange/genexchangetester.h
Normal file
278
libretroshare/src/tests/gxs/gen_exchange/genexchangetester.h
Normal file
|
@ -0,0 +1,278 @@
|
|||
#ifndef GENEXCHANGETESTER_H
|
||||
#define GENEXCHANGETESTER_H
|
||||
|
||||
#include "genexchangetestservice.h"
|
||||
#include "gxs/rsgds.h"
|
||||
#include "gxs/rsnxs.h"
|
||||
|
||||
bool operator ==(const RsMsgMetaData& lMeta, const RsMsgMetaData& rMeta);
|
||||
bool operator ==(const RsDummyMsg& lMsg, const RsDummyMsg& rMsg);
|
||||
bool operator ==(const RsGxsGrpItem& lMsg, const RsGxsGrpItem& rMsg);
|
||||
|
||||
bool operator ==(const RsGroupMetaData& lMeta, const RsGroupMetaData& rMeta);
|
||||
bool operator ==(const RsDummyGrp& lMsg, const RsDummyGrp& rMsg);
|
||||
bool operator ==(const RsGxsMsgItem& lMsg, const RsGxsMsgItem& rMsg);
|
||||
|
||||
/*!
|
||||
* The idea of GenExchangeTest is to simplify test
|
||||
* of the RsGenExchange via the RsGxsDummyService
|
||||
* One can test all publish/request/meta-modify
|
||||
* capabilities of RsGenExchange
|
||||
* Simplifications comes from: \n
|
||||
*
|
||||
* - ability to store in and out data for comparison (in data are
|
||||
* usually from requests, out data are from publications,
|
||||
* but generally what you want to compare) \n
|
||||
* - convenience function to poll tokens \n
|
||||
* - also allows filling in-data automatically from polls \n
|
||||
* - convenience interface for running tests
|
||||
*/
|
||||
class GenExchangeTest
|
||||
{
|
||||
public:
|
||||
|
||||
/*!
|
||||
* Constructs the GenExchangeTest with a tokenService
|
||||
* @param tokenService This is needed. If not an instance of token service,
|
||||
* behaviour of GenExchangeTest is undefined
|
||||
*/
|
||||
GenExchangeTest(GenExchangeTestService* const mTestService, RsGeneralDataService* dataService, int pollingTO = 5 /* 5 secs default */);
|
||||
|
||||
virtual ~GenExchangeTest();
|
||||
|
||||
/*!
|
||||
* This should be called in the main
|
||||
* routines to execute all tests
|
||||
* When implementing ensure units test header
|
||||
* is in same file scope as implementation
|
||||
* (you chould be using the CHECK functions
|
||||
* to assert tests has passed)
|
||||
*/
|
||||
virtual void runTests() = 0;
|
||||
|
||||
protected:
|
||||
|
||||
/*!
|
||||
* After each request and publish operation this should
|
||||
* be called to ensure the operation has completed
|
||||
* Requests will result in in data maps being filled
|
||||
* @param
|
||||
* @param opts
|
||||
* @param fill if set to true, the received that is
|
||||
* routed to IN data structures
|
||||
*/
|
||||
void pollForToken(uint32_t token, const RsTokReqOptions& opts, bool fill = false);
|
||||
|
||||
/*!
|
||||
* Allows to poll for token, and receive the message id
|
||||
* as acknowledgement. This function blocks for as long the
|
||||
* timeout value set on construction of tester
|
||||
* @param token
|
||||
* @param msgId
|
||||
*/
|
||||
bool pollForMsgAcknowledgement(uint32_t token, RsGxsGrpMsgIdPair& msgId);
|
||||
|
||||
/*!
|
||||
* Allows to poll for token, and receive the group id
|
||||
* as acknowledgement. This function blocks for as long the
|
||||
* timeout value set on construction of tester
|
||||
* @param token
|
||||
* @param msgId
|
||||
*/
|
||||
bool pollForGrpAcknowledgement(uint32_t token, RsGxsGroupId& msgId);
|
||||
|
||||
GenExchangeTestService* getTestService();
|
||||
RsTokenService* getTokenService();
|
||||
// bool testGrpMetaModRequest();
|
||||
// bool testMsgMetaModRequest();
|
||||
|
||||
// convenience functions for clearing IN and OUT data structures
|
||||
void clearMsgDataInMap();
|
||||
void clearMsgDataOutMap();
|
||||
void clearMsgMetaInMap();
|
||||
void clearMsgMetaOutMap();
|
||||
void clearMsgIdInMap();
|
||||
void clearMsgIdOutMap();
|
||||
void clearMsgRelatedIdInMap();
|
||||
void clearGrpDataInList();
|
||||
void clearGrpDataOutList();
|
||||
void clearGrpMetaInList();
|
||||
void clearGrpMetaOutList();
|
||||
void clearGrpIdInList();
|
||||
void clearGrpIdOutList();
|
||||
|
||||
/*!
|
||||
* clears up all internal
|
||||
* IN and OUT data structure for
|
||||
* both msgs and groups
|
||||
* frees resources in relation to allocated data
|
||||
*/
|
||||
void clearAllData();
|
||||
|
||||
template <class Item>
|
||||
void deleteResVector(std::vector<Item*>& v) const
|
||||
{
|
||||
typename std::vector<Item*>::iterator vit = v.begin();
|
||||
for(; vit != v.end(); vit++)
|
||||
delete *vit;
|
||||
v.clear();
|
||||
}
|
||||
|
||||
// using class to enable partial
|
||||
// function specialisation, bit of a hack in a
|
||||
// way
|
||||
template <class Cont, class Item>
|
||||
class Comparison
|
||||
{
|
||||
public:
|
||||
|
||||
static bool comparison(const Cont& l, const Cont& r)
|
||||
{
|
||||
if(l.size() != r.size()) return false;
|
||||
|
||||
typename Cont::const_iterator vit1 = l.begin(), vit2 = r.begin();
|
||||
|
||||
while(vit1 != l.end())
|
||||
{
|
||||
const Item& item1 = (*vit1);
|
||||
const Item& item2 = (*vit2);
|
||||
if(!(item1 == item2)) return false;
|
||||
|
||||
vit1++;
|
||||
vit2++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <class Cont, class Item>
|
||||
class Comparison<Cont, Item*>
|
||||
{
|
||||
public:
|
||||
|
||||
static bool comparison(const Cont& l, const Cont& r)
|
||||
{
|
||||
if(l.size() != r.size())
|
||||
return false;
|
||||
|
||||
typename Cont::const_iterator vit1 = l.begin(), vit2 = r.begin();
|
||||
|
||||
while(vit1 != l.end())
|
||||
{
|
||||
const Item* item1 = (*vit1);
|
||||
const Item* item2 = (*vit2);
|
||||
if(!(*item1 == *item2))
|
||||
return false;
|
||||
|
||||
vit1++;
|
||||
vit2++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// convenience function for comparing IN and OUT data structures
|
||||
bool compareMsgDataMaps() ;
|
||||
bool compareMsgIdMaps() ;
|
||||
bool compareMsgMetaMaps() ;
|
||||
bool compareMsgRelateIdsMap() ;
|
||||
bool compareMsgRelatedDataMap() ;
|
||||
bool compareGrpData() ;
|
||||
bool compareGrpMeta() ;
|
||||
bool compareGrpIds() ;
|
||||
|
||||
void storeToMsgDataOutMaps(const DummyMsgMap& msgDataOut);
|
||||
void storeToMsgIdsOutMaps(const GxsMsgIdResult& msgIdsOut);
|
||||
void storeToMsgMetaOutMaps(const GxsMsgMetaMap& msgMetaOut);
|
||||
|
||||
void storeToMsgDataInMaps(const DummyMsgMap& msgDataOut);
|
||||
void storeToMsgIdsInMaps(const GxsMsgIdResult& msgIdsOut);
|
||||
void storeToMsgMetaInMaps(const GxsMsgMetaMap& msgMetaOut);
|
||||
|
||||
void storeToGrpIdsOutList(const std::list<RsGxsGroupId>& grpIdOut);
|
||||
void storeToGrpMetaOutList(const std::list<RsGroupMetaData>& grpMetaOut);
|
||||
void storeToGrpDataOutList(const std::vector<RsDummyGrp*>& grpDataOut);
|
||||
|
||||
void storeToGrpIdsInList(const std::list<RsGxsGroupId>& grpIdIn);
|
||||
void storeToGrpMetaInList(const std::list<RsGroupMetaData>& grpMetaOut);
|
||||
void storeToGrpDataInList(const std::vector<RsDummyGrp*>& grpDataOut);
|
||||
|
||||
/*!
|
||||
* This sets up any resources required to operate a test
|
||||
*/
|
||||
void setUp();
|
||||
|
||||
/*!
|
||||
* Call at end of test to ensure resources
|
||||
* used in tests are released
|
||||
* This can invalidate other test runs if not called
|
||||
*/
|
||||
void breakDown();
|
||||
|
||||
/*!
|
||||
* initialises item to random data
|
||||
* @param grpItem item to initialise
|
||||
*/
|
||||
void init(RsDummyGrp& grpItem) const;
|
||||
|
||||
/*!
|
||||
* Initialises meta data to random data
|
||||
* @param grpMetaData
|
||||
*/
|
||||
void init(RsGroupMetaData& grpMetaData) const;
|
||||
|
||||
/*!
|
||||
* Initialises msg item to random data
|
||||
* @param msgItem
|
||||
*/
|
||||
void init(RsDummyMsg& msgItem) const;
|
||||
|
||||
/*!
|
||||
* Initialises meta data to random data
|
||||
* @param msgMetaData
|
||||
*/
|
||||
void init(RsMsgMetaData& msgMetaData) const;
|
||||
|
||||
|
||||
void clearMsgDataMap(DummyMsgMap& msgDataMap) const;
|
||||
void clearGrpDataList(std::vector<RsDummyGrp*>& grpData) const;
|
||||
|
||||
/*!
|
||||
* Helper function which sets up groups
|
||||
* data in to be used for publication
|
||||
* group data
|
||||
* @param nGrps number of groups to publish
|
||||
* @param groupId the ids for the created groups
|
||||
*/
|
||||
void createGrps(uint32_t nGrps, std::list<RsGxsGroupId>& groupId);
|
||||
|
||||
/*!
|
||||
* @return random number
|
||||
*/
|
||||
uint32_t randNum() const;
|
||||
|
||||
private:
|
||||
|
||||
std::vector<RsDummyGrp*> mGrpDataOut, mGrpDataIn;
|
||||
std::list<RsGroupMetaData> mGrpMetaDataOut, mGrpMetaDataIn;
|
||||
std::list<RsGxsGroupId> mGrpIdsOut, mGrpIdsIn;
|
||||
|
||||
DummyMsgMap mMsgDataOut, mMsgDataIn;
|
||||
GxsMsgMetaMap mMsgMetaDataOut, mMsgMetaDataIn;
|
||||
GxsMsgIdResult mMsgIdsOut, mMsgIdsIn;
|
||||
|
||||
MsgRelatedIdResult mMsgRelatedIdsOut, mMsgRelatedIdsIn;
|
||||
GxsMsgRelatedDataMap mMsgRelatedDataMapOut, mMsgRelatedDataMapIn;
|
||||
|
||||
std::vector<RsGxsGroupId> mRandGrpIds; // ids that exist to help group testing
|
||||
|
||||
private:
|
||||
|
||||
RsGeneralDataService* mDataService;
|
||||
GenExchangeTestService* mTestService;
|
||||
RsTokenService* mTokenService;
|
||||
int mPollingTO;
|
||||
};
|
||||
|
||||
#endif // GENEXCHANGETESTER_H
|
|
@ -1,8 +1,8 @@
|
|||
#include "genexchangetestservice.h"
|
||||
|
||||
GenExchangeTestService::GenExchangeTestService(RsGeneralDataService *dataServ, RsNetworkExchangeService * netService,
|
||||
RsGixs* gixs, uint32_t authenPolicy)
|
||||
: RsGenExchange(dataServ, netService, new RsDummySerialiser(), RS_SERVICE_TYPE_DUMMY, gixs, authenPolicy)
|
||||
RsGixs* gixs)
|
||||
: RsGenExchange(dataServ, netService, new RsDummySerialiser(), RS_SERVICE_TYPE_DUMMY, gixs, 0)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -32,14 +32,14 @@ bool GenExchangeTestService::getGroupMetaTS(const uint32_t &token, std::list<RsG
|
|||
return getGroupMeta(token, groupInfo);
|
||||
}
|
||||
|
||||
bool GenExchangeTestService::getGroupDataTS(const uint32_t &token, std::vector<RsGxsGrpItem *> &grpItem)
|
||||
bool GenExchangeTestService::getGroupDataTS(const uint32_t &token, std::vector<RsDummyGrp *>& grpItem)
|
||||
{
|
||||
return getGroupData(token, grpItem);
|
||||
return getGroupDataT<RsDummyGrp>(token, grpItem);
|
||||
}
|
||||
|
||||
bool GenExchangeTestService::getMsgDataTS(const uint32_t &token, GxsMsgDataMap &msgItems)
|
||||
bool GenExchangeTestService::getMsgDataTS(const uint32_t &token, DummyMsgMap &msgItems)
|
||||
{
|
||||
return getMsgData(token, msgItems);
|
||||
return getMsgDataT<RsDummyMsg>(token, msgItems);
|
||||
}
|
||||
|
||||
bool GenExchangeTestService::getMsgRelatedDataTS(const uint32_t &token, GxsMsgRelatedDataMap &msgItems)
|
|
@ -5,17 +5,18 @@
|
|||
#include "retroshare/rsgxsifacehelper.h"
|
||||
#include "rsdummyservices.h"
|
||||
|
||||
typedef std::map<RsGxsGroupId, std::vector<RsDummyMsg*> > DummyMsgMap;
|
||||
|
||||
class GenExchangeTestService : public RsGenExchange
|
||||
{
|
||||
public:
|
||||
GenExchangeTestService(RsGeneralDataService* dataServ, RsNetworkExchangeService*, RsGixs* gixs, uint32_t authenPolicy);
|
||||
GenExchangeTestService(RsGeneralDataService* dataServ, RsNetworkExchangeService* nxs, RsGixs* gixs);
|
||||
|
||||
void notifyChanges(std::vector<RsGxsNotify*>& changes);
|
||||
|
||||
void publishDummyGrp(uint32_t& token, RsDummyGrp* grp);
|
||||
void publishDummyMsg(uint32_t& token, RsDummyMsg* msg);
|
||||
|
||||
|
||||
/*!
|
||||
* Retrieve group list for a given token
|
||||
* @param token
|
||||
|
@ -51,14 +52,16 @@ public:
|
|||
* @param token token to be redeemed for grpitem retrieval
|
||||
* @param grpItem the items to be retrieved for token are stored here
|
||||
*/
|
||||
bool getGroupDataTS(const uint32_t &token, std::vector<RsGxsGrpItem*>& grpItem);
|
||||
bool getGroupDataTS(const uint32_t &token, std::vector<RsDummyGrp*>& grpItem);
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* retrieves message data associated to a request token
|
||||
* @param token token to be redeemed for message item retrieval
|
||||
* @param msgItems
|
||||
*/
|
||||
bool getMsgDataTS(const uint32_t &token, GxsMsgDataMap& msgItems);
|
||||
bool getMsgDataTS(const uint32_t &token, DummyMsgMap& msgItems);
|
||||
|
||||
/*!
|
||||
* Retrieve msg related list for a given token sectioned by group Ids
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* gxsmsgrelatedtest.cpp
|
||||
*
|
||||
* Created on: 27 Apr 2013
|
||||
* Author: crispy
|
||||
*/
|
||||
|
||||
#include "gxsmsgrelatedtest.h"
|
||||
|
||||
GxsMsgRelatedTest::GxsMsgRelatedTest() {
|
||||
// TODO Auto-generated constructor stub
|
||||
|
||||
}
|
||||
|
||||
GxsMsgRelatedTest::~GxsMsgRelatedTest() {
|
||||
// TODO Auto-generated destructor stub
|
||||
}
|
||||
|
25
libretroshare/src/tests/gxs/gen_exchange/gxsmsgrelatedtest.h
Normal file
25
libretroshare/src/tests/gxs/gen_exchange/gxsmsgrelatedtest.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* gxsmsgrelatedtest.h
|
||||
*
|
||||
* Created on: 27 Apr 2013
|
||||
* Author: crispy
|
||||
*/
|
||||
|
||||
#ifndef GXSMSGRELATEDTEST_H_
|
||||
#define GXSMSGRELATEDTEST_H_
|
||||
|
||||
#include "genexchangetester.h"
|
||||
|
||||
class GxsMsgRelatedTest: public GenExchangeTest {
|
||||
public:
|
||||
GxsMsgRelatedTest();
|
||||
virtual ~GxsMsgRelatedTest();
|
||||
|
||||
// request msg related tests
|
||||
bool testMsgRelatedChildIdRetrieval();
|
||||
bool testMsgRelatedChildDataRetrieval();
|
||||
bool testMsgRelatedChildDataRetrieval_Multi();
|
||||
bool testMsgAllVersions();
|
||||
};
|
||||
|
||||
#endif /* GXSMSGRELATEDTEST_H_ */
|
240
libretroshare/src/tests/gxs/gen_exchange/gxspublishgrouptest.cc
Normal file
240
libretroshare/src/tests/gxs/gen_exchange/gxspublishgrouptest.cc
Normal file
|
@ -0,0 +1,240 @@
|
|||
/*
|
||||
* gxspublishgrouptest.cc
|
||||
*
|
||||
* Created on: 27 Apr 2013
|
||||
* Author: crispy
|
||||
*/
|
||||
|
||||
#include "gxspublishgrouptest.h"
|
||||
#include "util/utest.h"
|
||||
|
||||
#define POLLING_TIME_OUT 5
|
||||
|
||||
GxsPublishGroupTest::GxsPublishGroupTest(GenExchangeTestService* const testService,
|
||||
RsGeneralDataService* dataService)
|
||||
: GenExchangeTest(testService, dataService, POLLING_TIME_OUT)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
GxsPublishGroupTest::~GxsPublishGroupTest()
|
||||
{
|
||||
}
|
||||
|
||||
bool GxsPublishGroupTest::testGrpSubmissionRetrieval()
|
||||
{
|
||||
|
||||
setUp();
|
||||
|
||||
GenExchangeTestService* testService = getTestService();
|
||||
RsTokenService* tokenService = getTokenService();
|
||||
|
||||
// create some random grps to allow msg testing
|
||||
|
||||
RsDummyGrp* dgrp1 = new RsDummyGrp();
|
||||
RsDummyGrp* dgrp2 = new RsDummyGrp();
|
||||
RsDummyGrp* dgrp3 = new RsDummyGrp();
|
||||
|
||||
RsDummyGrp* dgrp1_copy = new RsDummyGrp();
|
||||
RsDummyGrp* dgrp2_copy = new RsDummyGrp();
|
||||
RsDummyGrp* dgrp3_copy = new RsDummyGrp();
|
||||
|
||||
init(*dgrp1);
|
||||
init(*dgrp2);
|
||||
init(*dgrp3);
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = 45000;
|
||||
uint32_t token;
|
||||
RsGxsGroupId grpId;
|
||||
|
||||
std::vector<RsDummyGrp*> groupsPublished;
|
||||
|
||||
*dgrp1_copy = *dgrp1;
|
||||
testService->publishDummyGrp(token, dgrp1);
|
||||
pollForGrpAcknowledgement(token, grpId);
|
||||
dgrp1_copy->meta.mGroupId = grpId;
|
||||
groupsPublished.push_back(dgrp1_copy);
|
||||
|
||||
*dgrp2_copy = *dgrp2;
|
||||
testService->publishDummyGrp(token, dgrp2);
|
||||
pollForGrpAcknowledgement(token, grpId);
|
||||
dgrp2_copy->meta.mGroupId = grpId;
|
||||
groupsPublished.push_back(dgrp2_copy);
|
||||
|
||||
*dgrp3_copy = *dgrp3;
|
||||
testService->publishDummyGrp(token, dgrp3);
|
||||
pollForGrpAcknowledgement(token, grpId);
|
||||
dgrp3_copy->meta.mGroupId = grpId;
|
||||
groupsPublished.push_back(dgrp3_copy);
|
||||
|
||||
|
||||
storeToGrpDataOutList(groupsPublished);
|
||||
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
tokenService->requestGroupInfo(token, 0, opts);
|
||||
|
||||
pollForToken(token, opts, true);
|
||||
|
||||
|
||||
bool ok = compareGrpData();
|
||||
|
||||
breakDown();
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool GxsPublishGroupTest::testSpecificGrpRetrieval()
|
||||
{
|
||||
setUp();
|
||||
|
||||
GenExchangeTestService* testService = getTestService();
|
||||
RsTokenService* tokenService = getTokenService();
|
||||
|
||||
// create some random grps to allow msg testing
|
||||
|
||||
RsDummyGrp* dgrp1 = new RsDummyGrp();
|
||||
RsDummyGrp* dgrp2 = new RsDummyGrp();
|
||||
RsDummyGrp* dgrp3 = new RsDummyGrp();
|
||||
|
||||
RsDummyGrp* dgrp1_copy = new RsDummyGrp();
|
||||
RsDummyGrp* dgrp2_copy = new RsDummyGrp();
|
||||
|
||||
init(*dgrp1);
|
||||
init(*dgrp2);
|
||||
init(*dgrp3);
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = 45000;
|
||||
uint32_t token;
|
||||
RsGxsGroupId grpId;
|
||||
|
||||
std::vector<RsDummyGrp*> groupsPublished;
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
|
||||
*dgrp1_copy = *dgrp1;
|
||||
testService->publishDummyGrp(token, dgrp1);
|
||||
pollForGrpAcknowledgement(token, grpId);
|
||||
dgrp1_copy->meta.mGroupId = grpId;
|
||||
groupsPublished.push_back(dgrp1_copy);
|
||||
grpIds.push_back(grpId);
|
||||
|
||||
*dgrp2_copy = *dgrp2;
|
||||
testService->publishDummyGrp(token, dgrp2);
|
||||
pollForGrpAcknowledgement(token, grpId);
|
||||
dgrp2_copy->meta.mGroupId = grpId;
|
||||
groupsPublished.push_back(dgrp2_copy);
|
||||
grpIds.push_back(grpId);
|
||||
|
||||
|
||||
testService->publishDummyGrp(token, dgrp3);
|
||||
pollForGrpAcknowledgement(token, grpId);
|
||||
|
||||
|
||||
storeToGrpDataOutList(groupsPublished);
|
||||
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
|
||||
tokenService->requestGroupInfo(token, 0, opts, grpIds);
|
||||
|
||||
pollForToken(token, opts, true);
|
||||
|
||||
|
||||
bool ok = compareGrpData();
|
||||
|
||||
breakDown();
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool GxsPublishGroupTest::testGrpIdRetrieval()
|
||||
{
|
||||
setUp();
|
||||
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
createGrps(5, grpIds);
|
||||
storeToGrpIdsOutList(grpIds);
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_IDS;
|
||||
uint32_t token;
|
||||
|
||||
getTokenService()->requestGroupInfo(token, 0, opts);
|
||||
|
||||
pollForToken(token, opts, true);
|
||||
|
||||
bool ok = compareGrpIds();
|
||||
|
||||
breakDown();
|
||||
|
||||
return ok;
|
||||
}
|
||||
bool GxsPublishGroupTest::testGrpMetaRetrieval()
|
||||
{
|
||||
|
||||
setUp();
|
||||
|
||||
GenExchangeTestService* testService = getTestService();
|
||||
|
||||
// create some random grps to allow msg testing
|
||||
|
||||
RsDummyGrp* dgrp1 = new RsDummyGrp();
|
||||
RsDummyGrp* dgrp2 = new RsDummyGrp();
|
||||
RsDummyGrp* dgrp3 = new RsDummyGrp();
|
||||
|
||||
init(*dgrp1);
|
||||
init(*dgrp2);
|
||||
init(*dgrp3);
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = 45000;
|
||||
uint32_t token;
|
||||
RsGxsGroupId grpId;
|
||||
|
||||
RsGroupMetaData meta1(dgrp1->meta);
|
||||
RsGroupMetaData meta2(dgrp2->meta);
|
||||
RsGroupMetaData meta3(dgrp3->meta);
|
||||
|
||||
std::list<RsGroupMetaData> groupsMetaPublished;
|
||||
|
||||
testService->publishDummyGrp(token, dgrp1);
|
||||
pollForGrpAcknowledgement(token, grpId);
|
||||
meta1.mGroupId = grpId;
|
||||
groupsMetaPublished.push_back(meta1);
|
||||
|
||||
testService->publishDummyGrp(token, dgrp2);
|
||||
pollForGrpAcknowledgement(token, grpId);
|
||||
meta2.mGroupId = grpId;
|
||||
groupsMetaPublished.push_back(meta2);
|
||||
|
||||
testService->publishDummyGrp(token, dgrp3);
|
||||
pollForGrpAcknowledgement(token, grpId);
|
||||
meta3.mGroupId = grpId;
|
||||
groupsMetaPublished.push_back(meta3);
|
||||
|
||||
storeToGrpMetaOutList(groupsMetaPublished);
|
||||
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_META;
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
|
||||
getTokenService()->requestGroupInfo(token, 0, opts);
|
||||
|
||||
pollForToken(token, opts, true);
|
||||
|
||||
bool ok = compareGrpMeta();
|
||||
|
||||
breakDown();
|
||||
|
||||
return ok;
|
||||
}
|
||||
void GxsPublishGroupTest::runTests()
|
||||
{
|
||||
CHECK(testGrpSubmissionRetrieval());
|
||||
CHECK(testGrpIdRetrieval());
|
||||
CHECK(testGrpMetaRetrieval());
|
||||
CHECK(testSpecificGrpRetrieval());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* gxspublishgrouptest.h
|
||||
*
|
||||
* Created on: 27 Apr 2013
|
||||
* Author: crispy
|
||||
*/
|
||||
|
||||
#ifndef GXSPUBLISHGROUPTEST_H_
|
||||
#define GXSPUBLISHGROUPTEST_H_
|
||||
|
||||
#include "genexchangetester.h"
|
||||
|
||||
class GxsPublishGroupTest : public GenExchangeTest {
|
||||
public:
|
||||
|
||||
GxsPublishGroupTest(GenExchangeTestService* const testService,
|
||||
RsGeneralDataService* dataService);
|
||||
virtual ~GxsPublishGroupTest();
|
||||
|
||||
void runTests();
|
||||
|
||||
private:
|
||||
|
||||
// group tests
|
||||
bool testGrpSubmissionRetrieval();
|
||||
bool testSpecificGrpRetrieval();
|
||||
bool testGrpIdRetrieval();
|
||||
bool testGrpMetaRetrieval();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif /* GXSPUBLISHGROUPTEST_H_ */
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* gxspublishmsgtest.cpp
|
||||
*
|
||||
* Created on: 27 Apr 2013
|
||||
* Author: crispy
|
||||
*/
|
||||
|
||||
#include "gxspublishmsgtest.h"
|
||||
#include "util/utest.h"
|
||||
|
||||
#define POLLING_TIME_OUT 5
|
||||
|
||||
GxsPublishMsgTest::GxsPublishMsgTest(GenExchangeTestService* const testService,
|
||||
RsGeneralDataService* dataService)
|
||||
: GenExchangeTest(testService, dataService, POLLING_TIME_OUT)
|
||||
{
|
||||
}
|
||||
|
||||
GxsPublishMsgTest::~GxsPublishMsgTest()
|
||||
{
|
||||
}
|
||||
|
||||
void GxsPublishMsgTest::runTests()
|
||||
{
|
||||
CHECK(testMsgSubmissionRetrieval());
|
||||
}
|
||||
|
||||
bool GxsPublishMsgTest::testMsgSubmissionRetrieval()
|
||||
{
|
||||
// start up
|
||||
setUp();
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
createGrps(4, grpIds);
|
||||
|
||||
/********************/
|
||||
|
||||
RsDummyMsg* msg = new RsDummyMsg();
|
||||
init(*msg);
|
||||
|
||||
msg->meta.mGroupId = grpIds.front();
|
||||
uint32_t token;
|
||||
RsDummyMsg* msgOut = new RsDummyMsg();
|
||||
*msgOut = *msg;
|
||||
getTestService()->publishDummyMsg(token, msg);
|
||||
|
||||
|
||||
RsGxsGrpMsgIdPair msgId;
|
||||
pollForMsgAcknowledgement(token, msgId);
|
||||
msgOut->meta.mMsgId = msgId.second;
|
||||
|
||||
DummyMsgMap msgMap;
|
||||
std::vector<RsDummyMsg*> msgV;
|
||||
msgV.push_back(msgOut);
|
||||
msgMap[msgOut->meta.mGroupId] = msgV;
|
||||
storeToMsgDataOutMaps(msgMap);
|
||||
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
|
||||
getTokenService()->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, grpIds);
|
||||
|
||||
// poll again
|
||||
pollForToken(token, opts, true);
|
||||
|
||||
bool ok = compareMsgDataMaps();
|
||||
|
||||
// complete
|
||||
breakDown();
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
|
32
libretroshare/src/tests/gxs/gen_exchange/gxspublishmsgtest.h
Normal file
32
libretroshare/src/tests/gxs/gen_exchange/gxspublishmsgtest.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* gxspublishmsgtest.h
|
||||
*
|
||||
* Created on: 27 Apr 2013
|
||||
* Author: crispy
|
||||
*/
|
||||
|
||||
#ifndef GXSPUBLISHMSGTEST_H_
|
||||
#define GXSPUBLISHMSGTEST_H_
|
||||
|
||||
#include "genexchangetester.h"
|
||||
|
||||
class GxsPublishMsgTest: public GenExchangeTest {
|
||||
public:
|
||||
GxsPublishMsgTest(GenExchangeTestService* const testService,
|
||||
RsGeneralDataService* dataService);
|
||||
virtual ~GxsPublishMsgTest();
|
||||
|
||||
void runTests();
|
||||
|
||||
// message tests
|
||||
bool testMsgSubmissionRetrieval();
|
||||
// bool testMsgIdRetrieval();
|
||||
// bool testMsgIdRetrieval_OptParents();
|
||||
// bool testMsgIdRetrieval_OptOrigMsgId();
|
||||
// bool testMsgIdRetrieval_OptLatest();
|
||||
// bool testSpecificMsgMetaRetrieval();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif /* GXSPUBLISHMSGTEST_H_ */
|
|
@ -13,6 +13,7 @@ class RsDummyNetService: public RsNetworkExchangeService
|
|||
public:
|
||||
|
||||
RsDummyNetService(){ return;}
|
||||
virtual ~RsDummyNetService() { }
|
||||
|
||||
void setSyncAge(uint32_t age){}
|
||||
|
||||
|
@ -55,7 +56,6 @@ public:
|
|||
virtual ~RsDummyGrp() { return; }
|
||||
|
||||
|
||||
|
||||
std::string grpData;
|
||||
void clear() { grpData.clear(); }
|
||||
std::ostream &print(std::ostream &out, uint16_t indent = 0){ return out; }
|
||||
|
@ -109,6 +109,8 @@ public:
|
|||
*/
|
||||
RsGixsDummy(const RsGxsId& incomingId, const RsGxsId& outgoingId){}
|
||||
|
||||
virtual ~RsGixsDummy(){}
|
||||
|
||||
/*!
|
||||
*
|
||||
* @return id used for signing incoming data (should have both public and private components)
|
|
@ -0,0 +1,47 @@
|
|||
|
||||
|
||||
#include "genexchangetester.h"
|
||||
#include "gxspublishgrouptest.h"
|
||||
#include "gxspublishmsgtest.h"
|
||||
#include "util/utest.h"
|
||||
#include "gxs/rsdataservice.h"
|
||||
#include "rsdummyservices.h"
|
||||
|
||||
|
||||
/*!
|
||||
* It always hard to say exactly what coverage of a test would
|
||||
* be ahead of time. Partly because its difficult to create the
|
||||
* actual conditions of a test or the permutations of different request
|
||||
* options to a module is extremely large (and there are probably ways to deal with this)
|
||||
* In so far as the genexchange test is concerned we are primarily interested that it
|
||||
* retrieves and stores data correctly
|
||||
* The auxillary (and important) requirement is authentication and ensuring the authentication
|
||||
* rules are respected. This auxillary requirement is of the "hard" situation to create as
|
||||
* genexchange depends on an external module (rsidentity) for satisfying a significant sum
|
||||
* of its authentication. This difficulty is solved with a dummy identity service.
|
||||
* Which passes all authentications (In this respect authentication) is reserved for "online"
|
||||
* testing and is relatively straight forward.
|
||||
*
|
||||
*/
|
||||
|
||||
INITTEST();
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
RsGeneralDataService* dataStore = new RsDataService("./", "testServiceDb", RS_SERVICE_TYPE_DUMMY, NULL);
|
||||
|
||||
// we want to use default authentication which is NO authentication :)
|
||||
GenExchangeTestService testService(dataStore, NULL, NULL);
|
||||
|
||||
//GxsPublishGroupTest testGrpPublishing(&testService, dataStore);
|
||||
//testGrpPublishing.runTests();
|
||||
|
||||
GxsPublishMsgTest testMsgPublishing(&testService, dataStore);
|
||||
testMsgPublishing.runTests();
|
||||
|
||||
FINALREPORT("RsGenExchangeTest");
|
||||
|
||||
return 0;
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,122 +0,0 @@
|
|||
#ifndef GENEXCHANGETESTER_H
|
||||
#define GENEXCHANGETESTER_H
|
||||
|
||||
#include "genexchangetestservice.h"
|
||||
#include "gxs/rsgds.h"
|
||||
#include "gxs/rsnxs.h"
|
||||
|
||||
bool operator ==(const RsMsgMetaData& lMeta, const RsMsgMetaData& rMeta);
|
||||
bool operator ==(const RsDummyMsg& lMsg, const RsDummyMsg& rMsg);
|
||||
|
||||
bool operator ==(const RsGroupMetaData& lMeta, const RsGroupMetaData& rMeta);
|
||||
bool operator ==(const RsDummyGrp& lMsg, const RsDummyGrp& rMsg);
|
||||
|
||||
/*!
|
||||
* The job of the service tester is to send dummy msg items to the GenExchange service
|
||||
* and then retrieve them (ignoring ackowledge message)
|
||||
* Also it modifies local meta items and check if it worked out
|
||||
*/
|
||||
class GenExchangeTester
|
||||
{
|
||||
public:
|
||||
|
||||
void pollForToken(uint32_t, const RsTokReqOptions& opts);
|
||||
|
||||
GenExchangeTester();
|
||||
|
||||
// message tests
|
||||
bool testMsgSubmissionRetrieval();
|
||||
bool testMsgIdRetrieval();
|
||||
bool testMsgIdRetrieval_OptParents();
|
||||
bool testMsgIdRetrieval_OptOrigMsgId();
|
||||
bool testMsgIdRetrieval_OptLatest();
|
||||
bool testSpecificMsgMetaRetrieval();
|
||||
|
||||
// request msg related tests
|
||||
bool testMsgRelatedChildIdRetrieval();
|
||||
bool testMsgRelatedChildDataRetrieval();
|
||||
bool testMsgRelatedChildDataRetrieval_Multi();
|
||||
bool testMsgAllVersions();
|
||||
|
||||
|
||||
// group tests
|
||||
bool testGrpSubmissionRetrieval();
|
||||
bool testSpecificGrpRetrieval();
|
||||
bool testGrpIdRetrieval();
|
||||
bool testGrpMetaRetrieval();
|
||||
|
||||
bool testGrpMetaModRequest();
|
||||
bool testMsgMetaModRequest();
|
||||
|
||||
|
||||
// testing verification (publish).
|
||||
// Strategy is
|
||||
// inject a group which you only have the public signature for
|
||||
// The injection can be done via
|
||||
|
||||
private:
|
||||
|
||||
// to be called at start
|
||||
void setUp();
|
||||
|
||||
// and at end of test routines, resets db and clears out maps
|
||||
void breakDown();
|
||||
|
||||
|
||||
void setUpGrps(uint32_t grpFlag=0); // to be called at start of msg tests
|
||||
|
||||
/*!
|
||||
* Can be called at start grpId or grpMeta test
|
||||
* to help out
|
||||
* ids are store is mGrpIdsOut
|
||||
*/
|
||||
void setUpLargeGrps(uint32_t nGrps);
|
||||
|
||||
void storeMsgData(GxsMsgDataMap& msgData);
|
||||
void storeMsgMeta(GxsMsgMetaMap& msgMetaData);
|
||||
void storeMsgIds(GxsMsgIdResult& msgIds);
|
||||
|
||||
void storeGrpData(std::vector<RsGxsGrpItem*>& grpData);
|
||||
void storeGrpMeta(std::list<RsGroupMetaData>& grpMetaData);
|
||||
void storeGrpId(std::list<RsGxsGroupId>& grpIds);
|
||||
|
||||
void init(RsDummyGrp* grpItem) const;
|
||||
void init(RsGroupMetaData&) const;
|
||||
void init(RsDummyMsg* msgItem) const;
|
||||
void init(RsMsgMetaData&) const;
|
||||
|
||||
uint32_t randNum() const;
|
||||
private:
|
||||
|
||||
void createMsgs(std::vector<RsDummyMsg*>& msgs, int nMsgs) const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
RsMutex mGenTestMutex;
|
||||
|
||||
std::vector<RsGxsGrpItem*> mGrpDataOut, mGrpDataIn;
|
||||
std::list<RsGroupMetaData> mGrpMetaDataOut, mGrpMetaDataIn;
|
||||
std::list<RsGxsGroupId> mGrpIdsOut, mGrpIdsIn;
|
||||
|
||||
GxsMsgDataMap mMsgDataOut, mMsgDataIn;
|
||||
GxsMsgMetaMap mMsgMetaDataOut, mMsgMetaDataIn;
|
||||
GxsMsgIdResult mMsgIdsOut, mMsgIdsIn;
|
||||
|
||||
MsgRelatedIdResult mMsgRelatedIdsOut, mMsgRelatedIdsIn;
|
||||
GxsMsgRelatedDataMap mMsgRelatedDataMapOut, mMsgRelatedDataMapIn;
|
||||
|
||||
std::vector<RsGxsGroupId> mRandGrpIds; // ids that exist to help group testing
|
||||
|
||||
private:
|
||||
|
||||
GenExchangeTestService* mTestService;
|
||||
RsTokenService* mTokenService;
|
||||
|
||||
RsNetworkExchangeService* mNxs;
|
||||
RsGeneralDataService* mDataStore;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // GENEXCHANGETESTER_H
|
203
libretroshare/src/tests/gxs/nxs_test/nxs_tests.pro
Normal file
203
libretroshare/src/tests/gxs/nxs_test/nxs_tests.pro
Normal file
|
@ -0,0 +1,203 @@
|
|||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2012-05-06T09:19:26
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
|
||||
#
|
||||
QT += core network
|
||||
|
||||
QT -= gui
|
||||
|
||||
#CONFIG += gen_exchange_target
|
||||
CONFIG += nxs_net_test
|
||||
#CONFIG += dstore_target
|
||||
#CONFIG += gxsdata_target
|
||||
|
||||
CONFIG += bitdht
|
||||
|
||||
|
||||
|
||||
#gen_exchange_target {
|
||||
|
||||
#TARGET = gen_exchange_test
|
||||
|
||||
#}
|
||||
|
||||
#nxs_net_test {
|
||||
|
||||
TARGET = nxs_net_test
|
||||
|
||||
#}
|
||||
|
||||
#gxsdata_target {
|
||||
|
||||
#TARGET = gxsdata_test
|
||||
#}
|
||||
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
CONFIG += debug
|
||||
|
||||
debug {
|
||||
# DEFINES *= DEBUG
|
||||
# DEFINES *= OPENDHT_DEBUG DHT_DEBUG CONN_DEBUG DEBUG_UDP_SORTER P3DISC_DEBUG DEBUG_UDP_LAYER FT_DEBUG EXTADDRSEARCH_DEBUG
|
||||
# DEFINES *= CONTROL_DEBUG FT_DEBUG DEBUG_FTCHUNK P3TURTLE_DEBUG
|
||||
# DEFINES *= P3TURTLE_DEBUG
|
||||
# DEFINES *= NET_DEBUG
|
||||
# DEFINES *= DISTRIB_DEBUG
|
||||
# DEFINES *= P3TURTLE_DEBUG FT_DEBUG DEBUG_FTCHUNK MPLEX_DEBUG
|
||||
# DEFINES *= STATUS_DEBUG SERV_DEBUG RSSERIAL_DEBUG #CONN_DEBUG
|
||||
|
||||
QMAKE_CXXFLAGS -= -O2 -fomit-frame-pointer
|
||||
QMAKE_CXXFLAGS *= -g -fno-omit-frame-pointer
|
||||
}
|
||||
################################# Linux ##########################################
|
||||
# Put lib dir in QMAKE_LFLAGS so it appears before -L/usr/lib
|
||||
linux-* {
|
||||
#CONFIG += version_detail_bash_script
|
||||
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
||||
|
||||
system(which gpgme-config >/dev/null 2>&1) {
|
||||
INCLUDEPATH += $$system(gpgme-config --cflags | sed -e "s/-I//g")
|
||||
} else {
|
||||
message(Could not find gpgme-config on your system, assuming gpgme.h is in /usr/include)
|
||||
}
|
||||
|
||||
PRE_TARGETDEPS *= ../../lib/libretroshare.a
|
||||
|
||||
LIBS += ../../lib/libretroshare.a
|
||||
LIBS += ../../../../libbitdht/src/lib/libbitdht.a
|
||||
LIBS += ../../../../openpgpsdk/src/lib/libops.a
|
||||
LIBS += -lssl -lgpgme -lupnp -lixml -lgnome-keyring -lsqlite3 -lbz2
|
||||
LIBS *= -rdynamic -frtti
|
||||
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
||||
DEFINES *= UBUNTU
|
||||
}
|
||||
|
||||
linux-g++ {
|
||||
OBJECTS_DIR = temp/linux-g++/obj
|
||||
}
|
||||
|
||||
linux-g++-64 {
|
||||
OBJECTS_DIR = temp/linux-g++-64/obj
|
||||
}
|
||||
|
||||
#################################### Windows #####################################
|
||||
|
||||
win32 {
|
||||
|
||||
DEFINES *= WINDOWS_SYS \
|
||||
WIN32 \
|
||||
STATICLIB \
|
||||
MINGW
|
||||
# Switch on extra warnings
|
||||
QMAKE_CFLAGS += -Wextra
|
||||
QMAKE_CXXFLAGS += -Wextra
|
||||
|
||||
# Switch off optimization for release version
|
||||
QMAKE_CXXFLAGS_RELEASE -= -O2
|
||||
QMAKE_CXXFLAGS_RELEASE += -O0
|
||||
QMAKE_CFLAGS_RELEASE -= -O2
|
||||
QMAKE_CFLAGS_RELEASE += -O0
|
||||
|
||||
# Switch on optimization for debug version
|
||||
#QMAKE_CXXFLAGS_DEBUG += -O2
|
||||
#QMAKE_CFLAGS_DEBUG += -O2
|
||||
|
||||
# PRE_TARGETDEPS += ../../libretroshare/src/lib/libretroshare.a
|
||||
PRE_TARGETDEPS += ../../../../libretroshare/libretroshare-build-desktop/lib/libretroshare.a
|
||||
|
||||
LIBS += ../../../../libretroshare/libretroshare-build-desktop/lib/libretroshare.a
|
||||
LIBS += C:\Development\Rs\v0.5-gxs-b1\openpgpsdk\openpgpsdk-build-desktop\lib\libops.a
|
||||
LIBS += C:\Development\Libraries\sqlite\sqlite-autoconf-3070900\lib\libsqlite3.a
|
||||
LIBS += -L"../../../../../lib"
|
||||
LIBS += -lssl -lcrypto -lgpgme -lpthreadGC2d -lminiupnpc -lz -lbz2
|
||||
# added after bitdht
|
||||
# LIBS += -lws2_32
|
||||
LIBS += -luuid -lole32 -liphlpapi -lcrypt32-cygwin -lgdi32
|
||||
LIBS += -lole32 -lwinmm
|
||||
|
||||
# export symbols for the plugins
|
||||
#LIBS += -Wl,--export-all-symbols,--out-implib,lib/libretroshare-gui.a
|
||||
|
||||
GPG_ERROR_DIR = ../../../../libgpg-error-1.7
|
||||
GPGME_DIR = ../../../../gpgme-1.1.8
|
||||
GPG_ERROR_DIR = ../../../../lib/libgpg-error-1.7
|
||||
GPGME_DIR = ../../../../lib/gpgme-1.1.8
|
||||
SSL_DIR = ../../../../../OpenSSL
|
||||
OPENPGPSDK_DIR = ../../../../openpgpsdk/src
|
||||
INCLUDEPATH += . $${SSL_DIR}/include $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src \
|
||||
$${OPENPGPSDK_DIR}
|
||||
|
||||
SQLITE_DIR = ../../../../../../Libraries/sqlite/sqlite-autoconf-3070900
|
||||
INCLUDEPATH += . \
|
||||
$${SQLITE_DIR}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
bitdht {
|
||||
|
||||
# Chris version.
|
||||
#LIBS += ../../libbitdht/libbitdht-build-desktop/lib/libbitdht.a
|
||||
#PRE_TARGETDEPS *= ../../libbitdht/libbitdht-build-desktop/lib/libbitdht.a
|
||||
}
|
||||
|
||||
win32 {
|
||||
# must be added after bitdht
|
||||
LIBS += -lws2_32
|
||||
}
|
||||
|
||||
version_detail_bash_script {
|
||||
DEFINES += ADD_LIBRETROSHARE_VERSION_INFO
|
||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||
PRE_TARGETDEPS = write_version_detail
|
||||
write_version_detail.commands = ./version_detail.sh
|
||||
}
|
||||
|
||||
install_rs {
|
||||
INSTALLS += binary_rs
|
||||
binary_rs.path = $$(PREFIX)/usr/bin
|
||||
binary_rs.files = ./RetroShare
|
||||
}
|
||||
|
||||
|
||||
#gen_exchange_target {
|
||||
|
||||
# SOURCES += \
|
||||
# support.cc \
|
||||
# genexchangetester.cpp \
|
||||
# genexchangetestservice.cpp \
|
||||
# rsdummyservices.cc \
|
||||
# rsgenexchange_test.cc
|
||||
|
||||
# HEADERS += support.h \
|
||||
# rsdataservice_test.h \
|
||||
# rsdummyservices.h \
|
||||
# data_support.h
|
||||
#}
|
||||
|
||||
nxs_net_test {
|
||||
|
||||
SOURCES += \
|
||||
support.cc \
|
||||
data_support.cc \
|
||||
nxstesthub.cc \
|
||||
nxstestscenario.cc \
|
||||
rsgxsnetservice_test.cc
|
||||
|
||||
HEADERS += support.h \
|
||||
nxstestscenario.h \
|
||||
nxstesthub.h \
|
||||
data_support.h
|
||||
|
||||
}
|
||||
|
||||
INCLUDEPATH += ../../
|
|
@ -1,92 +0,0 @@
|
|||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2012-05-06T09:19:26
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core network
|
||||
|
||||
QT -= gui
|
||||
|
||||
TARGET = rs_test
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
CONFIG += debug
|
||||
|
||||
debug {
|
||||
# DEFINES *= DEBUG
|
||||
# DEFINES *= OPENDHT_DEBUG DHT_DEBUG CONN_DEBUG DEBUG_UDP_SORTER P3DISC_DEBUG DEBUG_UDP_LAYER FT_DEBUG EXTADDRSEARCH_DEBUG
|
||||
# DEFINES *= CONTROL_DEBUG FT_DEBUG DEBUG_FTCHUNK P3TURTLE_DEBUG
|
||||
# DEFINES *= P3TURTLE_DEBUG
|
||||
# DEFINES *= NET_DEBUG
|
||||
# DEFINES *= DISTRIB_DEBUG
|
||||
# DEFINES *= P3TURTLE_DEBUG FT_DEBUG DEBUG_FTCHUNK MPLEX_DEBUG
|
||||
# DEFINES *= STATUS_DEBUG SERV_DEBUG RSSERIAL_DEBUG #CONN_DEBUG
|
||||
|
||||
QMAKE_CXXFLAGS -= -O2 -fomit-frame-pointer
|
||||
QMAKE_CXXFLAGS *= -g -fno-omit-frame-pointer
|
||||
}
|
||||
################################# Linux ##########################################
|
||||
# Put lib dir in QMAKE_LFLAGS so it appears before -L/usr/lib
|
||||
linux-* {
|
||||
#CONFIG += version_detail_bash_script
|
||||
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
||||
|
||||
system(which gpgme-config >/dev/null 2>&1) {
|
||||
INCLUDEPATH += $$system(gpgme-config --cflags | sed -e "s/-I//g")
|
||||
} else {
|
||||
message(Could not find gpgme-config on your system, assuming gpgme.h is in /usr/include)
|
||||
}
|
||||
|
||||
PRE_TARGETDEPS *= /home/crispy/workspace/v0.5-gxs-b1/libretroshare/src/lib/libretroshare.a
|
||||
|
||||
LIBS += /home/crispy/workspace/v0.5-gxs-b1/libretroshare/src/lib/libretroshare.a
|
||||
LIBS += /home/crispy/workspace/v0.5-gxs-b1/libbitdht/src/lib/libbitdht.a
|
||||
LIBS += /home/crispy/workspace/v0.5-gxs-b1/openpgpsdk/src/lib/libops.a
|
||||
LIBS += -lssl -lgpgme -lupnp -lixml -lgnome-keyring -lsqlite3 -lbz2
|
||||
LIBS *= -rdynamic -frtti
|
||||
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
||||
DEFINES *= UBUNTU
|
||||
}
|
||||
|
||||
linux-g++ {
|
||||
OBJECTS_DIR = temp/linux-g++/obj
|
||||
}
|
||||
|
||||
linux-g++-64 {
|
||||
OBJECTS_DIR = temp/linux-g++-64/obj
|
||||
}
|
||||
|
||||
version_detail_bash_script {
|
||||
DEFINES += ADD_LIBRETROSHARE_VERSION_INFO
|
||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||
PRE_TARGETDEPS = write_version_detail
|
||||
write_version_detail.commands = ./version_detail.sh
|
||||
}
|
||||
|
||||
install_rs {
|
||||
INSTALLS += binary_rs
|
||||
binary_rs.path = $$(PREFIX)/usr/bin
|
||||
binary_rs.files = ./RetroShare
|
||||
}
|
||||
|
||||
|
||||
SOURCES += \
|
||||
/home/crispy/workspace/v0.5-gxs-b1/libretroshare/src/tests/gxs/data_support.cc \
|
||||
/home/crispy/workspace/v0.5-gxs-b1/libretroshare/src/tests/gxs/nxstesthub.cc \
|
||||
/home/crispy/workspace/v0.5-gxs-b1/libretroshare/src/tests/gxs/nxstestscenario.cc \
|
||||
/home/crispy/workspace/v0.5-gxs-b1/libretroshare/src/tests/gxs/rsgxsnetservice_test.cc \
|
||||
/home/crispy/workspace/v0.5-gxs-b1/libretroshare/src/tests/gxs/support.cc
|
||||
|
||||
|
||||
HEADERS += \
|
||||
/home/crispy/workspace/v0.5-gxs-b1/libretroshare/src/tests/gxs/data_support.h \
|
||||
/home/crispy/workspace/v0.5-gxs-b1/libretroshare/src/tests/gxs/nxstesthub.h \
|
||||
/home/crispy/workspace/v0.5-gxs-b1/libretroshare/src/tests/gxs/nxstestscenario.h \
|
||||
/home/crispy/workspace/v0.5-gxs-b1/libretroshare/src/tests/gxs/support.h
|
||||
|
||||
INCLUDEPATH += /home/crispy/workspace/v0.5-gxs-b1/libretroshare/src
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2012-05-06T09:19:26
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core network
|
||||
|
||||
QT -= gui
|
||||
|
||||
TARGET = rs_test
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
win32 {
|
||||
# Switch on extra warnings
|
||||
QMAKE_CFLAGS += -Wextra
|
||||
QMAKE_CXXFLAGS += -Wextra
|
||||
|
||||
# Switch off optimization for release version
|
||||
QMAKE_CXXFLAGS_RELEASE -= -O2
|
||||
QMAKE_CXXFLAGS_RELEASE += -O0
|
||||
QMAKE_CFLAGS_RELEASE -= -O2
|
||||
QMAKE_CFLAGS_RELEASE += -O0
|
||||
|
||||
# Switch on optimization for debug version
|
||||
#QMAKE_CXXFLAGS_DEBUG += -O2
|
||||
#QMAKE_CFLAGS_DEBUG += -O2
|
||||
DEFINES *= WINDOWS_SYS
|
||||
PRE_TARGETDEPS += C:\Development\Rs\v0.5-new_cache_system\libretroshare\libretroshare-build-desktop\lib\libretroshare.a
|
||||
LIBS += C:\Development\Rs\v0.5-new_cache_system\libretroshare\libretroshare-build-desktop\lib\libretroshare.a
|
||||
LIBS += -L"../lib"
|
||||
LIBS += -lssl -lcrypto -lgpgme -lpthreadGC2d -lminiupnpc -lz
|
||||
# added after bitdht
|
||||
# LIBS += -lws2_32
|
||||
LIBS += -luuid -lole32 -liphlpapi -lcrypt32-cygwin -lgdi32
|
||||
LIBS += -lole32 -lwinmm
|
||||
|
||||
# export symbols for the plugins
|
||||
#LIBS += -Wl,--export-all-symbols,--out-implib,lib/libretroshare-gui.a
|
||||
|
||||
GPG_ERROR_DIR = ../../../../libgpg-error-1.7
|
||||
GPGME_DIR = ../../../../gpgme-1.1.8
|
||||
GPG_ERROR_DIR = ../../../../lib/libgpg-error-1.7
|
||||
GPGME_DIR = ../../../../lib/gpgme-1.1.8
|
||||
INCLUDEPATH += . $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src ../../Libraries/sqlite/sqlite-autoconf-3070900
|
||||
LIBS += C:\Development\Libraries\sqlite\sqlite-autoconf-3070900\.libs\libsqlite3.a
|
||||
}
|
||||
|
||||
win32 {
|
||||
# must be added after bitdht
|
||||
LIBS += -lws2_32
|
||||
}
|
||||
|
||||
SOURCES += \
|
||||
support.cc \
|
||||
#rsnxsitems_test.cc
|
||||
rsdataservice_test.cc \
|
||||
data_support.cc
|
||||
#rsnxsservice_test.cc \
|
||||
#nxstesthub.cc
|
||||
#rsgxsdata_test.cc
|
||||
|
||||
HEADERS += support.h \
|
||||
#rsnxsitems_test.h
|
||||
rsdataservice_test.h \
|
||||
data_support.h
|
||||
#rsnxsservice_test.h \
|
||||
#nxstesthub.h
|
||||
|
||||
INCLUDEPATH += C:\Development\Rs\v0.5-new_cache_system\libretroshare\src
|
|
@ -1,36 +0,0 @@
|
|||
|
||||
|
||||
#include "genexchangetester.h"
|
||||
#include "genexchangetestservice.h"
|
||||
#include "util/utest.h"
|
||||
#include "gxs/gxscoreserver.h"
|
||||
#include "gxs/rsdataservice.h"
|
||||
#include "rsdummyservices.h"
|
||||
|
||||
INITTEST();
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
GenExchangeTester tester;
|
||||
|
||||
CHECK(tester.testMsgSubmissionRetrieval()); REPORT("testMsgSubmissionRetrieval()");
|
||||
CHECK(tester.testSpecificMsgMetaRetrieval()); REPORT("testSpecificMsgMetaRetrieval()");
|
||||
CHECK(tester.testMsgIdRetrieval()); REPORT("tester.testMsgIdRetrieval()");
|
||||
CHECK(tester.testMsgIdRetrieval_OptParents()); REPORT("tester.testRelatedMsgIdRetrieval_Parents()");
|
||||
CHECK(tester.testMsgIdRetrieval_OptOrigMsgId()); REPORT("tester.testRelatedMsgIdRetrieval_OrigMsgId()");
|
||||
CHECK(tester.testMsgIdRetrieval_OptLatest()); REPORT("tester.testRelatedMsgIdRetrieval_Latest()");
|
||||
CHECK(tester.testMsgMetaModRequest()); REPORT("tester.testMsgMetaModRequest()");
|
||||
CHECK(tester.testMsgRelatedChildDataRetrieval()); REPORT("tester.testMsgRelatedChildDataRetrieval()");
|
||||
CHECK(tester.testMsgRelatedChildDataRetrieval_Multi()); REPORT("tester.testMsgRelatedChildDataRetrieval_Multi()");
|
||||
CHECK(tester.testMsgAllVersions()); REPORT("tester.testMsgAllVersions()");
|
||||
|
||||
CHECK(tester.testGrpSubmissionRetrieval()); REPORT("tester.testGrpSubmissionRetrieval()");
|
||||
CHECK(tester.testGrpMetaRetrieval()); REPORT("tester.testGrpMetaRetrieval()");
|
||||
CHECK(tester.testGrpIdRetrieval()); REPORT("tester.testGrpIdRetrieval()");
|
||||
CHECK(tester.testGrpMetaModRequest()); REPORT("tester.testGrpMetaModRequest()");
|
||||
|
||||
FINALREPORT("RsGenExchangeTest");
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
|
||||
TEMPLATE = app
|
||||
TARGET = rsgenexcahnge_test
|
||||
CONFIG += debug
|
||||
|
||||
win32 {
|
||||
|
||||
DEFINES *= WINDOWS_SYS \
|
||||
WIN32 \
|
||||
STATICLIB \
|
||||
MINGW
|
||||
|
||||
# Switch on extra warnings
|
||||
QMAKE_CFLAGS += -Wextra
|
||||
QMAKE_CXXFLAGS += -Wextra
|
||||
|
||||
# Switch off optimization for release version
|
||||
QMAKE_CXXFLAGS_RELEASE -= -O2
|
||||
QMAKE_CXXFLAGS_RELEASE += -O0
|
||||
QMAKE_CFLAGS_RELEASE -= -O2
|
||||
QMAKE_CFLAGS_RELEASE += -O0
|
||||
|
||||
# Switch on optimization for debug version
|
||||
#QMAKE_CXXFLAGS_DEBUG += -O2
|
||||
#QMAKE_CFLAGS_DEBUG += -O2
|
||||
|
||||
# PRE_TARGETDEPS += ../../libretroshare/src/lib/libretroshare.a
|
||||
PRE_TARGETDEPS += C:\Development\Rs\v0.5-gxs-b1/libretroshare/libretroshare-build-desktop/lib/libretroshare.a
|
||||
|
||||
LIBS += C:\Development\Rs\v0.5-gxs-b1/libretroshare/libretroshare-build-desktop/lib/libretroshare.a
|
||||
LIBS += C:\Development\Rs\v0.5-gxs-b1\openpgpsdk\openpgpsdk-build-desktop\lib\libops.a
|
||||
LIBS += C:\Development\Libraries\sqlite\sqlite-autoconf-3070900\lib\libsqlite3.a
|
||||
LIBS += -L"../lib"
|
||||
LIBS += -lssl -lcrypto -lgpgme -lpthreadGC2d -lminiupnpc -lz -lbz2
|
||||
# added after bitdht
|
||||
# LIBS += -lws2_32
|
||||
LIBS += -luuid -lole32 -liphlpapi -lcrypt32-cygwin -lgdi32
|
||||
LIBS += -lole32 -lwinmm
|
||||
|
||||
# export symbols for the plugins
|
||||
#LIBS += -Wl,--export-all-symbols,--out-implib,lib/libretroshare-gui.a
|
||||
|
||||
GPG_ERROR_DIR = ../../../../libgpg-error-1.7
|
||||
GPGME_DIR = ../../../../gpgme-1.1.8
|
||||
GPG_ERROR_DIR = ../../../../lib/libgpg-error-1.7
|
||||
GPGME_DIR = ../../../../lib/gpgme-1.1.8
|
||||
INCLUDEPATH += . $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src
|
||||
SQLITE_DIR = ../../Libraries/sqlite/sqlite-autoconf-3070900
|
||||
INCLUDEPATH += . \
|
||||
$${SQLITE_DIR}
|
||||
|
||||
LIBS += -lws2_32
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
INCLUDEPATH += C:\Development\Rs\v0.5-gxs-b1\libretroshare\src
|
||||
|
||||
HEADERS += \
|
||||
genexchangetestservice.h \
|
||||
genexchangetester.h \
|
||||
rsdummyservices.h \
|
||||
support.h
|
||||
|
||||
SOURCES += \
|
||||
genexchangetestservice.cpp \
|
||||
genexchangetester.cpp \
|
||||
rsgenexchange_test.cc \
|
||||
support.cc \
|
||||
rsdummyservices.cc
|
Loading…
Add table
Add a link
Reference in a new issue