Clean unit test output
authorPerttu Ahola <celeron55@gmail.com>
Sat, 10 Mar 2012 15:02:14 +0000 (17:02 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 10 Mar 2012 15:10:16 +0000 (17:10 +0200)
src/test.cpp
src/voxel.h

index 45851a7e3f3e638f52764d713159f7a9afdd7605..6588f113c4d622975685cf7d29f43f48c85948cd 100644 (file)
@@ -1184,8 +1184,10 @@ struct TestConnection
 
                        infostream<<"Sending data (size="<<datasize<<"):";
                        for(int i=0; i<datasize && i<20; i++){
-                               if(i%2==0) DEBUGPRINT(" ");
-                               DEBUGPRINT("%.2X", ((int)((const char*)*data1)[i])&0xff);
+                               if(i%2==0) infostream<<" ";
+                               char buf[10];
+                               snprintf(buf, 10, "%.2X", ((int)((const char*)*data1)[i])&0xff);
+                               infostream<<buf;
                        }
                        if(datasize>20)
                                infostream<<"...";
@@ -1216,10 +1218,12 @@ struct TestConnection
                                        <<", size="<<size
                                        <<std::endl;
 
-                       infostream<<"Received data (size="<<size<<"):";
+                       infostream<<"Received data (size="<<size<<"): ";
                        for(int i=0; i<size && i<20; i++){
-                               if(i%2==0) DEBUGPRINT(" ");
-                               DEBUGPRINT("%.2X", ((int)(recvdata[i]))&0xff);
+                               if(i%2==0) infostream<<" ";
+                               char buf[10];
+                               snprintf(buf, 10, "%.2X", ((int)(recvdata[i]))&0xff);
+                               infostream<<buf;
                        }
                        if(size>20)
                                infostream<<"...";
index 46864e06e83a81318648d60c709588d3fdc7038f..291b51e036fd95c2cbabf67cef30ba0f74c746f3 100644 (file)
@@ -364,11 +364,11 @@ public:
 
                if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT)
                {
-                       dstream<<"EXCEPT: VoxelManipulator::getNode(): "
+                       /*dstream<<"EXCEPT: VoxelManipulator::getNode(): "
                                        <<"p=("<<p.X<<","<<p.Y<<","<<p.Z<<")"
                                        <<", index="<<m_area.index(p)
                                        <<", flags="<<(int)m_flags[m_area.index(p)]
-                                       <<" is inexistent"<<std::endl;
+                                       <<" is inexistent"<<std::endl;*/
                        throw InvalidPositionException
                        ("VoxelManipulator: getNode: inexistent");
                }
@@ -400,11 +400,11 @@ public:
 
                if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT)
                {
-                       dstream<<"EXCEPT: VoxelManipulator::getNode(): "
+                       /*dstream<<"EXCEPT: VoxelManipulator::getNode(): "
                                        <<"p=("<<p.X<<","<<p.Y<<","<<p.Z<<")"
                                        <<", index="<<m_area.index(p)
                                        <<", flags="<<(int)m_flags[m_area.index(p)]
-                                       <<" is inexistent"<<std::endl;
+                                       <<" is inexistent"<<std::endl;*/
                        throw InvalidPositionException
                        ("VoxelManipulator: getNode: inexistent");
                }