1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-16 06:15:06 -05:00

Clean unit test output

This commit is contained in:
Perttu Ahola 2012-03-10 17:02:14 +02:00
parent 030b63c3d2
commit d81e783665
2 changed files with 13 additions and 9 deletions

View File

@ -1184,8 +1184,10 @@ struct TestConnection
infostream<<"Sending data (size="<<datasize<<"):"; infostream<<"Sending data (size="<<datasize<<"):";
for(int i=0; i<datasize && i<20; i++){ for(int i=0; i<datasize && i<20; i++){
if(i%2==0) DEBUGPRINT(" "); if(i%2==0) infostream<<" ";
DEBUGPRINT("%.2X", ((int)((const char*)*data1)[i])&0xff); char buf[10];
snprintf(buf, 10, "%.2X", ((int)((const char*)*data1)[i])&0xff);
infostream<<buf;
} }
if(datasize>20) if(datasize>20)
infostream<<"..."; infostream<<"...";
@ -1216,10 +1218,12 @@ struct TestConnection
<<", size="<<size <<", size="<<size
<<std::endl; <<std::endl;
infostream<<"Received data (size="<<size<<"):"; infostream<<"Received data (size="<<size<<"): ";
for(int i=0; i<size && i<20; i++){ for(int i=0; i<size && i<20; i++){
if(i%2==0) DEBUGPRINT(" "); if(i%2==0) infostream<<" ";
DEBUGPRINT("%.2X", ((int)(recvdata[i]))&0xff); char buf[10];
snprintf(buf, 10, "%.2X", ((int)(recvdata[i]))&0xff);
infostream<<buf;
} }
if(size>20) if(size>20)
infostream<<"..."; infostream<<"...";

View File

@ -364,11 +364,11 @@ public:
if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT) if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT)
{ {
dstream<<"EXCEPT: VoxelManipulator::getNode(): " /*dstream<<"EXCEPT: VoxelManipulator::getNode(): "
<<"p=("<<p.X<<","<<p.Y<<","<<p.Z<<")" <<"p=("<<p.X<<","<<p.Y<<","<<p.Z<<")"
<<", index="<<m_area.index(p) <<", index="<<m_area.index(p)
<<", flags="<<(int)m_flags[m_area.index(p)] <<", flags="<<(int)m_flags[m_area.index(p)]
<<" is inexistent"<<std::endl; <<" is inexistent"<<std::endl;*/
throw InvalidPositionException throw InvalidPositionException
("VoxelManipulator: getNode: inexistent"); ("VoxelManipulator: getNode: inexistent");
} }
@ -400,11 +400,11 @@ public:
if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT) if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT)
{ {
dstream<<"EXCEPT: VoxelManipulator::getNode(): " /*dstream<<"EXCEPT: VoxelManipulator::getNode(): "
<<"p=("<<p.X<<","<<p.Y<<","<<p.Z<<")" <<"p=("<<p.X<<","<<p.Y<<","<<p.Z<<")"
<<", index="<<m_area.index(p) <<", index="<<m_area.index(p)
<<", flags="<<(int)m_flags[m_area.index(p)] <<", flags="<<(int)m_flags[m_area.index(p)]
<<" is inexistent"<<std::endl; <<" is inexistent"<<std::endl;*/
throw InvalidPositionException throw InvalidPositionException
("VoxelManipulator: getNode: inexistent"); ("VoxelManipulator: getNode: inexistent");
} }