avoid more spurious whitespaces during testing
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 10 Aug 2007 13:24:36 +0200
changeset 1261 f4bc87975995
parent 1260 b24477e66df7
child 1270 1bcaff94bf03
avoid more spurious whitespaces during testing
src/common/packet.cc
src/common/tags.cc
src/common/tags.h
--- a/src/common/packet.cc	Fri Aug 10 13:17:57 2007 +0200
+++ b/src/common/packet.cc	Fri Aug 10 13:24:36 2007 +0200
@@ -128,7 +128,7 @@
 void 
 Packet::PrintTags (std::ostream &os) const
 {
-  m_tags.Print (os);
+  m_tags.Print (os, " ");
 }
 
 void 
--- a/src/common/tags.cc	Fri Aug 10 13:17:57 2007 +0200
+++ b/src/common/tags.cc	Fri Aug 10 13:24:36 2007 +0200
@@ -119,14 +119,14 @@
 }
 
 void 
-Tags::Print (std::ostream &os) const
+Tags::Print (std::ostream &os, std::string separator) const
 {
   for (struct TagData *cur = m_next; cur != 0; cur = cur->m_next) 
     {
       TagRegistry::Print (cur->m_id, cur->m_data, os);
       if (cur->m_next != 0)
         {
-          os << " ";
+          os << separator;
         }
     }
 }
@@ -347,7 +347,7 @@
       ok = false;
     }
   g_a = false;
-  tags.Print (std::cout);
+  tags.Print (std::cout, "");
   if (!g_a)
     {
       ok = false;
@@ -363,7 +363,7 @@
     }
   g_b = false;
   g_a = false;
-  tags.Print (std::cout);
+  tags.Print (std::cout, "");
   if (!g_a || !g_b)
     {
       ok = false;
@@ -372,14 +372,14 @@
   Tags other = tags;
   g_b = false;
   g_a = false;
-  other.Print (std::cout);
+  other.Print (std::cout, "");
   if (!g_a || !g_b)
     {
       ok = false;
     }
   g_b = false;
   g_a = false;
-  tags.Print (std::cout);
+  tags.Print (std::cout, "");
   if (!g_a || !g_b)
     {
       ok = false;
@@ -406,7 +406,7 @@
     }
   g_b = false;
   g_a = false;
-  other.Print (std::cout);
+  other.Print (std::cout, "");
   if (g_a || !g_b)
     {
       ok = false;
@@ -452,7 +452,7 @@
   tagZ.z = 0;
   testLastTag.Add (tagZ);
   g_z = false;
-  testLastTag.Print (std::cout);
+  testLastTag.Print (std::cout, "");
   if (!g_z)
     {
       ok = false;
--- a/src/common/tags.h	Fri Aug 10 13:17:57 2007 +0200
+++ b/src/common/tags.h	Fri Aug 10 13:24:36 2007 +0200
@@ -52,7 +52,7 @@
   template <typename T>
   bool Peek (T &tag) const;
 
-  void Print (std::ostream &os) const;
+  void Print (std::ostream &os, std::string separator) const;
   uint32_t GetSerializedSize (void) const;
   void Serialize (Buffer::Iterator i, uint32_t size) const;
   uint32_t Deserialize (Buffer::Iterator i);