diff --git a/.travis.yml b/.travis.yml index a18ca2f2f..dc003da6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ matrix: before_install: - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update; fi - - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential checkinstall cmake libavutil-dev libavcodec-dev libavformat-dev libbz2-dev libcurl4-openssl-dev libcv-dev libopencv-highgui-dev libhighgui-dev libgnome-keyring-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libjasper-dev libjpeg-dev libmicrohttpd-dev libopencv-dev libprotobuf-dev libqt4-dev libspeex-dev libspeexdsp-dev libsqlite3-dev libssl-dev libswscale-dev libtbb-dev libtiff4-dev libupnp-dev libv4l-dev libxine-dev libxslt1-dev libxss-dev pkg-config protobuf-compiler python-dev qtmobility-dev; fi + - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential checkinstall cmake libavutil-dev libavcodec-dev libavformat-dev libbz2-dev libcurl4-openssl-dev libcv-dev libopencv-highgui-dev libhighgui-dev libgnome-keyring-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libjasper-dev libjpeg-dev libmicrohttpd-dev libopencv-dev libprotobuf-dev libqt4-dev libspeex-dev libspeexdsp-dev libsqlite3-dev libssl-dev libswscale-dev libtbb-dev libtiff4-dev libupnp-dev libv4l-dev libxine-dev libxslt1-dev libxss-dev pkg-config protobuf-compiler python-dev qtmobility-dev gdb ; fi # - if [ $TRAVIS_OS_NAME == osx ]; then xcode-select --install ; fi diff --git a/libretroshare/src/file_sharing/p3filelists.cc b/libretroshare/src/file_sharing/p3filelists.cc index a673247b7..f87cb0d6e 100644 --- a/libretroshare/src/file_sharing/p3filelists.cc +++ b/libretroshare/src/file_sharing/p3filelists.cc @@ -896,9 +896,9 @@ uint32_t p3FileDatabase::getType(void *ref) const if(e == 0) return DIR_TYPE_PERSON ; - if(fi == 0) + if(fi == 0 && mLocalSharedDirs != NULL) return mLocalSharedDirs->getEntryType(e) ; - else if(mRemoteDirectories[fi-1]!=NULL) + else if(fi-1 < mRemoteDirectories.size() && mRemoteDirectories[fi-1]!=NULL) return mRemoteDirectories[fi-1]->getEntryType(e) ; else return DIR_TYPE_ROOT ;// some failure case. Should not happen diff --git a/libretroshare/src/tests/gxs/data_service/rsdataservice_test.cc b/libretroshare/src/tests/gxs/data_service/rsdataservice_test.cc index 90f800355..4cb126cce 100644 --- a/libretroshare/src/tests/gxs/data_service/rsdataservice_test.cc +++ b/libretroshare/src/tests/gxs/data_service/rsdataservice_test.cc @@ -335,38 +335,3 @@ void tearDown(){ } - - -bool operator ==(const RsGxsGrpMetaData& l, const RsGxsGrpMetaData& r) -{ - if(!(l.signSet == r.signSet)) return false; - if(!(l.keys == r.keys)) return false; - if(l.mGroupFlags != r.mGroupFlags) return false; - if(l.mPublishTs != r.mPublishTs) return false; - if(l.mAuthorId != r.mAuthorId) return false; - if(l.mGroupName != r.mGroupName) return false; - if(l.mGroupId != r.mGroupId) return false; - if(l.mGroupStatus != r.mGroupStatus) return false; - if(l.mPop != r.mPop) return false; - if(l.mMsgCount != r.mMsgCount) return false; - if(l.mSubscribeFlags != r.mSubscribeFlags) return false; - - return true; -} - -bool operator ==(const RsGxsMsgMetaData& l, const RsGxsMsgMetaData& r) -{ - - if(!(l.signSet == r.signSet)) return false; - if(l.mGroupId != r.mGroupId) return false; - if(l.mAuthorId != r.mAuthorId) return false; - if(l.mParentId != r.mParentId) return false; - if(l.mOrigMsgId != r.mOrigMsgId) return false; - if(l.mThreadId != r.mThreadId) return false; - if(l.mMsgId != r.mMsgId) return false; - if(l.mMsgName != r.mMsgName) return false; - if(l.mPublishTs != r.mPublishTs) return false; - if(l.mMsgFlags != r.mMsgFlags) return false; - - return true; -} diff --git a/tests/unittests/libretroshare/gxs/common/data_support.cc b/tests/unittests/libretroshare/gxs/common/data_support.cc index d77fa2ea6..1b64e8e8c 100644 --- a/tests/unittests/libretroshare/gxs/common/data_support.cc +++ b/tests/unittests/libretroshare/gxs/common/data_support.cc @@ -98,7 +98,7 @@ void init_item(RsGxsGrpMetaData* metaGrp) randString(SHORT_STR, metaGrp->mGroupName); randString(SHORT_STR, metaGrp->mServiceString); - init_item(metaGrp->signSet); + init_item(metaGrp->signSet);// This is not stored in db. init_item(metaGrp->keys); metaGrp->mPublishTs = rand()%3452; @@ -115,9 +115,10 @@ void init_item(RsGxsGrpMetaData* metaGrp) metaGrp->mGroupStatus = rand()%313; metaGrp->mRecvTS = rand()%313; - metaGrp->mOriginator = RsPeerId::random() ; - metaGrp->mInternalCircle = RsGxsCircleId::random() ; - metaGrp->mHash = RsFileHash::random() ; + metaGrp->mOriginator = RsPeerId::random(); + metaGrp->mInternalCircle = RsGxsCircleId::random(); + metaGrp->mHash = RsFileHash::random(); + metaGrp->mGrpSize = 0;// This was calculated on db read. } void init_item(RsGxsMsgMetaData* metaMsg) diff --git a/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.cc b/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.cc index 6cf0abeef..9720c1294 100644 --- a/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.cc +++ b/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.cc @@ -107,6 +107,11 @@ void test_groupStoreAndRetrieve(){ RsGxsGrpMetaData *l_Meta = mit->second, *r_Meta = grpMetaR[grpId]; + // assign signSet and mGrpSize + // to right as these values are not stored in db + r_Meta->signSet = l_Meta->signSet; + r_Meta->mGrpSize = l_Meta->mGrpSize; + if(!(*l_Meta == *r_Meta)) { grpMetaMatch = false; diff --git a/tests/unittests/libretroshare/gxs/gen_exchange/gxsteststats.cpp b/tests/unittests/libretroshare/gxs/gen_exchange/gxsteststats.cpp index 8cfad6538..256777c1a 100644 --- a/tests/unittests/libretroshare/gxs/gen_exchange/gxsteststats.cpp +++ b/tests/unittests/libretroshare/gxs/gen_exchange/gxsteststats.cpp @@ -81,6 +81,7 @@ void GxsTestStats::testServiceStatistics() RsDummyGrp* dgrp2 = new RsDummyGrp(); init(*dgrp1); + init(*dgrp2); RsTokReqOptions opts; opts.mReqType = 45000; uint32_t token; diff --git a/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.h b/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.h index 9f42c4bbc..48eca0074 100644 --- a/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.h +++ b/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.h @@ -110,7 +110,7 @@ namespace rs_nxs_test bool loadReputation(const RsGxsId &id, const std::list& peers); bool getReputation(const RsGxsId &id, GixsReputation &rep); - virtual RsReputations::ReputationLevel overallReputationLevel(const RsGxsId&) { return RsReputations::REPUTATION_NEUTRAL ; } + virtual RsReputations::ReputationLevel overallReputationLevel(const RsGxsId&,uint32_t */*identity_flags*/=NULL) { return RsReputations::REPUTATION_NEUTRAL ; } private: diff --git a/tests/unittests/libretroshare/serialiser/support.cc b/tests/unittests/libretroshare/serialiser/support.cc index 2474b77fb..29d7d782e 100644 --- a/tests/unittests/libretroshare/serialiser/support.cc +++ b/tests/unittests/libretroshare/serialiser/support.cc @@ -68,14 +68,11 @@ void init_item(RsTlvSecurityKeySet& ks) randString(SHORT_STR, ks.groupId); for(int i=1; i