StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTreeEntryMakerTest.C
1 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
2 
3 #include <StjTreeEntryMaker.h>
4 #include <StjTreeEntryCoordinator.h>
5 
6 #include <StjTreeIndex.h>
7 #include <StjTreeIndexList.h>
8 #include <StjTreeIndexListCreator.h>
9 
10 #include <TFile.h>
11 #include <TTree.h>
12 
13 #include <iostream>
14 #include <string>
15 
16 #include "StjTreeEntryMakerTest.hh"
17 
18 using namespace std;
19 
20 // Registers the fixture into the 'registry'
21 CPPUNIT_TEST_SUITE_REGISTRATION( StjTreeEntryMakerTest );
22 
23 void StjTreeEntryMakerTest::setUp()
24 {
25 
26 }
27 
28 void StjTreeEntryMakerTest::tearDown()
29 {
30 
31 }
32 
33 void StjTreeEntryMakerTest::testMake()
34 {
35  TDirectory* inFile = new TFile("./part_run6143024.root");
36 
37  StjTreeIndexListCreator idxCreator(inFile);
38  idxCreator.AddTrgTreeName("trgBHT2");
39  idxCreator.AddTrgTreeName("trgBJP2");
40  StjTreeIndexList idxList = idxCreator.create();
41 
43 
44  StjTreeEntryMaker *maker = new StjTreeEntryMaker("entryMaker", coord);
45 
46  maker->Init();
47 
48  for(int i = 0; i < 9313; ++i) {
49  Int_t ret = maker->Make();
50  if(ret == kStEOF) break;
51  CPPUNIT_ASSERT( 47 != i );
52  }
53 
54 
55  delete maker;
56 }
Definition: Stypes.h:43