mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-22 07:41:20 -04:00
Improved token service interface with more obvious request calls (grpIds and msgIds list being empty is not implicit of retrieving all ids)
Updated GXS tests and applied fixes started transfering flags to gxs flags header file git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5513 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
84074fdca1
commit
08904bf82f
15 changed files with 387 additions and 114 deletions
|
@ -175,7 +175,7 @@ bool GenExchangeTester::testGrpSubmissionRetrieval()
|
|||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
mTokenService->requestGroupInfo(token, 0, opts, grpIds);
|
||||
mTokenService->requestGroupInfo(token, 0, opts);
|
||||
|
||||
pollForToken(token, opts);
|
||||
|
||||
|
@ -272,7 +272,7 @@ bool GenExchangeTester::testGrpMetaRetrieval()
|
|||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_META;
|
||||
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
mTokenService->requestGroupInfo(token, 0, opts, grpIds);
|
||||
mTokenService->requestGroupInfo(token, 0, opts);
|
||||
|
||||
pollForToken(token, opts);
|
||||
|
||||
|
@ -319,7 +319,7 @@ bool GenExchangeTester::testGrpIdRetrieval()
|
|||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_IDS;
|
||||
uint32_t token;
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
mTokenService->requestGroupInfo(token, 0, opts, grpIds);
|
||||
mTokenService->requestGroupInfo(token, 0, opts);
|
||||
|
||||
pollForToken(token, opts);
|
||||
|
||||
|
@ -676,13 +676,13 @@ bool GenExchangeTester::testMsgIdRetrieval()
|
|||
|
||||
// now do ask of all msg ids
|
||||
|
||||
GxsMsgReq req;
|
||||
std::list<RsGxsGroupId> req;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_IDS;
|
||||
|
||||
// use empty grp ids request types, non specific msgs ids
|
||||
for(int i=0; i < mRandGrpIds.size(); i++)
|
||||
{
|
||||
req[mRandGrpIds[i]] = std::vector<RsGxsMessageId>();
|
||||
req.push_back(mRandGrpIds[i]);
|
||||
}
|
||||
|
||||
mTokenService->requestMsgInfo(token, 0, opts, req);
|
||||
|
|
92
libretroshare/src/tests/gxs/nxsnet_test.pro
Normal file
92
libretroshare/src/tests/gxs/nxsnet_test.pro
Normal file
|
@ -0,0 +1,92 @@
|
|||
#-------------------------------------------------
|
||||
#
|
||||
# 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
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
#include "support.h"
|
||||
#include "data_support.h"
|
||||
#include "rsdataservice_test.h"
|
||||
#include "gxs/rsgds.h"
|
||||
#include "gxs/rsdataservice.h"
|
||||
|
||||
#define DATA_BASE_NAME "msg_grp_Store"
|
||||
|
@ -57,9 +58,9 @@ void test_groupStoreAndRetrieve(){
|
|||
|
||||
dStore->storeGroup(grps);
|
||||
|
||||
std::map<std::string, RsNxsGrp*> gR;
|
||||
std::map<std::string, RsGxsGrpMetaData*> grpMetaR;
|
||||
dStore->retrieveNxsGrps(gR, false);
|
||||
std::map<RsGxsGroupId, RsNxsGrp*> gR;
|
||||
std::map<RsGxsGroupId, RsGxsGrpMetaData*> grpMetaR;
|
||||
dStore->retrieveNxsGrps(gR, false, false);
|
||||
dStore->retrieveGxsGrpMetaData(grpMetaR);
|
||||
|
||||
std::map<RsNxsGrp*, RsGxsGrpMetaData*>::iterator mit = grps.begin();
|
||||
|
@ -164,7 +165,7 @@ void test_messageStoresAndRetrieve()
|
|||
const std::string& grpId = grpV[chosen];
|
||||
|
||||
if(chosen)
|
||||
req[grpId].insert(msg->msgId);
|
||||
req[grpId].push_back(msg->msgId);
|
||||
|
||||
msgMeta->mMsgId = msg->msgId;
|
||||
msgMeta->mGroupId = msg->grpId = grpId;
|
||||
|
@ -189,7 +190,7 @@ void test_messageStoresAndRetrieve()
|
|||
msgs.insert(p);
|
||||
}
|
||||
|
||||
req[grpV[0]] = std::set<std::string>(); // assign empty list for other
|
||||
req[grpV[0]] = std::vector<RsGxsMessageId>(); // assign empty list for other
|
||||
|
||||
dStore->storeMessage(msgs);
|
||||
|
||||
|
@ -199,7 +200,8 @@ void test_messageStoresAndRetrieve()
|
|||
GxsMsgResult msgResult;
|
||||
GxsMsgMetaResult msgMetaResult;
|
||||
dStore->retrieveNxsMsgs(req, msgResult, false);
|
||||
dStore->retrieveGxsMsgMetaData(grpV, msgMetaResult);
|
||||
|
||||
dStore->retrieveGxsMsgMetaData(req, msgMetaResult);
|
||||
|
||||
// now look at result for grpId 1
|
||||
std::vector<RsNxsMsg*>& result0 = msgResult[grpId0];
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
|
||||
|
||||
RsDummySerialiser()
|
||||
:RsSerialType(RS_PKT_VERSION_SERVICE, RS_SERVICE_TYPE_DUMMY)
|
||||
: RsSerialType(RS_PKT_VERSION_SERVICE, RS_SERVICE_TYPE_DUMMY)
|
||||
{ return; }
|
||||
virtual ~RsDummySerialiser() { return; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue