add failing test
authormathieu@mathieu.inria.fr
Wed, 18 Apr 2007 19:08:40 +0200
changeset 427 ce7051138975
parent 390 c847f39a31c9
child 428 783791e8b133
add failing test
src/common/tags.cc
--- a/src/common/tags.cc	Wed Mar 28 19:38:56 2007 +0200
+++ b/src/common/tags.cc	Wed Apr 18 19:08:40 2007 +0200
@@ -201,6 +201,9 @@
 struct myInvalidTag {
   uint8_t invalid [Tags::SIZE+1];
 };
+struct myTagZ {
+  uint8_t z;
+};
 
 static void 
 myTagAPrettyPrinterCb (struct myTagA const*a, std::ostream &os)
@@ -217,11 +220,18 @@
 {
   os << "struct myTagC, c="<<(uint32_t)c->c[0]<<std::endl;
 }
+static void 
+myTagZPrettyPrinterCb (struct myTagZ const*z, std::ostream &os)
+{
+  os << "struct myTagZ" << std::endl;
+}
 
 
 static TagRegistration<struct myTagA> gMyTagARegistration ("A", &myTagAPrettyPrinterCb);
 static TagRegistration<struct myTagB> gMyTagBRegistration ("B", &myTagBPrettyPrinterCb);
 static TagRegistration<struct myTagC> gMyTagCRegistration ("C", &myTagCPrettyPrinterCb);
+static TagRegistration<struct myTagZ> g_myTagZRegistration ("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ", 
+                                                            &myTagZPrettyPrinterCb);
 
 
 TagsTest::TagsTest ()
@@ -318,6 +328,11 @@
   //struct myInvalidTag invalid;
   //tags.add (&invalid);
 
+  struct myTagZ tagZ;
+  Tags testLastTag;
+  testLastTag.Add (tagZ);
+  testLastTag.PrettyPrint (std::cout);
+
   return ok;
 }