diff --git a/roottest/.gitignore b/roottest/.gitignore index 00546edbf345d..655c0d903984e 100644 --- a/roottest/.gitignore +++ b/roottest/.gitignore @@ -488,18 +488,6 @@ AutoDict_*.cxx /root/io/newdelete/3-* /root/io/newdelete/ClassesDict.* -# /root/io/newstl/ -/root/io/newstl/AutoDict* -/root/io/newstl/pospelov -/root/io/newstl/latest -/root/io/newstl/3-* -/root/io/newstl/4-* -/root/io/newstl/5-* -/root/io/newstl/6-* -/root/io/newstl/7-* -/root/io/newstl/*.root -/root/io/newstl/ArchivedDataFiles - # /root/io/perf/ /root/io/perf/*.root diff --git a/roottest/root/io/newstl/6-32-19/Readme.md b/roottest/root/io/newstl/6-32-19/Readme.md new file mode 100644 index 0000000000000..a2175683e97d3 --- /dev/null +++ b/roottest/root/io/newstl/6-32-19/Readme.md @@ -0,0 +1,14 @@ +# Test files created with ROOT 6-32-19 + +After running + + ctest -R roottest-root-io-newstl + +several root files are created in roottest/root/io/newstl directory + +With every new ROOT version one can commit such files into repository +and add corresponding reading entry into cmake files. + +One should add files only from previous ROOT versions - otherwise +log reference files will differ + diff --git a/roottest/root/io/newstl/6-32-19/deque.root b/roottest/root/io/newstl/6-32-19/deque.root new file mode 100644 index 0000000000000..8cafe03aa31b0 Binary files /dev/null and b/roottest/root/io/newstl/6-32-19/deque.root differ diff --git a/roottest/root/io/newstl/6-32-19/list.root b/roottest/root/io/newstl/6-32-19/list.root new file mode 100644 index 0000000000000..d57e40d99f3ca Binary files /dev/null and b/roottest/root/io/newstl/6-32-19/list.root differ diff --git a/roottest/root/io/newstl/6-32-19/map.root b/roottest/root/io/newstl/6-32-19/map.root new file mode 100644 index 0000000000000..255861ba3125b Binary files /dev/null and b/roottest/root/io/newstl/6-32-19/map.root differ diff --git a/roottest/root/io/newstl/6-32-19/multimap.root b/roottest/root/io/newstl/6-32-19/multimap.root new file mode 100644 index 0000000000000..374669ba260bc Binary files /dev/null and b/roottest/root/io/newstl/6-32-19/multimap.root differ diff --git a/roottest/root/io/newstl/6-32-19/multiset.root b/roottest/root/io/newstl/6-32-19/multiset.root new file mode 100644 index 0000000000000..57ac073af3704 Binary files /dev/null and b/roottest/root/io/newstl/6-32-19/multiset.root differ diff --git a/roottest/root/io/newstl/6-32-19/rvec.root b/roottest/root/io/newstl/6-32-19/rvec.root new file mode 100644 index 0000000000000..5be8277827d90 Binary files /dev/null and b/roottest/root/io/newstl/6-32-19/rvec.root differ diff --git a/roottest/root/io/newstl/6-32-19/set.root b/roottest/root/io/newstl/6-32-19/set.root new file mode 100644 index 0000000000000..65527d4e4d688 Binary files /dev/null and b/roottest/root/io/newstl/6-32-19/set.root differ diff --git a/roottest/root/io/newstl/6-32-19/vector.root b/roottest/root/io/newstl/6-32-19/vector.root new file mode 100644 index 0000000000000..56265a69d9db6 Binary files /dev/null and b/roottest/root/io/newstl/6-32-19/vector.root differ diff --git a/roottest/root/io/newstl/CMakeLists.txt b/roottest/root/io/newstl/CMakeLists.txt index 7b95839fb5086..d5567e2aeeb1a 100644 --- a/roottest/root/io/newstl/CMakeLists.txt +++ b/roottest/root/io/newstl/CMakeLists.txt @@ -17,19 +17,19 @@ foreach(index RANGE 7) FIXTURES_SETUP root-io-newstl-test-fixture) endforeach() -if(APPLE OR MSVC) - set(_srun_ref stlIoTestMac.ref) -else() - set(_srun_ref stlIoTest.ref) -endif() - ROOTTEST_ADD_TEST(run MACRO srun.C MACROARG "\"${CMAKE_CURRENT_SOURCE_DIR}/\"" - OUTREF ${_srun_ref} + OUTREF stlIoTest.ref FIXTURES_REQUIRED root-io-newstl-test-fixture FIXTURES_SETUP root-io-newstl-run-fixture) +ROOTTEST_ADD_TEST(read-6-32-19 + MACRO srun.C + MACROARG "\"${CMAKE_CURRENT_SOURCE_DIR}/\", \"${CMAKE_CURRENT_SOURCE_DIR}/6-32-19/\"" + OUTREF stlIoRead.ref + FIXTURES_REQUIRED root-io-newstl-test-fixture) + # failing tests, crashes ROOT, was disabled in Makefile ROOTTEST_ADD_TEST(nolib MACRO readNoLib.C diff --git a/roottest/root/io/newstl/TestHelpers.C b/roottest/root/io/newstl/TestHelpers.C index 398b7a6b7d37e..96d211a69ec22 100644 --- a/roottest/root/io/newstl/TestHelpers.C +++ b/roottest/root/io/newstl/TestHelpers.C @@ -1,72 +1,6 @@ #include "TestHelpers.h" #include "TestOutput.h" -#include "TSystem.h" -#include "TList.h" -#include "TRegexp.h" -#include "TObjString.h" -#include -void fillListOfDir(const TString &directory, TList &l) { - - void *dir = gSystem->OpenDirectory(directory); - - const char *file = 0; - if (dir) { - - //create a TList to store the file names (not yet sorted) - TString basename = ".-..-.."; - TRegexp re(basename,kFALSE); - - while ((file = gSystem->GetDirEntry(dir))) { - if (!strcmp(file,".") || !strcmp(file,"..")) continue; - // Skip 'latest' as it is a symlink - if (strcmp(file,"latest")==0) continue; - - TString s = file; - if ( (basename!=file) && s.Index(re) == kNPOS) continue; - - TString dirname = file; - if (directory != ".") { - auto _dirname = gSystem->ConcatFileName(directory, file); - dirname = _dirname; - delete [] _dirname; - } - - auto _vfile = gSystem->ConcatFileName(dirname, "vector.root"); - TString vfile = _vfile; - delete [] _vfile; - - if (gSystem->GetPathInfo(vfile,(Long_t*)0,(Long_t*)0,(Long_t*)0,0)==0) { - l.Add(new TObjString(dirname)); - } else { -// cout << "did not find vector in " << file << endl; - } - - } - gSystem->FreeDirectory(dir); - - } -} - -void fillListOfDir(TList &l) { - fillListOfDir(".", l); - fillListOfDir("ArchivedDataFiles", l); - const char *otherdir = gSystem->Getenv("ROOT_NEWSTL_DATAFILE_DIR"); - if (otherdir && otherdir[0]) - fillListOfDir(otherdir, l); - - // Sort the files in alphanumeric order - l.Sort(); - - if (gDebug > 3) { - TIter next(&l); - TObjString *obj; - while ((obj = (TObjString*)next())) { - const char *file = obj->GetName(); - cout << "found the directory " << file << endl; - } - } -} #ifdef __MAKECINT__ #pragma link C++ function DebugTest; diff --git a/roottest/root/io/newstl/TestHelpers.h b/roottest/root/io/newstl/TestHelpers.h index 5d2beb9dd729f..b3611f4b36ac0 100644 --- a/roottest/root/io/newstl/TestHelpers.h +++ b/roottest/root/io/newstl/TestHelpers.h @@ -72,7 +72,7 @@ class HelperDerived : public HelperClassDef { HelperDerived() : f(-1) {}; explicit HelperDerived(int v,double d, float finput) : HelperClassDef(v,d),f(finput) {}; - virtual bool IsEquiv(const Helper &rhs) const { + bool IsEquiv(const Helper &rhs) const override { bool result = Helper::IsEquiv(rhs); if (result) { const HelperDerived *drhs = dynamic_cast(&rhs); @@ -82,7 +82,7 @@ class HelperDerived : public HelperClassDef { return result; } - virtual const char* CompMsg(const Helper& copy) const { + const char* CompMsg(const Helper& copy) const override { const HelperDerived *drhs = dynamic_cast(©); if (drhs==0) { TString msg = Helper::CompMsg(copy); @@ -99,7 +99,7 @@ class THelper : public Helper, public TObject { public: THelper() {}; explicit THelper(int v,double d) : Helper(v,d) {}; - virtual const char* CompMsg(const Helper& icopy) const { + const char* CompMsg(const Helper& icopy) const override { const THelper *copy = dynamic_cast(&icopy); if (copy==0) return "Wrong type (expected THelper)\n"; return Form("THelper object wrote %d %g and read %d %g\n",val,dval,copy->val,copy->dval); @@ -113,7 +113,7 @@ class THelperDerived : public THelper { THelperDerived() : f(-1) {}; explicit THelperDerived(int v,double d, float finput) : THelper(v,d),f(finput) {}; - virtual bool IsEquiv(const Helper &rhs) const { + bool IsEquiv(const Helper &rhs) const override { bool result = Helper::IsEquiv(rhs); if (result) { const THelperDerived *drhs = dynamic_cast(&rhs); @@ -123,7 +123,7 @@ class THelperDerived : public THelper { return true; } - virtual const char* CompMsg(const Helper& copy) const { + const char* CompMsg(const Helper& copy) const override { const THelperDerived *drhs = dynamic_cast(©); if (drhs==0) { TString msg = THelper::CompMsg(copy); @@ -161,6 +161,5 @@ template class PtrCmp { }; class TList; -void fillListOfDir(TList &l); #endif // TEST__HELPER diff --git a/roottest/root/io/newstl/dtest.C b/roottest/root/io/newstl/dtest.C index f708663457a01..a5f4ca2f51e58 100644 --- a/roottest/root/io/newstl/dtest.C +++ b/roottest/root/io/newstl/dtest.C @@ -1,12 +1,17 @@ #include "dequeHolder.h" #include "test.C" -void dtest(bool readother=false) { +void dtest(const char *dirname = "") { const char* testname = "deque"; typedef dequeHolder holder; - std::cout << "Running test " << testname << std::endl; - checkHolder(testname); - write(testname); - read(testname,0,readother); + if (dirname && *dirname) { + std::cout << "Running reading test " << testname << std::endl; + read(dirname, testname); + } else { + std::cout << "Running test " << testname << std::endl; + checkHolder(testname); + write(testname); + read("", testname); + } } diff --git a/roottest/root/io/newstl/ltest.C b/roottest/root/io/newstl/ltest.C index 4eec74263cf58..88a3eb7a798bb 100644 --- a/roottest/root/io/newstl/ltest.C +++ b/roottest/root/io/newstl/ltest.C @@ -1,12 +1,17 @@ #include "listHolder.h" #include "test.C" -void ltest(bool readother=false) { +void ltest(const char *dirname = "") { const char* testname = "list"; typedef listHolder holder; - std::cout << "Running test " << testname << std::endl; - checkHolder(testname); - write(testname); - read(testname,0,readother); + if (dirname && *dirname) { + std::cout << "Running reading test " << testname << std::endl; + read(dirname, testname); + } else { + std::cout << "Running test " << testname << std::endl; + checkHolder(testname); + write(testname); + read("", testname); + } } diff --git a/roottest/root/io/newstl/mtest.C b/roottest/root/io/newstl/mtest.C index e663d4878859f..96e1a79d41c53 100644 --- a/roottest/root/io/newstl/mtest.C +++ b/roottest/root/io/newstl/mtest.C @@ -1,21 +1,17 @@ #include "mapHolder.h" #include "test.C" -void mtest(bool readother=false) { +void mtest(const char *dirname = "") { const char* testname = "map"; typedef mapHolder holder; - std::cout << "Running test " << testname << std::endl; - checkHolder(testname); - write(testname); - read(testname,0,readother); -} - -void mtest_readonly(bool readother=false) -{ - const char* testname = "map"; - typedef mapHolder holder; - - std::cout << "Running read test " << testname << std::endl; - read(testname,0,readother); + if (dirname && *dirname) { + std::cout << "Running reading test " << testname << std::endl; + read(dirname, testname); + } else { + std::cout << "Running test " << testname << std::endl; + checkHolder(testname); + write(testname); + read("", testname); + } } diff --git a/roottest/root/io/newstl/ntest.C b/roottest/root/io/newstl/ntest.C index 6d330c3d62201..56d1dea4aa80b 100644 --- a/roottest/root/io/newstl/ntest.C +++ b/roottest/root/io/newstl/ntest.C @@ -1,12 +1,17 @@ #include "multimapHolder.h" #include "test.C" -void ntest(bool readother=false) { +void ntest(const char *dirname = "") { const char* testname = "multimap"; typedef multimapHolder holder; - std::cout << "Running test " << testname << std::endl; - checkHolder(testname); - write(testname); - read(testname,0,readother); + if (dirname && *dirname) { + std::cout << "Running reading test " << testname << std::endl; + read(dirname, testname); + } else { + std::cout << "Running test " << testname << std::endl; + checkHolder(testname); + write(testname); + read("", testname); + } } diff --git a/roottest/root/io/newstl/rtest.C b/roottest/root/io/newstl/rtest.C index 4add96f307064..796b31be25125 100644 --- a/roottest/root/io/newstl/rtest.C +++ b/roottest/root/io/newstl/rtest.C @@ -1,19 +1,18 @@ #include "rvecHolder.h" #include "test.C" -void rtest(bool readother=false) { +void rtest(const char *dirname = "") { const char* testname = "rvec"; typedef rvecHolder holder; - std::cout << "Running test " << testname << std::endl; - checkHolder(testname); - write(testname); - read(testname,0,readother); + if (dirname && *dirname) { + std::cout << "Running reading test " << testname << std::endl; + read(dirname, testname); + } else { + std::cout << "Running test " << testname << std::endl; + checkHolder(testname); + write(testname); + read("", testname); + } } -void rreadtest(const char*dirname, int nEntry = 0) { - const char* testname = "rvec"; - typedef rvecHolder holder; - - read(dirname, testname, nEntry, true); -} diff --git a/roottest/root/io/newstl/run.C b/roottest/root/io/newstl/run.C deleted file mode 100644 index 4cfcd42dd7c2c..0000000000000 --- a/roottest/root/io/newstl/run.C +++ /dev/null @@ -1,44 +0,0 @@ -// void run(Int_t opt=0) { -{ - if (opt/16 & 3 ) { - gROOT->ProcessLine(".! gmake -j3"); - } else if (opt/16 & 2 ) { - gROOT->ProcessLine(".! gmake -j3 deque"); - } else if (opt/16 & 1 ) { - gROOT->ProcessLine(".! gmake -j3 vector"); - } - - if (pass) { - gSystem->Unload("TestHelpers_C.so"); - pass = 0; - } - - int result = gSystem->CompileMacro("TestHelpers.C","k"); - if (result != 0 && result != 1) return; - - if ( opt%16 & 2 ) { - - result = gSystem->CompileMacro("vectorHolder.C","k"); - if (result != 0 && result != 1) return; - - result = gSystem->CompileMacro("vtest.C","k"); - if (result != 0 && result != 1) return; - - if (opt/16) vtest(); - - } - - if ( opt%16 & 2 ) { - - result = gSystem->CompileMacro("dequeHolder.C","k"); - if (result != 0 && result != 1) return; - - result = gSystem->CompileMacro("dtest.C","k"); - if (result != 0 && result != 1) return; - - if (opt/16) dtest(); - - } - - pass++; -} diff --git a/roottest/root/io/newstl/srun.C b/roottest/root/io/newstl/srun.C index 21ab0565e0f28..1cf026acb770e 100644 --- a/roottest/root/io/newstl/srun.C +++ b/roottest/root/io/newstl/srun.C @@ -10,7 +10,7 @@ enum EWhich { kEnd = 256 }; -void srun(const TString &srcpath = "", int which = kEnd - 1, int exec = 2) { +void srun(const TString &srcpath = "", const TString &readpath = "", int which = kEnd - 1) { // use current directory as build directory gSystem->SetBuildDir(gSystem->pwd(), true); @@ -18,7 +18,7 @@ void srun(const TString &srcpath = "", int which = kEnd - 1, int exec = 2) { int result = gSystem->CompileMacro(srcpath + "TestHelpers.C","k"); if (result != 0 && result != 1) return; - TString arg = exec > 1 ? "(true)" : "(false)"; + TString arg = "(\"" + readpath + "\")"; if ( which & kRVec ) { @@ -28,7 +28,7 @@ void srun(const TString &srcpath = "", int which = kEnd - 1, int exec = 2) { result = gSystem->CompileMacro(srcpath + "rtest.C","k"); if (result != 0 && result != 1) return; - if (exec) gROOT->ProcessLine("rtest" + arg); + gROOT->ProcessLine("rtest" + arg); } @@ -40,7 +40,7 @@ void srun(const TString &srcpath = "", int which = kEnd - 1, int exec = 2) { result = gSystem->CompileMacro(srcpath + "vtest.C","k"); if (result != 0 && result != 1) return; - if (exec) gROOT->ProcessLine("vtest" + arg); + gROOT->ProcessLine("vtest" + arg); } @@ -52,7 +52,7 @@ void srun(const TString &srcpath = "", int which = kEnd - 1, int exec = 2) { result = gSystem->CompileMacro(srcpath + "dtest.C","k"); if (result != 0 && result != 1) return; - if (exec) gROOT->ProcessLine("dtest" + arg); + gROOT->ProcessLine("dtest" + arg); } @@ -64,7 +64,7 @@ void srun(const TString &srcpath = "", int which = kEnd - 1, int exec = 2) { result = gSystem->CompileMacro(srcpath + "ltest.C","k"); if (result != 0 && result != 1) return; - if (exec) gROOT->ProcessLine("ltest" + arg); + gROOT->ProcessLine("ltest" + arg); } @@ -76,7 +76,7 @@ void srun(const TString &srcpath = "", int which = kEnd - 1, int exec = 2) { result = gSystem->CompileMacro(srcpath + "stest.C","k"); if (result != 0 && result != 1) return; - if (exec) gROOT->ProcessLine("stest" + arg); + gROOT->ProcessLine("stest" + arg); } @@ -88,7 +88,7 @@ void srun(const TString &srcpath = "", int which = kEnd - 1, int exec = 2) { result = gSystem->CompileMacro(srcpath + "ttest.C","k"); if (result != 0 && result != 1) return; - if (exec) gROOT->ProcessLine("ttest" + arg); + gROOT->ProcessLine("ttest" + arg); } @@ -100,7 +100,7 @@ void srun(const TString &srcpath = "", int which = kEnd - 1, int exec = 2) { result = gSystem->CompileMacro(srcpath + "mtest.C","k"); if (result != 0 && result != 1) return; - if (exec) gROOT->ProcessLine("mtest" + arg); + gROOT->ProcessLine("mtest" + arg); } @@ -112,7 +112,7 @@ void srun(const TString &srcpath = "", int which = kEnd - 1, int exec = 2) { result = gSystem->CompileMacro(srcpath + "ntest.C","k"); if (result != 0 && result != 1) return; - if (exec) gROOT->ProcessLine("ntest" + arg); + gROOT->ProcessLine("ntest" + arg); } diff --git a/roottest/root/io/newstl/stest.C b/roottest/root/io/newstl/stest.C index e5fa92ec1d736..95aac2657c05e 100644 --- a/roottest/root/io/newstl/stest.C +++ b/roottest/root/io/newstl/stest.C @@ -1,12 +1,17 @@ #include "setHolder.h" #include "test.C" -void stest(bool readother=false) { +void stest(const char *dirname = "") { const char* testname = "set"; typedef setHolder holder; - std::cout << "Running test " << testname << std::endl; - checkHolder(testname); - write(testname); - read(testname,0,readother); + if (dirname && *dirname) { + std::cout << "Running reading test " << testname << std::endl; + read(dirname, testname); + } else { + std::cout << "Running test " << testname << std::endl; + checkHolder(testname); + write(testname); + read("", testname); + } } diff --git a/roottest/root/io/newstl/stlIoRead.ref b/roottest/root/io/newstl/stlIoRead.ref new file mode 100644 index 0000000000000..991ae4542a366 --- /dev/null +++ b/roottest/root/io/newstl/stlIoRead.ref @@ -0,0 +1,10 @@ + +Processing srun.C("roottest/root/io/newstl/", "roottest/root/io/newstl/6-32-19/")... +Running reading test rvec +Running reading test vector +Running reading test deque +Running reading test list +Running reading test set +Running reading test multiset +Running reading test map +Running reading test multimap diff --git a/roottest/root/io/newstl/stlIoTest.ref b/roottest/root/io/newstl/stlIoTest.ref index 9f9b92c920f53..9e56ff864c40b 100644 --- a/roottest/root/io/newstl/stlIoTest.ref +++ b/roottest/root/io/newstl/stlIoTest.ref @@ -1,7 +1,6 @@ Processing srun.C("roottest/root/io/newstl/")... Running test rvec -ROOT does not support variable size array of stl containers Running test vector Running test deque Running test list diff --git a/roottest/root/io/newstl/stlIoTestMac.ref b/roottest/root/io/newstl/stlIoTestMac.ref deleted file mode 100644 index f27bf5e039499..0000000000000 --- a/roottest/root/io/newstl/stlIoTestMac.ref +++ /dev/null @@ -1,18 +0,0 @@ - -Processing srun.C("roottest/root/io/newstl/")... -Running test rvec -ROOT does not support variable size array of stl containers -Running test vector -ROOT does not support variable size array of stl containers -Running test deque -ROOT does not support variable size array of stl containers -Running test list -ROOT does not support variable size array of stl containers -Running test set -ROOT does not support variable size array of stl containers -Running test multiset -ROOT does not support variable size array of stl containers -Running test map -ROOT does not support variable size array of stl containers -Running test multimap -ROOT does not support variable size array of stl containers diff --git a/roottest/root/io/newstl/test.C b/roottest/root/io/newstl/test.C index 8eee98c6edd9c..31c5a9d7c4458 100644 --- a/roottest/root/io/newstl/test.C +++ b/roottest/root/io/newstl/test.C @@ -23,21 +23,10 @@ template Bool_t checkHolder(const char *testname = "") { template void write(const char *testname, int nEntry = 3) { bool testingTopLevelVectors = true; - TString dirname = gROOT->GetVersion(); - dirname.ReplaceAll(".","-"); - dirname.ReplaceAll("/","-"); - - gSystem->mkdir(dirname); - // do not create symlink - //gSystem->Unlink("latest"); - //gSystem->Symlink(dirname,"latest"); - - auto _filename = gSystem->ConcatFileName(dirname, testname ); - TString filename = _filename; - delete [] _filename; + TString filename = testname; filename += ".root"; - TFile *file = new TFile(filename,"RECREATE","stl test file",0); + auto file = new TFile(filename,"RECREATE", "stl test file", 0); HolderClass *holder = new HolderClass( 0 ); @@ -100,8 +89,8 @@ template void write(const char *testname, int nEntry = 3) { template bool verifyBranch(const char *testname, TTree *chain, const char *bname, int type = 0) { static HolderClass *gHolder = new HolderClass; - HolderClass **add = 0; - HolderClass *holder = 0; + HolderClass **add = nullptr; + HolderClass *holder = nullptr; TBranch *branch = chain->GetBranch(bname); if (branch==0) { @@ -145,27 +134,25 @@ template bool verifyBranch(const char *testname, TTree *chai } } -template bool read(const char *dirname, const char *testname, int nEntry, bool current) { - HolderClass *holder = 0; +// read file from specified directory + +template bool read(const char *dirname, const char *testname, int nEntry = 0) { + HolderClass *holder = nullptr; bool result = true; bool testingTopLevelVectors = true; + TString filename = dirname; + filename.Append(testname); + filename.Append(".root"); - auto _filename = gSystem->ConcatFileName(dirname, testname ); - TString filename = _filename; - filename += ".root"; - delete [] _filename; - - if (!current && gSystem->AccessPathName(filename, kFileExists)) { - // when reading old directory a missing files is not an error. - // For example this happens if the run of roottest at the time was done - // with FAST=yes - return true; - } + // file must exists in the specified directory + if (gSystem->AccessPathName(filename, kFileExists)) + return false; TFile file(filename,"READ"); - if (file.IsZombie()) return false; + if (file.IsZombie()) + return false; holder = dynamic_cast( file.Get("holder") ); if (!holder) { @@ -221,31 +208,5 @@ template bool read(const char *dirname, const char *testname return result; } -template bool read(const char *testname, int nEntry = 0, bool readother = false) { - - // for each dirname - TString dirname = gROOT->GetVersion(); - dirname.ReplaceAll(".","-"); - dirname.ReplaceAll("/","-"); - - bool result = true; - result &= read(dirname,testname, nEntry, /*current=*/true); - - if (readother) { - TList listOfDirs; - listOfDirs.SetOwner(kTRUE); - fillListOfDir(listOfDirs); - - TIter next(&listOfDirs); - while (TObjString *dir = (TObjString*)next()) { - if (dirname != dir->GetName()) { - std::cout << "Testing older file format from: " << dir->GetName() << std::endl; - result &= read(dir->GetName(),testname, nEntry, /*current=*/ false); - } - } - } - - return result; -} #endif diff --git a/roottest/root/io/newstl/ttest.C b/roottest/root/io/newstl/ttest.C index 5bfad2ef683f7..68ff8e6a03b4a 100644 --- a/roottest/root/io/newstl/ttest.C +++ b/roottest/root/io/newstl/ttest.C @@ -1,12 +1,17 @@ #include "multisetHolder.h" #include "test.C" -void ttest(bool readother=false) { +void ttest(const char *dirname = "") { const char* testname = "multiset"; - typedef multisetHolder holder; + typedef multisetHolder holder; - std::cout << "Running test " << testname << std::endl; - checkHolder(testname); - write(testname); - read(testname,0,readother); + if (dirname && *dirname) { + std::cout << "Running reading test " << testname << std::endl; + read(dirname, testname); + } else { + std::cout << "Running test " << testname << std::endl; + checkHolder(testname); + write(testname); + read("", testname); + } } diff --git a/roottest/root/io/newstl/versions.h b/roottest/root/io/newstl/versions.h index 2ab47a75a3ba1..fa5ec4e114dc5 100644 --- a/roottest/root/io/newstl/versions.h +++ b/roottest/root/io/newstl/versions.h @@ -11,7 +11,7 @@ #endif #define R__POLYMORPH_CLASSDEF_NONTOBJECT ROOT_VERSION(4,0,7) -#if ROOT_VERSION_CODE < R__POLYMORPH_CLASSDEF_NONTOBJECT +#if ROOT_VERSION_CODE < R__POLYMORPH_CLASSDEF_NONTOBJECT #define R__NO_POLYMORPH_CLASSDEF_NONTOBJECT #endif @@ -61,7 +61,7 @@ Bool_t FileVersionEqualCurrent(TFile *file) { } Bool_t HasPolymorphClassDefNonTObject(TFile *file) { - Bool_t result = FileVersionGreaterThan(file,R__POLYMORPH_CLASSDEF_NONTOBJECT); + Bool_t result = FileVersionGreaterThan(file,R__POLYMORPH_CLASSDEF_NONTOBJECT); if (!result) { if (FileVersionEqualCurrent(file)) { static OutputOneErrorMessage error("polymorphic behavior of non-TObject with a classDef"); @@ -72,7 +72,7 @@ Bool_t HasPolymorphClassDefNonTObject(TFile *file) { } } return result; -} +} Bool_t HasNestedContainer(TFile *file) { Bool_t result = FileVersionGreaterThan(file,R__NESTED_CONTAINER); // file->GetVersion() >= R__NESTED_CONTAINER; @@ -118,6 +118,8 @@ bool HasSplitStlContainer(TFile *file, int splitlevel) { bool HasVarArrayOfContainers(TFile *file) { Bool_t result = FileVersionGreaterThan(file, R__VAR_ARRAY_OF_CONTAINERS); // file->GetVersion() >= R__VAR_ARRAY_OF_CONTAINERS; + /* comment out to avoid multiple errors in tests because of not implemented feature */ + /* if (!result) { if (FileVersionEqualCurrent(file)) { static OutputOneErrorMessage error("variable size array of stl containers"); @@ -127,6 +129,7 @@ bool HasVarArrayOfContainers(TFile *file) { return error.result(); } } + */ return result; } #endif diff --git a/roottest/root/io/newstl/vtest.C b/roottest/root/io/newstl/vtest.C index a41fac63f4ee3..17f63ee4ad82a 100644 --- a/roottest/root/io/newstl/vtest.C +++ b/roottest/root/io/newstl/vtest.C @@ -1,19 +1,17 @@ #include "vectorHolder.h" #include "test.C" -void vtest(bool readother=false) { +void vtest(const char *dirname = "") { const char* testname = "vector"; typedef vectorHolder holder; - std::cout << "Running test " << testname << std::endl; - checkHolder(testname); - write(testname); - read(testname,0,readother); -} - -void vreadtest(const char*dirname, int nEntry = 0) { - const char* testname = "vector"; - typedef vectorHolder holder; - - read(dirname, testname, nEntry, true); + if (dirname && *dirname) { + std::cout << "Running reading test " << testname << std::endl; + read(dirname, testname); + } else { + std::cout << "Running test " << testname << std::endl; + checkHolder(testname); + write(testname); + read("", testname); + } }