diff --git a/roottest/root/tree/fastcloning/.rootrc b/roottest/root/tree/fastcloning/.rootrc deleted file mode 100644 index e7e8e8496c970..0000000000000 --- a/roottest/root/tree/fastcloning/.rootrc +++ /dev/null @@ -1,2 +0,0 @@ -Rint.History: .root_hist -ACLiC.LinkLibs: 1 diff --git a/roottest/root/tree/fastcloning/CMakeLists.txt b/roottest/root/tree/fastcloning/CMakeLists.txt index c4ef53c7df169..5490354f72727 100644 --- a/roottest/root/tree/fastcloning/CMakeLists.txt +++ b/roottest/root/tree/fastcloning/CMakeLists.txt @@ -26,52 +26,61 @@ ROOTTEST_ADD_TEST(execmisstop MACRO execmisstop.C OUTREF references/execmisstop.ref) -ROOTTEST_ADD_TEST(runabstract-datageneration - COPY_TO_BUILDDIR abstract.C - COMMAND ${ROOT_root_CMD} -b -q -l "${CMAKE_CURRENT_BINARY_DIR}/abstract.C+(0)") +ROOTTEST_COMPILE_MACRO(abstract.C + FIXTURES_SETUP root-tree-fastcloning-abstract-fixture) + +ROOTTEST_ADD_TEST(runabstract-datageneration0 + MACRO abstract.C+ + MACROARG 0 + FIXTURES_REQUIRED root-tree-fastcloning-abstract-fixture + FIXTURES_SETUP root-tree-fastcloning-runabstract-datageneration0-fixture) + +ROOTTEST_ADD_TEST(runabstract-datageneration1 + MACRO abstract.C+ + MACROARG 1 + FIXTURES_REQUIRED root-tree-fastcloning-abstract-fixture + root-tree-fastcloning-runabstract-datageneration0-fixture + FIXTURES_SETUP root-tree-fastcloning-runabstract-datageneration1-fixture) ROOTTEST_ADD_TEST(runabstract-copy MACRO runabstract.C - PRECMD ${ROOT_root_CMD} -b -q -l "${CMAKE_CURRENT_BINARY_DIR}/abstract.C+(1)" OUTREF references/abstract.ref - DEPENDS runabstract-datageneration) + FIXTURES_REQUIRED root-tree-fastcloning-runabstract-datageneration1-fixture) ROOTTEST_ADD_TEST(runfilemergererror MACRO runfilemergererror.C OUTREF references/runfilemergererror.ref) ROOTTEST_ADD_TEST(runoutoforder-datageneration - COPY_TO_BUILDDIR files/Tuple_1.root - COPY_TO_BUILDDIR files/Tuple_2.root - COMMAND ${ROOT_hadd_CMD} -f Tuple_merge.root Tuple_1.root Tuple_2.root) + COPY_TO_BUILDDIR files/Tuple_1.root files/Tuple_2.root + COMMAND ${ROOT_hadd_CMD} -f Tuple_merge.root Tuple_1.root Tuple_2.root + FIXTURES_SETUP root-tree-fastcloning-runoutoforder-datageneration-fixture) ROOTTEST_ADD_TEST(runoutoforder MACRO runoutoforder.C OUTREF references/runoutoforder.ref - DEPENDS runoutoforder-datageneration) + FIXTURES_REQUIRED root-tree-fastcloning-runoutoforder-datageneration-fixture) ROOTTEST_ADD_TEST(runPlot MACRO runPlot.C COPY_TO_BUILDDIR files/recon-v1r030603p6_700000811_00000-00984_calTuple.root - COPY_TO_BUILDDIR files/recon-v1r030603p6_700000811_02955-03939_calTuple.root + files/recon-v1r030603p6_700000811_02955-03939_calTuple.root OUTREF references/runPlot.ref) ROOTTEST_ADD_TEST(runbadmix MACRO runbadmix.C - PRECMD ${ROOT_root_CMD} -b -q -l ${CMAKE_CURRENT_SOURCE_DIR}/runbadmix.C OUTREF references/runbadmix.ref) ROOTTEST_ADD_TEST(runSplitMismatch - COPY_TO_BUILDDIR runSplitMismatch.C - MACRO ${CMAKE_CURRENT_BINARY_DIR}/runSplitMismatch.C+ + MACRO runSplitMismatch.C+ OUTREF references/runSplitMismatch.ref) ROOTTEST_ADD_TEST(make_CloneTree MACRO make_CloneTree.C - COPY_TO_BUILDDIR files/ver_40200.root - COPY_TO_BUILDDIR files/ver_40200_copy.root) + COPY_TO_BUILDDIR files/ver_40200.root files/ver_40200_copy.root + FIXTURES_SETUP root-tree-fastcloning-makeCloneTree-fixture) ROOTTEST_ADD_TEST(runcloneChain MACRO runcloneChain.C OUTREF references/runcloneChain.ref - DEPENDS roottest-root-tree-fastcloning-make_CloneTree) + FIXTURES_REQUIRED root-tree-fastcloning-makeCloneTree-fixture) diff --git a/roottest/root/tree/index/.rootrc b/roottest/root/tree/index/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/tree/index/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/tree/index/CMakeLists.txt b/roottest/root/tree/index/CMakeLists.txt index 227297c2402a2..6cb71de9fa99f 100644 --- a/roottest/root/tree/index/CMakeLists.txt +++ b/roottest/root/tree/index/CMakeLists.txt @@ -1,7 +1,17 @@ -#------------------------------------------------------------------------------- -# -# Placeholder file to translate the tests to the new CTest system. Meanwhile we -# define a CTest test that calls 'make' in ${CMAKE_CURRENT_SOURCE_DIR} -# -#------------------------------------------------------------------------------- -ROOTTEST_ADD_OLDTEST() +ROOTTEST_ADD_TEST(chain + MACRO runchain.C + OUTREF chain.ref) + +ROOTTEST_ADD_TEST(ChainIndex + MACRO execChainIndex.cxx+ + COPY_TO_BUILDDIR abarton.1.root abarton.2.root abarton.3.root + OUTREF execChainIndex.ref) + +ROOTTEST_ADD_TEST(Dupe + MACRO runDupe.C + OUTREF Dupe.ref) + +ROOTTEST_ADD_TEST(index64 + MACRO runindex64.C + OUTREF index64.ref) + diff --git a/roottest/root/tree/index/Makefile b/roottest/root/tree/index/Makefile deleted file mode 100644 index 533f4975453fb..0000000000000 --- a/roottest/root/tree/index/Makefile +++ /dev/null @@ -1,78 +0,0 @@ -# This is a template for all makefiles. - -#Set the list of files to be deleted by clean (Targets can also be specified).: -CLEAN_TARGETS += $(ALL_LIBRARIES) *.log *.clog newTestFile.root index64.root indexl64.root - -# Set the list of target to make while testing. By default, mytest is the -# only target added. If the name of the target is changed in the rules then -# the name should be changed accordingly in this list. - -TEST_TARGETS += chain mytest index64 indexl64 - -# Search for Rules.mk in roottest/scripts -# Algorithm: Find the current working directory and remove everything after -# '*roottest/'. Append the path for Rules.mk from within roottest, which -# should be 'scripts/Rules.mk'. The roottest path is saved in the -# ROOTTEST_HOME variable for use by the SUBDIRECTORIES variable and is -# exported to eliminate the overhead of findding the path again during -# recursive calls of gmake. -# Since all makefiles should be under roottest or one of its -# subdirectories and all recursions of gmake are called by -# 'cd [DIR]; gmake ...' -# this algorithm should not fail in finding /roottest/ in the -# current working directory. -# Issues: This algorithm will fail if a makefile is called from outside the -# roottest folder, as in executing 'gmake -f ~/roottest/Makefile' from -# the home directory. - -ifeq ($(strip $(ROOTTEST_HOME)),) - export ROOTTEST_HOME := $(shell git rev-parse --show-toplevel)/roottest/ - ifeq ($(strip $(ROOTTEST_HOME)),) - export ROOTTEST_HOME := $(shell expr $(CURDIR) : '\(.*/roottest/\)') - endif - ifeq ($(strip $(ROOTTEST_HOME)),) - $(error The head of roottest was not found. Set ROOTTEST_HOME) - endif -endif - -include $(ROOTTEST_HOME)/scripts/Rules.mk - - -# The name of this target should be changed according to the test being run. Any name changes -# should also be reflected in the TEST_TARGETS variable above. - -mytest: - $(CMDECHO) echo mytest > /dev/null - - -# Outputs a message if the FAIL variable is null - -testWithFailure: -ifeq ($(FAIL),) - $(WarnFailTest) -endif - - -# Remember that sometest.log can be made automatically from -# from runsometest.C -# This target attempts to create a log file (which should be the output of running the test), and -# compares its output with a prebuilt reference file. The reference file should be copied from -# the log files produced during what is considered a successful run of the test. The testWithDiff -# files should be renamed according to the test being run. -# By default the TestDiff variable is set to compare the .log and .ref files -# To run a diff and ignore whitespacing use $(TestDiffW) - -testWithDiff: testWithDiff.log testWithDiff.ref - $(TestDiff) - -ifneq ($(ClingWorkAroundMissingAutoLoading),) -chain.log: CALLROOTEXE += -e 'gSystem->Load("libTreePlayer");' -endif - -chain: chain.log - $(TestDiffW) - -index64: index64.log - $(TestDiff) - - diff --git a/roottest/root/tree/index/runDupe.C b/roottest/root/tree/index/runDupe.C index 677a8ea186808..6f93cdba0f79c 100644 --- a/roottest/root/tree/index/runDupe.C +++ b/roottest/root/tree/index/runDupe.C @@ -9,4 +9,6 @@ int runDupe() tree.Fill(); tree.BuildIndex("run", "event"); + + return 0; } \ No newline at end of file diff --git a/roottest/root/tree/index/runchain.C b/roottest/root/tree/index/runchain.C index 7b04029a13b55..bf1a522bdcb42 100644 --- a/roottest/root/tree/index/runchain.C +++ b/roottest/root/tree/index/runchain.C @@ -1,6 +1,7 @@ #include "TFile.h" #include "TChain.h" -#include "Riostream.h" + +#include bool test(TTree*); @@ -32,7 +33,7 @@ int runchain(){ delete chain; return result; - + } bool test(TTree *chain) diff --git a/roottest/root/tree/interpreted/.rootrc b/roottest/root/tree/interpreted/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/tree/interpreted/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/tree/interpreted/CMakeLists.txt b/roottest/root/tree/interpreted/CMakeLists.txt index 227297c2402a2..a3567febc3b57 100644 --- a/roottest/root/tree/interpreted/CMakeLists.txt +++ b/roottest/root/tree/interpreted/CMakeLists.txt @@ -1,7 +1,3 @@ -#------------------------------------------------------------------------------- -# -# Placeholder file to translate the tests to the new CTest system. Meanwhile we -# define a CTest test that calls 'make' in ${CMAKE_CURRENT_SOURCE_DIR} -# -#------------------------------------------------------------------------------- -ROOTTEST_ADD_OLDTEST() +ROOTTEST_ADD_TEST(friends + MACRO macroFriends2.C + OUTREF friends.ref) diff --git a/roottest/root/tree/interpreted/Makefile b/roottest/root/tree/interpreted/Makefile deleted file mode 100644 index 4f9f3ea78a416..0000000000000 --- a/roottest/root/tree/interpreted/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -# This is a template for all makefile. - -#Set the list of files to be delete by clean: -CLEAN_TARGETS += $(ALL_LIBRARIES) - -#Set the list of target to make while testing -TEST_TARGETS += ClassInfoNew - -# adjust the location of Rules.mk as needed. -ifeq ($(strip $(ROOTTEST_HOME)),) - export ROOTTEST_HOME := $(shell git rev-parse --show-toplevel)/roottest/ - ifeq ($(strip $(ROOTTEST_HOME)),) - export ROOTTEST_HOME := $(shell expr $(CURDIR) : '\(.*/roottest/\)') - endif - ifeq ($(strip $(ROOTTEST_HOME)),) - $(error The head of roottest was not found. Set ROOTTEST_HOME) - endif -endif - -include $(ROOTTEST_HOME)/scripts/Rules.mk - - -mytest: - $(CMDECHO) echo mytest > /dev/null - -ClassInfoNew: -ifeq ($(FAIL),) - $(WarnFailTest) - @echo Warning Run the following in valgrind: - @echo Warning "root[] .L macroFriends2.C" - @echo Warning "root[] macroFriends()" - @echo Warning "G__ClassInfo::New would induce an error" -endif - -# Remember that sometest.log can be made automatically from -# from runsometest.C - -testWithDiff: testWithDiff.log - $(TestDiff) - diff --git a/roottest/root/tree/interpreted/friends.ref b/roottest/root/tree/interpreted/friends.ref new file mode 100644 index 0000000000000..9a0168410e73d --- /dev/null +++ b/roottest/root/tree/interpreted/friends.ref @@ -0,0 +1,94 @@ + +Processing macroFriends2.C... +------MyClass::MyClass------ +------MyClass::CreateTrees------ +------MyClass::CreateTrees------ +------MyClass::AddTree------ +------MyClass::AddTree------ +------MyClass::AddTree------ +------MyClass::AddTree------ +------MyClass::AddTree------ +------MyClass::AddTree------ +------MyClass::AddTree------ +------MyClass::AddTree------ +------MyClass::CopyTrees1------ +nfriends(fTree) = 7 +nentries(fTree) = 100 +treej[0] = TreeX0 +treej[1] = TreeX1 +treej[2] = TreeX2 +treej[3] = TreeX3 +treej[4] = TreeY0 +treej[5] = TreeY1 +treej[6] = TreeY2 +treej[7] = TreeY3 +file = TreeZ1.root +alias = TreeX0=TreeX0 +i= 0 j= 0 data= 0.61217 +i= 2 j= 0 data= 0.16907 +alias = TreeX1=TreeX1 +i= 0 j= 1 data= 0.481278 +i= 2 j= 1 data= 0.966759 +alias = TreeX2=TreeX2 +i= 0 j= 2 data= 0.0591071 +i= 2 j= 2 data= 0.308223 +alias = TreeX3=TreeX3 +i= 0 j= 3 data= 0.721412 +i= 2 j= 3 data= 0.660892 +alias = TreeY0=TreeY0 +i= 0 j= 4 data= 0.61217 +i= 2 j= 4 data= 0.16907 +alias = TreeY1=TreeY1 +i= 0 j= 5 data= 0.481278 +i= 2 j= 5 data= 0.966759 +alias = TreeY2=TreeY2 +i= 0 j= 6 data= 0.0591071 +i= 2 j= 6 data= 0.308223 +alias = TreeY3=TreeY3 +i= 0 j= 7 data= 0.721412 +i= 2 j= 7 data= 0.660892 +------MyClass::GetTree------ +fTreeName = TreeX0 +fTreeTitle = trees +nentries(tree) = 50 +nfriends(tree) = 7 +------MyClass::CopyTrees2------ +nfriends(fTree) = 7 +nentries(fTree) = 50 +treej[0] = TreeX0 +treej[1] = TreeX1 +treej[2] = TreeX2 +treej[3] = TreeX3 +treej[4] = TreeY0 +treej[5] = TreeY1 +treej[6] = TreeY2 +treej[7] = TreeY3 +file = TreeZ2.root +tree[0]= TreeX0 +j= 0 x[0]= 0.61217 +j= 0 x[2]= 0.436059 +tree[1]= TreeX1 +j= 1 x[0]= 0.481278 +j= 1 x[2]= 0.416979 +tree[2]= TreeX2 +j= 2 x[0]= 0.0591071 +j= 2 x[2]= 0.207367 +tree[3]= TreeX3 +j= 3 x[0]= 0.721412 +j= 3 x[2]= 0.0777567 +tree[4]= TreeY0 +j= 4 x[0]= 0.61217 +j= 4 x[2]= 0.436059 +tree[5]= TreeY1 +j= 5 x[0]= 0.481278 +j= 5 x[2]= 0.416979 +tree[6]= TreeY2 +j= 6 x[0]= 0.0591071 +j= 6 x[2]= 0.207367 +tree[7]= TreeY3 +j= 7 x[0]= 0.721412 +j= 7 x[2]= 0.0777567 +------MyClass::GetTreeZ------ +nentries(treeZ) = 25 +nfriends(treeZ) = 7 +------MyClass::~MyClass------ diff --git a/roottest/root/tree/interpreted/macroFriends2.C b/roottest/root/tree/interpreted/macroFriends2.C old mode 100755 new mode 100644 index 577b7a2081f6f..e6fddc61cd6ca --- a/roottest/root/tree/interpreted/macroFriends2.C +++ b/roottest/root/tree/interpreted/macroFriends2.C @@ -1,7 +1,7 @@ /////////////////////////// // // in new root session: -// > .x macroFriends.C +// > .x macroFriends.C // /////////////////////////// @@ -14,7 +14,7 @@ #include "TTree.h" #include "TString.h" -#include +#include class MyClass: public TNamed { @@ -24,7 +24,7 @@ class MyClass: public TNamed { TTree *fTree; TTree *fTreeY; TTree *fTreeZ; - + public: MyClass() {} MyClass(const char *name, const char *title = "test"); @@ -60,7 +60,7 @@ class MyData { Double_t GetX() const {return fX;} #if !defined (__CINT__) || defined (__MAKECINT__) - ClassDefOverride(MyData,1) //MyData + ClassDef(MyData,1) //MyData #endif }; @@ -106,7 +106,7 @@ void MyClass::CreateTrees(const char *treename, const char *filename) TTree *tree = 0; TString str = ""; - gRandom->SetSeed(); + gRandom->SetSeed(111); for (Int_t i=0; i<4; i++) { str = treename; str += i; tree = new TTree(str, "trees"); @@ -133,7 +133,7 @@ void MyClass::AddTree(const char *treename, const char *filename) { cout << "------MyClass::AddTree------" << endl; - if (!fFile) fFile = new TFile(filename,"READ"); + if (!fFile) fFile = new TFile(filename,"READ"); if (!fTree) fTree = (TTree*)fFile->Get(treename); else fTree->AddFriend(treename, filename); @@ -317,7 +317,7 @@ void MyClass::GetTreeZ() //______________________________________________________________________________ //______________________________________________________________________________ -void macroFriends() +void macroFriends2() { MyClass *myclass = new MyClass("MyClass"); diff --git a/roottest/root/tree/leaves/.rootrc b/roottest/root/tree/leaves/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/tree/leaves/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/tree/leaves/CMakeLists.txt b/roottest/root/tree/leaves/CMakeLists.txt index 227297c2402a2..f3d16b3b845a5 100644 --- a/roottest/root/tree/leaves/CMakeLists.txt +++ b/roottest/root/tree/leaves/CMakeLists.txt @@ -1,7 +1,8 @@ -#------------------------------------------------------------------------------- -# -# Placeholder file to translate the tests to the new CTest system. Meanwhile we -# define a CTest test that calls 'make' in ${CMAKE_CURRENT_SOURCE_DIR} -# -#------------------------------------------------------------------------------- -ROOTTEST_ADD_OLDTEST() +ROOTTEST_ADD_TEST(arraysize + MACRO runarraysize.C + OUTREF arraysize.ref) + +ROOTTEST_ADD_TEST(ReadMiniObjLeaf + MACRO execReadMiniObjLeaf.C + COPY_TO_BUILDDIR miniObjTree.root + OUTREF execReadMiniObjLeaf.ref) diff --git a/roottest/root/tree/leaves/Makefile b/roottest/root/tree/leaves/Makefile deleted file mode 100644 index dbae1a72365ec..0000000000000 --- a/roottest/root/tree/leaves/Makefile +++ /dev/null @@ -1,73 +0,0 @@ -# This is a template for all makefiles. - -#Set the list of files to be deleted by clean (Targets can also be specified).: -CLEAN_TARGETS += $(ALL_LIBRARIES) *.log *.clog - -# Set the list of target to make while testing. By default, mytest is the -# only target added. If the name of the target is changed in the rules then -# the name should be changed accordingly in this list. - -TEST_TARGETS += arraysize mytest - -# Search for Rules.mk in roottest/scripts -# Algorithm: Find the current working directory and remove everything after -# '*roottest/'. Append the path for Rules.mk from within roottest, which -# should be 'scripts/Rules.mk'. The roottest path is saved in the -# ROOTTEST_HOME variable for use by the SUBDIRECTORIES variable and is -# exported to eliminate the overhead of findding the path again during -# recursive calls of gmake. -# Since all makefiles should be under roottest or one of its -# subdirectories and all recursions of gmake are called by -# 'cd [DIR]; gmake ...' -# this algorithm should not fail in finding /roottest/ in the -# current working directory. -# Issues: This algorithm will fail if a makefile is called from outside the -# roottest folder, as in executing 'gmake -f ~/roottest/Makefile' from -# the home directory. - -ifeq ($(strip $(ROOTTEST_HOME)),) - export ROOTTEST_HOME := $(shell git rev-parse --show-toplevel)/roottest/ - ifeq ($(strip $(ROOTTEST_HOME)),) - export ROOTTEST_HOME := $(shell expr $(CURDIR) : '\(.*/roottest/\)') - endif - ifeq ($(strip $(ROOTTEST_HOME)),) - $(error The head of roottest was not found. Set ROOTTEST_HOME) - endif -endif - -include $(ROOTTEST_HOME)/scripts/Rules.mk - - -# The name of this target should be changed according to the test being run. Any name changes -# should also be reflected in the TEST_TARGETS variable above. - -mytest: - $(CMDECHO) echo mytest > /dev/null - - -# Outputs a message if the FAIL variable is null - -testWithFailure: -ifeq ($(FAIL),) - $(WarnFailTest) -endif - - -# Remember that sometest.log can be made automatically from -# from runsometest.C -# This target attempts to create a log file (which should be the output of running the test), and -# compares its output with a prebuilt reference file. The reference file should be copied from -# the log files produced during what is considered a successful run of the test. The testWithDiff -# files should be renamed according to the test being run. -# By default the TestDiff variable is set to compare the .log and .ref files -# To run a diff and ignore whitespacing use $(TestDiffW) - -testWithDiff: testWithDiff.log testWithDiff.ref - $(TestDiff) - -ifneq ($(ClingWorkAroundMissingAutoLoading),) -execReadMiniObjLeaf.log: CALLROOTEXE += -e 'gSystem->Load("libTreePlayer");' -endif - -arraysize: arraysize.log - $(TestDiff) diff --git a/roottest/root/tree/leaves/execReadMiniObjLeaf.C b/roottest/root/tree/leaves/execReadMiniObjLeaf.C index e1fe5d85d5015..9a42c6a03e88b 100644 --- a/roottest/root/tree/leaves/execReadMiniObjLeaf.C +++ b/roottest/root/tree/leaves/execReadMiniObjLeaf.C @@ -12,12 +12,12 @@ void execReadMiniObjLeaf() { TFile f("miniObjTree.root"); TTree* t=(TTree*)f.Get("miniObjTree"); - - + + TLeaf* l_v=t->FindLeaf("v"); TLeaf* l_x=t->FindLeaf("x"); if(!l_v || ! l_x){ - cout << "No leaf" << endl; + std::cout << "No leaf" << std::endl; exit(1); } l_v->GetBranch()->GetEntry(0); // Make sure the address are set @@ -27,8 +27,9 @@ void execReadMiniObjLeaf() for(int i=0; i<2 /* t->GetEntries() */; ++i){ // cout << l_v->GetBranch()->GetEntry(i) << " bytes read from l_v" << endl; // cout << l_x->GetBranch()->GetEntry(i) << " bytes read from l_x" << endl; - for(int j=0; j<10; ++j) cout << "l_v value " << j << "=" << l_v->GetValue(j) << endl; + for(int j=0; j<10; ++j) + std::cout << "l_v value " << j << "=" << l_v->GetValue(j) << std::endl; // for(int j=0; j<10; ++j) cout << "l_v value " << j << "=" << v->at(j) << endl; - cout << "l_x value=" << l_x->GetValue() << endl; + std::cout << "l_x value=" << l_x->GetValue() << std::endl; } } diff --git a/roottest/root/tree/pointers/.rootrc b/roottest/root/tree/pointers/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/tree/pointers/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/tree/pointers/CMakeLists.txt b/roottest/root/tree/pointers/CMakeLists.txt new file mode 100644 index 0000000000000..9307d8ee124fe --- /dev/null +++ b/roottest/root/tree/pointers/CMakeLists.txt @@ -0,0 +1,3 @@ +ROOTTEST_ADD_TEST(verify + MACRO verify.cxx+ + OUTREF verify.ref) diff --git a/roottest/root/tree/pointers/myclass.cxx b/roottest/root/tree/pointers/myclass.cxx deleted file mode 100644 index 05ffbe4b6c437..0000000000000 --- a/roottest/root/tree/pointers/myclass.cxx +++ /dev/null @@ -1,9 +0,0 @@ -#include "myclass.h" - -void verify() { - myclass *m = new myclass(); - m->verify(); - m->set(); - m->verify(); - delete m; -} diff --git a/roottest/root/tree/pointers/myclass.h b/roottest/root/tree/pointers/myclass.h index 0e01c7e25ffc3..9482ad191e5bb 100644 --- a/roottest/root/tree/pointers/myclass.h +++ b/roottest/root/tree/pointers/myclass.h @@ -1,3 +1,6 @@ +#ifndef myclass_h +#define myclass_h + #include "TObject.h" class wrapper; @@ -10,12 +13,12 @@ class myclass { myclass() : myself(this),indirect(0),fValue(0) {} virtual ~myclass() {} - + void set(); void verify(); - ClassDefOverride(myclass,1); + ClassDef(myclass,1); }; class wrapper { @@ -26,7 +29,7 @@ class wrapper { wrapper(myclass *p = 0) : fParent(p),fIndex(0) {} virtual ~wrapper() {} - ClassDefOverride(wrapper,1); + ClassDef(wrapper,1); }; inline void myclass::set() { @@ -50,64 +53,4 @@ inline void myclass::verify() { } } -#include "TFile.h" -#include "TTree.h" - -const char *defname = "myclass.root"; - -void write(const char *filename = defname) -{ - TFile f(filename,"RECREATE"); - myclass *m = new myclass(); - m->set(); - - f.WriteObject(m,"obj"); - - TTree *tree = new TTree("T","T"); - // tree->Branch("split_1.","myclass",&m,32000,-1); - tree->Branch("split0.","myclass",&m,32000,0); - tree->Branch("split1.",&m,32000,1); - tree->Branch("split99.",&m,32000,99); - - tree->Fill(); - tree->Write(); - - f.Close(); -} - -void readobj(TTree *tree, const char *where) -{ - myclass *m = 0; - tree->SetBranchAddress(where,&m); - tree->GetEntry(0); - if (!m) { - fprintf(stdout,"reading failed in %s\n",where); - } else { - fprintf(stdout,"Verifying %s\n",where); - m->verify(); - } - tree->ResetBranchAddresses(); -} - -void read(const char *filename = defname) -{ - TFile f(filename,"READ"); - myclass *m; - f.GetObject("obj",m); - m->verify(); - - TTree *tree; - f.GetObject("T",tree); - tree->Print(); - - readobj(tree,"split0."); - readobj(tree,"split1."); - readobj(tree,"split99."); -} - - - - - - - +#endif diff --git a/roottest/root/tree/pointers/verify.cxx b/roottest/root/tree/pointers/verify.cxx new file mode 100644 index 0000000000000..24353c9972890 --- /dev/null +++ b/roottest/root/tree/pointers/verify.cxx @@ -0,0 +1,87 @@ +#include "myclass.h" + +// required when macro compiled on Windows to correctly generate dictionary entries +#ifdef __ROOTCLING__ +#pragma link C++ class myclass+; +#pragma link C++ class wrapper+; +#endif + + +#include "TFile.h" +#include "TTree.h" + +const char *defname = "myclass.root"; + +void write(const char *filename = defname) +{ + TFile f(filename,"RECREATE"); + // avoid compression variation on different platforms + f.SetCompressionLevel(0); + myclass *m = new myclass(); + m->set(); + + f.WriteObject(m,"obj"); + + TTree *tree = new TTree("T","T"); + // tree->Branch("split_1.","myclass",&m,32000,-1); + tree->Branch("split0.","myclass",&m,32000,0); + tree->Branch("split1.",&m,32000,1); + tree->Branch("split99.",&m,32000,99); + + tree->Fill(); + tree->Write(); + + f.Close(); +} + +void readobj(TTree *tree, const char *where) +{ + myclass *m = 0; + tree->SetBranchAddress(where,&m); + tree->GetEntry(0); + if (!m) { + fprintf(stdout,"reading failed in %s\n",where); + } else { + fprintf(stdout,"Verifying %s\n",where); + m->verify(); + } + tree->ResetBranchAddresses(); +} + +void read(const char *filename = defname) +{ + TFile f(filename,"READ"); + myclass *m; + f.GetObject("obj",m); + m->verify(); + + TTree *tree; + f.GetObject("T",tree); + tree->Print(); + + readobj(tree,"split0."); + readobj(tree,"split1."); + readobj(tree,"split99."); +} + +void verify_myclass() +{ + myclass *m = new myclass(); + m->verify(); + m->set(); + m->verify(); + delete m; +} + +int verify() +{ + + verify_myclass(); + + write(); + + read(); + + return 0; +} + diff --git a/roottest/root/tree/pointers/verify.ref b/roottest/root/tree/pointers/verify.ref new file mode 100644 index 0000000000000..ebe212c45fbcf --- /dev/null +++ b/roottest/root/tree/pointers/verify.ref @@ -0,0 +1,47 @@ + +Processing verify.cxx+... +Info in : creating shared library /home/linev/build/webgui/roottest/root/tree/pointers/verify_cxx.so +The indirect pointer is still null +****************************************************************************** +*Tree :T : T * +*Entries : 1 : Total = 6143 bytes File Size = 6199 * +* : : Tree compression factor = 1.00 * +****************************************************************************** +*Br 0 :split0. : myclass * +*Entries : 1 : Total Size= 618 bytes File Size = 121 * +*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.00 * +*............................................................................* +*Branch :split1. * +*Entries : 1 : BranchElement (see below) * +*............................................................................* +*Br 1 :split1.myself : myclass* * +*Entries : 1 : Total Size= 614 bytes File Size = 93 * +*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.00 * +*............................................................................* +*Br 2 :split1.indirect : wrapper* * +*Entries : 1 : Total Size= 650 bytes File Size = 121 * +*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.00 * +*............................................................................* +*Br 3 :split1.fValue : Int_t * +*Entries : 1 : Total Size= 602 bytes File Size = 81 * +*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.00 * +*............................................................................* +*Branch :split99. * +*Entries : 1 : BranchElement (see below) * +*............................................................................* +*Br 4 :split99.myself : myclass* * +*Entries : 1 : Total Size= 619 bytes File Size = 94 * +*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.00 * +*............................................................................* +*Br 5 :split99.indirect : wrapper* * +*Entries : 1 : Total Size= 655 bytes File Size = 122 * +*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.00 * +*............................................................................* +*Br 6 :split99.fValue : Int_t * +*Entries : 1 : Total Size= 607 bytes File Size = 82 * +*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.00 * +*............................................................................* +Verifying split0. +Verifying split1. +Verifying split99. +(int) 0 diff --git a/roottest/root/tree/query/.rootrc b/roottest/root/tree/query/.rootrc deleted file mode 100644 index 6ebe75fd4ec5a..0000000000000 --- a/roottest/root/tree/query/.rootrc +++ /dev/null @@ -1 +0,0 @@ -Rint.History: .root_hist diff --git a/roottest/root/tree/query/CMakeLists.txt b/roottest/root/tree/query/CMakeLists.txt index 227297c2402a2..42d67f184bcaf 100644 --- a/roottest/root/tree/query/CMakeLists.txt +++ b/roottest/root/tree/query/CMakeLists.txt @@ -1,7 +1,7 @@ -#------------------------------------------------------------------------------- -# -# Placeholder file to translate the tests to the new CTest system. Meanwhile we -# define a CTest test that calls 'make' in ${CMAKE_CURRENT_SOURCE_DIR} -# -#------------------------------------------------------------------------------- -ROOTTEST_ADD_OLDTEST() +ROOTTEST_ADD_TEST(array + MACRO runarray.C + OUTREF array.ref) + +ROOTTEST_ADD_TEST(Query + MACRO execQuery.C + OUTREF execQuery.ref) diff --git a/roottest/root/tree/query/Makefile b/roottest/root/tree/query/Makefile deleted file mode 100644 index 7f4113e57a557..0000000000000 --- a/roottest/root/tree/query/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -# This is a template for all makefiles. - -#Set the list of files to be deleted by clean (Targets can also be specified).: -CLEAN_TARGETS += $(ALL_LIBRARIES) *.log *.clog - -# Set the list of target to make while testing. By default, mytest is the -# only target added. If the name of the target is changed in the rules then -# the name should be changed accordingly in this list. - -TEST_TARGETS += array mytest - -# Search for Rules.mk in roottest/scripts -# Algorithm: Find the current working directory and remove everything after -# '*roottest/'. Append the path for Rules.mk from within roottest, which -# should be 'scripts/Rules.mk'. The roottest path is saved in the -# ROOTTEST_HOME variable for use by the SUBDIRECTORIES variable and is -# exported to eliminate the overhead of findding the path again during -# recursive calls of gmake. -# Since all makefiles should be under roottest or one of its -# subdirectories and all recursions of gmake are called by -# 'cd [DIR]; gmake ...' -# this algorithm should not fail in finding /roottest/ in the -# current working directory. -# Issues: This algorithm will fail if a makefile is called from outside the -# roottest folder, as in executing 'gmake -f ~/roottest/Makefile' from -# the home directory. - -ifeq ($(strip $(ROOTTEST_HOME)),) - export ROOTTEST_HOME := $(shell git rev-parse --show-toplevel)/roottest/ - ifeq ($(strip $(ROOTTEST_HOME)),) - export ROOTTEST_HOME := $(shell expr $(CURDIR) : '\(.*/roottest/\)') - endif - ifeq ($(strip $(ROOTTEST_HOME)),) - $(error The head of roottest was not found. Set ROOTTEST_HOME) - endif -endif - -include $(ROOTTEST_HOME)/scripts/Rules.mk - - -# The name of this target should be changed according to the test being run. Any name changes -# should also be reflected in the TEST_TARGETS variable above. - -mytest: - $(CMDECHO) echo mytest > /dev/null - - -# Outputs a message if the FAIL variable is null - -testWithFailure: -ifeq ($(FAIL),) - $(WarnFailTest) -endif - - -# Remember that sometest.log can be made automatically from -# from runsometest.C -# This target attempts to create a log file (which should be the output of running the test), and -# compares its output with a prebuilt reference file. The reference file should be copied from -# the log files produced during what is considered a successful run of the test. The testWithDiff -# files should be renamed according to the test being run. -# By default the TestDiff variable is set to compare the .log and .ref files -# To run a diff and ignore whitespacing use $(TestDiffW) - -testWithDiff: testWithDiff.log testWithDiff.ref - $(TestDiff) - -execQuery.success: EXTRA_DIFFOPTS += -w - -array: array.log - $(TestDiff)