[yoda-svn] r431 - trunk/tests

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Dec 8 18:59:27 GMT 2011


Author: hoeth
Date: Thu Dec  8 18:59:26 2011
New Revision: 431

Log:
add a test case for ReaderYODA

Added:
   trunk/tests/test.dat
Modified:
   trunk/tests/TestHisto1Db.cc

Modified: trunk/tests/TestHisto1Db.cc
==============================================================================
--- trunk/tests/TestHisto1Db.cc	Thu Dec  8 18:55:03 2011	(r430)
+++ trunk/tests/TestHisto1Db.cc	Thu Dec  8 18:59:26 2011	(r431)
@@ -2,6 +2,7 @@
 #include "YODA/WriterAIDA.h"
 #include "YODA/WriterYODA.h"
 #include "YODA/ReaderAIDA.h"
+#include "YODA/ReaderYODA.h"
 #include <cmath>
 #include <vector>
 #include <fstream>
@@ -52,5 +53,14 @@
     }
   }
 
+  vector<AnalysisObject*> hs3 = ReaderYODA::create().read("test.dat");
+  for (vector<AnalysisObject*>::const_iterator i = hs3.begin(); i != hs3.end(); ++i) {
+    cout << (*i)->type() << endl;
+    YODA::WriterYODA::write(std::cout, (**i));
+    if ((*i)->type() == "Histo1D") {
+      (*i)->path();
+    }
+  }
+
   return EXIT_SUCCESS;
 }

Added: trunk/tests/test.dat
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/tests/test.dat	Thu Dec  8 18:59:26 2011	(r431)
@@ -0,0 +1,27 @@
+# BEGIN YODA_HISTO1D 
+LineColor=red is a good color
+Title=Ein Titel
+Total          Total           5    3    4    5    5
+Underflow      Underflow       6    3    2    7    44
+Overflow       Overflow        8    3    2    9    33
+1              2               1    2    3    4    11
+2              3               5    1    4    7    22
+# END YODA_HISTO1D
+
+# BEGIN YODA_HISTO1D 
+Total           Total           3    3    4    5    55
+Underflow       Underflow       6    3    2    7    44
+Overflow        Overflow        8    3    2    9    33
+3.4             4.2             1    2    3    4    11
+4.5             5.3             5    1    4    7    22
+# END YODA_HISTO1D
+
+# BEGIN YODA_PROFILE1D
+Title=A profile histogram
+Path=/path/to/histo
+Underflow   Underflow  1 2 3 4 5 6 11 
+Overflow    Overflow   1 2 3 4 5 6 12 
+Total       Total      1 2 3 4 5 6 13 
+4           5          1 2 3 4 5 6 7
+5           6          1 2 3 4 5 6 7
+# END YODA_PROFILE1D


More information about the yoda-svn mailing list