From 1c2b43b7e0e38a36fc4c0214f58b0e8ae536ffe5 Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 4 May 2017 15:01:25 +0200 Subject: [PATCH] Fix UnitTest compilation But running failed. --- libretroshare/src/rsitems/rsnxsitems.cc | 13 +++++++++++++ .../librssimulator/testing/IsolatedServiceTester.cc | 1 + tests/librssimulator/testing/SetFilter.cc | 2 ++ tests/librssimulator/testing/SetServiceTester.h | 1 + .../libretroshare/gxs/common/data_support.h | 2 +- .../gxs/data_service/rsdataservice_test.h | 2 +- .../gxs/gen_exchange/rsdummyservices.h | 2 +- .../libretroshare/serialiser/rsgxsiditem_test.cc | 2 +- .../serialiser/rsgxsupdateitem_test.cc | 2 +- .../libretroshare/serialiser/rsmsgitem_test.cc | 12 ++++++------ .../libretroshare/serialiser/rsnxsitems_test.cc | 2 +- .../libretroshare/serialiser/rsstatusitem_test.cc | 2 +- .../services/gxs/GxsIsolatedServiceTester.cc | 2 +- .../services/gxs/GxsPairServiceTester.cc | 2 +- .../libretroshare/services/gxs/gxscircle_tests.cc | 2 +- .../libretroshare/services/gxs/nxsbasic_test.cc | 2 +- .../libretroshare/services/gxs/nxspair_tests.cc | 2 +- .../libretroshare/services/gxs/rsgxstestitems.h | 2 +- .../libretroshare/services/status/status_test.cc | 2 +- 19 files changed, 37 insertions(+), 20 deletions(-) diff --git a/libretroshare/src/rsitems/rsnxsitems.cc b/libretroshare/src/rsitems/rsnxsitems.cc index 104935930..b8a381054 100644 --- a/libretroshare/src/rsitems/rsnxsitems.cc +++ b/libretroshare/src/rsitems/rsnxsitems.cc @@ -156,6 +156,19 @@ void RsNxsGrp::clear() meta.TlvClear(); } +RsNxsGrp* RsNxsGrp::clone() const { + RsNxsGrp* grp = new RsNxsGrp(this->grp.tlvtype); + *grp = *this; + + if(this->metaData) + { + grp->metaData = new RsGxsGrpMetaData(); + *(grp->metaData) = *(this->metaData); + } + + return grp; +} + void RsNxsSyncGrpReqItem::clear() { flag = 0; diff --git a/tests/librssimulator/testing/IsolatedServiceTester.cc b/tests/librssimulator/testing/IsolatedServiceTester.cc index c8ae3854b..e94a59b4e 100644 --- a/tests/librssimulator/testing/IsolatedServiceTester.cc +++ b/tests/librssimulator/testing/IsolatedServiceTester.cc @@ -1,6 +1,7 @@ #include #include "retroshare/rsids.h" +#include "rsitems/rsitem.h" #include "serialiser/rsserial.h" #include "testing/IsolatedServiceTester.h" diff --git a/tests/librssimulator/testing/SetFilter.cc b/tests/librssimulator/testing/SetFilter.cc index 40d90f768..d1400f7ba 100644 --- a/tests/librssimulator/testing/SetFilter.cc +++ b/tests/librssimulator/testing/SetFilter.cc @@ -1,6 +1,8 @@ #include "SetFilter.h" +#include "rsitems/rsitem.h" + bool SetFilter::filter(const SetPacket &pkt) { switch(mFilterMode) diff --git a/tests/librssimulator/testing/SetServiceTester.h b/tests/librssimulator/testing/SetServiceTester.h index ed0ea902d..ad03aed4e 100644 --- a/tests/librssimulator/testing/SetServiceTester.h +++ b/tests/librssimulator/testing/SetServiceTester.h @@ -2,6 +2,7 @@ #include #include "retroshare/rsids.h" +#include "rsitems/rsitem.h" #include "pqi/p3linkmgr.h" #include "SetPacket.h" diff --git a/tests/unittests/libretroshare/gxs/common/data_support.h b/tests/unittests/libretroshare/gxs/common/data_support.h index ae9919428..0bb026820 100644 --- a/tests/unittests/libretroshare/gxs/common/data_support.h +++ b/tests/unittests/libretroshare/gxs/common/data_support.h @@ -1,6 +1,6 @@ #pragma once -#include "serialiser/rsnxsitems.h" +#include "rsitems/rsnxsitems.h" #include "gxs/rsgxsdata.h" #define RS_SERVICE_TYPE_PLUGIN_SIMPLE_FORUM 0x012 diff --git a/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.h b/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.h index 89d4a4f5c..13084de2f 100644 --- a/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.h +++ b/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.h @@ -2,7 +2,7 @@ #define RSDATASERVICE_TEST_H #include "util/rsthreads.h" -#include "serialiser/rsnxsitems.h" +#include "rsitems/rsnxsitems.h" #include "gxs/rsgds.h" void test_messageStoresAndRetrieve(); diff --git a/tests/unittests/libretroshare/gxs/gen_exchange/rsdummyservices.h b/tests/unittests/libretroshare/gxs/gen_exchange/rsdummyservices.h index 0bb040aba..caf404728 100644 --- a/tests/unittests/libretroshare/gxs/gen_exchange/rsdummyservices.h +++ b/tests/unittests/libretroshare/gxs/gen_exchange/rsdummyservices.h @@ -6,7 +6,7 @@ #include "gxs/rsnxs.h" #include "gxs/rsgixs.h" -#include "serialiser/rsgxsitems.h" +#include "rsitems/rsgxsitems.h" class RsDummyNetService: public RsNetworkExchangeService { diff --git a/tests/unittests/libretroshare/serialiser/rsgxsiditem_test.cc b/tests/unittests/libretroshare/serialiser/rsgxsiditem_test.cc index 10189367f..e1488441f 100644 --- a/tests/unittests/libretroshare/serialiser/rsgxsiditem_test.cc +++ b/tests/unittests/libretroshare/serialiser/rsgxsiditem_test.cc @@ -28,7 +28,7 @@ */ #include -#include "serialiser/rsgxsiditems.h" +#include "rsitems/rsgxsiditems.h" #include "support.h" diff --git a/tests/unittests/libretroshare/serialiser/rsgxsupdateitem_test.cc b/tests/unittests/libretroshare/serialiser/rsgxsupdateitem_test.cc index 1008babc0..ccaeead96 100644 --- a/tests/unittests/libretroshare/serialiser/rsgxsupdateitem_test.cc +++ b/tests/unittests/libretroshare/serialiser/rsgxsupdateitem_test.cc @@ -8,7 +8,7 @@ #include #include "support.h" -#include "serialiser/rsgxsupdateitems.h" +#include "rsitems/rsgxsupdateitems.h" #define RS_SERVICE_TYPE_PLUGIN_SIMPLE_FORUM 0x0010 RsSerialType* init_item(RsGxsGrpUpdateItem& i) diff --git a/tests/unittests/libretroshare/serialiser/rsmsgitem_test.cc b/tests/unittests/libretroshare/serialiser/rsmsgitem_test.cc index b3f585cdd..c473276dc 100644 --- a/tests/unittests/libretroshare/serialiser/rsmsgitem_test.cc +++ b/tests/unittests/libretroshare/serialiser/rsmsgitem_test.cc @@ -26,7 +26,7 @@ #include #include "util/rsrandom.h" -#include "serialiser/rsmsgitems.h" +#include "rsitems/rsmsgitems.h" #include "chat/rschatitems.h" #include "support.h" @@ -141,7 +141,7 @@ RsSerialType* init_item(RsMsgItem& mi) mi.sendTime = mi.recvTime; mi.msgFlags = mi.recvTime; - return new RsMsgSerialiser(true); + return new RsMsgSerialiser(RsServiceSerializer::SERIALIZATION_FLAG_NONE); } RsSerialType* init_item(RsMsgTagType& mtt) @@ -150,7 +150,7 @@ RsSerialType* init_item(RsMsgTagType& mtt) mtt.tagId = rand()%24242; randString(SHORT_STR, mtt.text); - return new RsMsgSerialiser(); + return new RsMsgSerialiser(RsServiceSerializer::SERIALIZATION_FLAG_NONE); } @@ -163,7 +163,7 @@ RsSerialType* init_item(RsMsgTags& mt) mt.tagIds.push_back(rand()%21341); } - return new RsMsgSerialiser(); + return new RsMsgSerialiser(RsServiceSerializer::SERIALIZATION_FLAG_NONE); } RsSerialType* init_item(RsMsgSrcId& ms) @@ -171,7 +171,7 @@ RsSerialType* init_item(RsMsgSrcId& ms) ms.msgId = rand()%434; ms.srcId = RsPeerId::random(); - return new RsMsgSerialiser(); + return new RsMsgSerialiser(RsServiceSerializer::SERIALIZATION_FLAG_NONE); } RsSerialType* init_item(RsMsgParentId& ms) @@ -179,7 +179,7 @@ RsSerialType* init_item(RsMsgParentId& ms) ms.msgId = rand()%354; ms.msgParentId = rand()%476; - return new RsMsgSerialiser(); + return new RsMsgSerialiser(RsServiceSerializer::SERIALIZATION_FLAG_NONE); } bool operator ==(const struct VisibleChatLobbyInfo& l, const struct VisibleChatLobbyInfo& r) diff --git a/tests/unittests/libretroshare/serialiser/rsnxsitems_test.cc b/tests/unittests/libretroshare/serialiser/rsnxsitems_test.cc index e40e53ea7..87bd33778 100644 --- a/tests/unittests/libretroshare/serialiser/rsnxsitems_test.cc +++ b/tests/unittests/libretroshare/serialiser/rsnxsitems_test.cc @@ -1,7 +1,7 @@ #include "support.h" #include "libretroshare/gxs/common/data_support.h" -#include "serialiser/rsnxsitems.h" +#include "rsitems/rsnxsitems.h" #define NUM_BIN_OBJECTS 5 diff --git a/tests/unittests/libretroshare/serialiser/rsstatusitem_test.cc b/tests/unittests/libretroshare/serialiser/rsstatusitem_test.cc index c9fc6cb61..1f7e53f14 100644 --- a/tests/unittests/libretroshare/serialiser/rsstatusitem_test.cc +++ b/tests/unittests/libretroshare/serialiser/rsstatusitem_test.cc @@ -25,7 +25,7 @@ #include "support.h" -#include "serialiser/rsstatusitems.h" +#include "rsitems/rsstatusitems.h" RsSerialType* init_item(RsStatusItem& rsi) { diff --git a/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc b/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc index 46d4cfdee..1345dc706 100644 --- a/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc +++ b/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc @@ -5,7 +5,7 @@ // from libretroshare #include "services/p3statusservice.h" -#include "serialiser/rsstatusitems.h" +#include "rsitems/rsstatusitems.h" #include "gxs/rsgixs.h" #include "gxs/rsdataservice.h" #include "gxs/rsgxsnetservice.h" diff --git a/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.cc b/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.cc index b56f2c868..7e2776b64 100644 --- a/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.cc +++ b/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.cc @@ -5,7 +5,7 @@ #include "gxstestservice.h" // libretroshare -#include "serialiser/rsnxsitems.h" +#include "rsitems/rsnxsitems.h" GxsPairServiceTester::GxsPairServiceTester(const RsPeerId &peerId1, const RsPeerId &peerId2, int testMode, bool useIdentityService) :SetServiceTester() diff --git a/tests/unittests/libretroshare/services/gxs/gxscircle_tests.cc b/tests/unittests/libretroshare/services/gxs/gxscircle_tests.cc index f9844dce9..ca7d0a337 100644 --- a/tests/unittests/libretroshare/services/gxs/gxscircle_tests.cc +++ b/tests/unittests/libretroshare/services/gxs/gxscircle_tests.cc @@ -4,7 +4,7 @@ // from librssimulator // from libretroshare -#include "serialiser/rsnxsitems.h" +#include "rsitems/rsnxsitems.h" // local #include "GxsPairServiceTester.h" diff --git a/tests/unittests/libretroshare/services/gxs/nxsbasic_test.cc b/tests/unittests/libretroshare/services/gxs/nxsbasic_test.cc index 1b4aec879..078eba249 100644 --- a/tests/unittests/libretroshare/services/gxs/nxsbasic_test.cc +++ b/tests/unittests/libretroshare/services/gxs/nxsbasic_test.cc @@ -8,7 +8,7 @@ //#include "gxs/rsgixs.h" //#include "gxs/rsdataservice.h" //#include "gxs/rsgxsnetservice.h" -#include "serialiser/rsnxsitems.h" +#include "rsitems/rsnxsitems.h" // local #include "GxsIsolatedServiceTester.h" diff --git a/tests/unittests/libretroshare/services/gxs/nxspair_tests.cc b/tests/unittests/libretroshare/services/gxs/nxspair_tests.cc index e8f4b932d..5eaf630e4 100644 --- a/tests/unittests/libretroshare/services/gxs/nxspair_tests.cc +++ b/tests/unittests/libretroshare/services/gxs/nxspair_tests.cc @@ -4,7 +4,7 @@ // from librssimulator // from libretroshare -#include "serialiser/rsnxsitems.h" +#include "rsitems/rsnxsitems.h" // local #include "GxsPairServiceTester.h" diff --git a/tests/unittests/libretroshare/services/gxs/rsgxstestitems.h b/tests/unittests/libretroshare/services/gxs/rsgxstestitems.h index 78379436f..30003e996 100644 --- a/tests/unittests/libretroshare/services/gxs/rsgxstestitems.h +++ b/tests/unittests/libretroshare/services/gxs/rsgxstestitems.h @@ -30,7 +30,7 @@ #include "rsitems/rsserviceids.h" #include "serialiser/rsserial.h" -#include "serialiser/rsgxsitems.h" +#include "rsitems/rsgxsitems.h" #include "gxstestservice.h" const uint8_t RS_PKT_SUBTYPE_TEST_GROUP_ITEM = 0x02; diff --git a/tests/unittests/libretroshare/services/status/status_test.cc b/tests/unittests/libretroshare/services/status/status_test.cc index 59945ad95..06258f450 100644 --- a/tests/unittests/libretroshare/services/status/status_test.cc +++ b/tests/unittests/libretroshare/services/status/status_test.cc @@ -7,7 +7,7 @@ // from libretroshare #include "services/p3statusservice.h" -#include "serialiser/rsstatusitems.h" +#include "rsitems/rsstatusitems.h" #define N_PEERS 10