mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
removed debug
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7314 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6e4883f606
commit
97a069007f
@ -6,6 +6,10 @@
|
|||||||
#include "SetServiceTester.h"
|
#include "SetServiceTester.h"
|
||||||
#include "peer/PeerNode.h"
|
#include "peer/PeerNode.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* #define DEBUG_TEST 1
|
||||||
|
**/
|
||||||
|
|
||||||
SetServiceTester::SetServiceTester()
|
SetServiceTester::SetServiceTester()
|
||||||
:mDropFilter(SetFilter::FILTER_NONE),
|
:mDropFilter(SetFilter::FILTER_NONE),
|
||||||
mCaptureFilter(SetFilter::FILTER_ALL),
|
mCaptureFilter(SetFilter::FILTER_ALL),
|
||||||
@ -145,8 +149,10 @@ bool SetServiceTester::tickUntilFinish(int max_ticks)
|
|||||||
|
|
||||||
bool SetServiceTester::tickUntilEvent(int max_ticks, EventType eventType)
|
bool SetServiceTester::tickUntilEvent(int max_ticks, EventType eventType)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_TEST
|
||||||
std::cerr << "SetServiceTester::tickUntilEvent()";
|
std::cerr << "SetServiceTester::tickUntilEvent()";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
for(int i = 0; i < max_ticks; i++)
|
for(int i = 0; i < max_ticks; i++)
|
||||||
{
|
{
|
||||||
@ -156,9 +162,11 @@ bool SetServiceTester::tickUntilEvent(int max_ticks, EventType eventType)
|
|||||||
pit->second->tick();
|
pit->second->tick();
|
||||||
while (pit->second->haveOutgoingPackets())
|
while (pit->second->haveOutgoingPackets())
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_TEST
|
||||||
std::cerr << "SetServiceTester::tickUntilEvent() ";
|
std::cerr << "SetServiceTester::tickUntilEvent() ";
|
||||||
std::cerr << "packet from: " << pit->first.toStdString();
|
std::cerr << "packet from: " << pit->first.toStdString();
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
double ts = time(NULL) - mRefTime;
|
double ts = time(NULL) - mRefTime;
|
||||||
@ -170,10 +178,12 @@ bool SetServiceTester::tickUntilEvent(int max_ticks, EventType eventType)
|
|||||||
SetPacket pkt(ts, srcId, destId, item);
|
SetPacket pkt(ts, srcId, destId, item);
|
||||||
if (filter(pkt))
|
if (filter(pkt))
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_TEST
|
||||||
std::cerr << "Dropping Packet: ";
|
std::cerr << "Dropping Packet: ";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
item->print(std::cerr);
|
item->print(std::cerr);
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
delete rawItem;
|
delete rawItem;
|
||||||
delete item;
|
delete item;
|
||||||
@ -184,10 +194,12 @@ bool SetServiceTester::tickUntilEvent(int max_ticks, EventType eventType)
|
|||||||
{
|
{
|
||||||
if (finish(pkt))
|
if (finish(pkt))
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_TEST
|
||||||
std::cerr << "Finish Packet: ";
|
std::cerr << "Finish Packet: ";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
item->print(std::cerr);
|
item->print(std::cerr);
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
finished = true;
|
finished = true;
|
||||||
}
|
}
|
||||||
@ -195,10 +207,12 @@ bool SetServiceTester::tickUntilEvent(int max_ticks, EventType eventType)
|
|||||||
|
|
||||||
if (capture(pkt))
|
if (capture(pkt))
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_TEST
|
||||||
std::cerr << "Capture Packet: ";
|
std::cerr << "Capture Packet: ";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
item->print(std::cerr);
|
item->print(std::cerr);
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
mPackets.push_back(pkt);
|
mPackets.push_back(pkt);
|
||||||
if (eventType == UNTIL_CAPTURE)
|
if (eventType == UNTIL_CAPTURE)
|
||||||
@ -272,9 +286,11 @@ RsItem *SetServiceTester::convertToRsItem(RsRawItem *rawitem, bool toDelete)
|
|||||||
{
|
{
|
||||||
if (rawitem)
|
if (rawitem)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_TEST
|
||||||
/* convert back to standard item for convenience */
|
/* convert back to standard item for convenience */
|
||||||
std::cerr << "SetServiceTester::getPacket() have RsRawItem";
|
std::cerr << "SetServiceTester::getPacket() have RsRawItem";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* convert to RsServiceItem */
|
/* convert to RsServiceItem */
|
||||||
uint32_t size = rawitem->getRawLength();
|
uint32_t size = rawitem->getRawLength();
|
||||||
@ -315,8 +331,10 @@ RsItem *SetServiceTester::convertToRsItem(RsRawItem *rawitem, bool toDelete)
|
|||||||
|
|
||||||
RsRawItem *SetServiceTester::convertToRsRawItem(RsItem *item, bool toDelete)
|
RsRawItem *SetServiceTester::convertToRsRawItem(RsItem *item, bool toDelete)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_TEST
|
||||||
std::cerr << "SetServiceTester::convertToRawItem()";
|
std::cerr << "SetServiceTester::convertToRawItem()";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* try to convert */
|
/* try to convert */
|
||||||
uint32_t size = mRsSerialiser->size(item);
|
uint32_t size = mRsSerialiser->size(item);
|
||||||
|
Loading…
Reference in New Issue
Block a user