Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions roottest/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 14 additions & 0 deletions roottest/root/io/newstl/6-32-19/Readme.md
Original file line number Diff line number Diff line change
@@ -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

Binary file added roottest/root/io/newstl/6-32-19/deque.root
Binary file not shown.
Binary file added roottest/root/io/newstl/6-32-19/list.root
Binary file not shown.
Binary file added roottest/root/io/newstl/6-32-19/map.root
Binary file not shown.
Binary file added roottest/root/io/newstl/6-32-19/multimap.root
Binary file not shown.
Binary file added roottest/root/io/newstl/6-32-19/multiset.root
Binary file not shown.
Binary file added roottest/root/io/newstl/6-32-19/rvec.root
Binary file not shown.
Binary file added roottest/root/io/newstl/6-32-19/set.root
Binary file not shown.
Binary file added roottest/root/io/newstl/6-32-19/vector.root
Binary file not shown.
14 changes: 7 additions & 7 deletions roottest/root/io/newstl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
66 changes: 0 additions & 66 deletions roottest/root/io/newstl/TestHelpers.C
Original file line number Diff line number Diff line change
@@ -1,72 +1,6 @@
#include "TestHelpers.h"
#include "TestOutput.h"
#include "TSystem.h"
#include "TList.h"
#include "TRegexp.h"
#include "TObjString.h"
#include <utility>

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;
Expand Down
11 changes: 5 additions & 6 deletions roottest/root/io/newstl/TestHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<const HelperDerived*>(&rhs);
Expand All @@ -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<const HelperDerived*>(&copy);
if (drhs==0) {
TString msg = Helper::CompMsg(copy);
Expand All @@ -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<const THelper*>(&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);
Expand All @@ -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<const THelperDerived*>(&rhs);
Expand All @@ -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<const THelperDerived*>(&copy);
if (drhs==0) {
TString msg = THelper::CompMsg(copy);
Expand Down Expand Up @@ -161,6 +161,5 @@ template <class T> class PtrCmp {
};

class TList;
void fillListOfDir(TList &l);

#endif // TEST__HELPER
15 changes: 10 additions & 5 deletions roottest/root/io/newstl/dtest.C
Original file line number Diff line number Diff line change
@@ -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<holder>(testname);
write<holder>(testname);
read<holder>(testname,0,readother);
if (dirname && *dirname) {
std::cout << "Running reading test " << testname << std::endl;
read<holder>(dirname, testname);
} else {
std::cout << "Running test " << testname << std::endl;
checkHolder<holder>(testname);
write<holder>(testname);
read<holder>("", testname);
}
}
15 changes: 10 additions & 5 deletions roottest/root/io/newstl/ltest.C
Original file line number Diff line number Diff line change
@@ -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<holder>(testname);
write<holder>(testname);
read<holder>(testname,0,readother);
if (dirname && *dirname) {
std::cout << "Running reading test " << testname << std::endl;
read<holder>(dirname, testname);
} else {
std::cout << "Running test " << testname << std::endl;
checkHolder<holder>(testname);
write<holder>(testname);
read<holder>("", testname);
}
}
24 changes: 10 additions & 14 deletions roottest/root/io/newstl/mtest.C
Original file line number Diff line number Diff line change
@@ -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<holder>(testname);
write<holder>(testname);
read<holder>(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<holder>(testname,0,readother);
if (dirname && *dirname) {
std::cout << "Running reading test " << testname << std::endl;
read<holder>(dirname, testname);
} else {
std::cout << "Running test " << testname << std::endl;
checkHolder<holder>(testname);
write<holder>(testname);
read<holder>("", testname);
}
}
15 changes: 10 additions & 5 deletions roottest/root/io/newstl/ntest.C
Original file line number Diff line number Diff line change
@@ -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<holder>(testname);
write<holder>(testname);
read<holder>(testname,0,readother);
if (dirname && *dirname) {
std::cout << "Running reading test " << testname << std::endl;
read<holder>(dirname, testname);
} else {
std::cout << "Running test " << testname << std::endl;
checkHolder<holder>(testname);
write<holder>(testname);
read<holder>("", testname);
}
}
21 changes: 10 additions & 11 deletions roottest/root/io/newstl/rtest.C
Original file line number Diff line number Diff line change
@@ -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<holder>(testname);
write<holder>(testname);
read<holder>(testname,0,readother);
if (dirname && *dirname) {
std::cout << "Running reading test " << testname << std::endl;
read<holder>(dirname, testname);
} else {
std::cout << "Running test " << testname << std::endl;
checkHolder<holder>(testname);
write<holder>(testname);
read<holder>("", testname);
}
}

void rreadtest(const char*dirname, int nEntry = 0) {
const char* testname = "rvec";
typedef rvecHolder holder;

read<holder>(dirname, testname, nEntry, true);
}
44 changes: 0 additions & 44 deletions roottest/root/io/newstl/run.C

This file was deleted.

Loading
Loading