Skip to content
Merged
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
1 change: 0 additions & 1 deletion roottest/root/io/newstl/.rootrc

This file was deleted.

114 changes: 107 additions & 7 deletions roottest/root/io/newstl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,107 @@
#-------------------------------------------------------------------------------
#
# 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(LABELS longtest)
ROOTTEST_COMPILE_MACRO(TestHelpers.C
FIXTURES_SETUP root-io-newstl-TestHelpers-fixture)

set(_holders rvecHolder vectorHolder dequeHolder listHolder setHolder multisetHolder mapHolder multimapHolder)
set(_tests rtest vtest dtest ltest stest ttest mtest ntest)

foreach(index RANGE 7)
list(GET _holders ${index} holder)
list(GET _tests ${index} test)
ROOTTEST_COMPILE_MACRO(${holder}.C
BUILDLIB TestHelpers_C
FIXTURES_REQUIRED root-io-newstl-TestHelpers-fixture
FIXTURES_SETUP root-io-newstl-${holder}-fixture)
ROOTTEST_COMPILE_MACRO(${test}.C
BUILDLIB ${holder}_C
FIXTURES_REQUIRED root-io-newstl-${holder}-fixture
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}
FIXTURES_REQUIRED root-io-newstl-test-fixture
FIXTURES_SETUP root-io-newstl-run-fixture)

# failing tests, crashes ROOT, was disabled in Makefile
ROOTTEST_ADD_TEST(nolib
MACRO readNoLib.C
MACROARG "\"vector.root\""
OUTREF stlNoLibTest.ref
WILLFAIL
FIXTURES_REQUIRED root-io-newstl-run-fixture)

ROOTTEST_COMPILE_MACRO(ComplexTest.h
FIXTURES_SETUP root-io-newstl-ComplexTest_h-fixture)

ROOTTEST_COMPILE_MACRO(sample_bx_classes.C
FIXTURES_SETUP root-io-newstl-sample_bx_classes-fixture)

if(ClingWorkAroundMissingDynamicScope)
set(_complextest_load -e "(void)gROOT->ProcessLine(\".L ComplexTest.h+\")")
set(_sample_bx_classes_load -e "(void)gROOT->ProcessLine(\".L sample_bx_classes.C+\")")
endif()

ROOTTEST_ADD_TEST(ComplexTest
MACRO runComplexTest.C
ROOTEXE_OPTS ${_complextest_load}
OUTREF ComplexTest${ref_suffix}
FIXTURES_REQUIRED root-io-newstl-ComplexTest_h-fixture)

ROOTTEST_ADD_TEST(SampleFile
MACRO sample_writer.C
ROOTEXE_OPTS ${_sample_bx_classes_load}
FIXTURES_REQUIRED root-io-newstl-sample_bx_classes-fixture
FIXTURES_SETUP root-io-newstl-SampleFile-fixture)

ROOTTEST_ADD_TEST(emptyCollection
MACRO runemptyCollection.C
OUTREF emptyCollection.ref
FIXTURES_REQUIRED root-io-newstl-sample_bx_classes-fixture
root-io-newstl-SampleFile-fixture)

ROOTTEST_ADD_TEST(emulatedWrite
COMMAND ${ROOT_hadd_CMD} -f result.root cmsJets_0.root cmsJets_1.root
COPY_TO_BUILDDIR cmsJets_0.root cmsJets_1.root
OUTREF emulatedWrite.ref)

ROOTTEST_ADD_TEST(base
MACRO runbase.C+
OUTREF base.ref)

ROOTTEST_ADD_TEST(writetest_emulvector
MACRO writetest_emulvector.C
OUTREF emulvector.root.ref
FIXTURES_SETUP root-io-newstl-writetest_emulvector-fixture)

ROOTTEST_ADD_TEST(readtest_emulvector
MACRO runEmulvector.C
OUTREF Emulvector.ref
FIXTURES_REQUIRED root-io-newstl-writetest_emulvector-fixture)

ROOTTEST_ADD_TEST(writeMemberWise
MACRO writeMemberWise.cxx+
FIXTURES_SETUP root-io-newstl-writeMemberWise-fixture)

ROOTTEST_ADD_TEST(readMemberWise
MACRO execMemberWise.cxx+
OUTREF execMemberWise.ref
FIXTURES_REQUIRED root-io-newstl-writeMemberWise-fixture)

ROOTTEST_ADD_TEST(buildPospelov
MACRO buildPospelov.C
COPY_TO_BUILDDIR pospelov.2010.mc10_7TeV.pool.root PospelovPrintFile.C
FIXTURES_SETUP root-io-newstl-buildPospelov-fixture)

ROOTTEST_ADD_TEST(printPospelov
MACRO execPospelovPrintFile.C
OUTREF execPospelovPrintFile.ref
FIXTURES_REQUIRED root-io-newstl-buildPospelov-fixture)

21 changes: 14 additions & 7 deletions roottest/root/io/newstl/ComplexTest.h
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
#ifndef Test_hh
#define Test_hh

#include "TObject.h"
#include <complex>
#include <vector>

#ifndef Test_hh
#define Test_hh
// #include <vector>

class Test: public TObject
{
public:

std::complex<double> fMyComplexVector;
//std::vector<std::complex<double> > fMyComplexVector;

void Set(int seed) {
fMyComplexVector = std::complex<double>(seed,seed*2);
}

bool TestValue(int seed) {
return ( seed == (int)fMyComplexVector.real() && seed == (int)(fMyComplexVector.imag()/2) );
}
ClassDef(Test, 1);

ClassDefOverride(Test, 1);
};

#ifdef __ROOTCLING__
#pragma link C++ class std::complex<double>+;
#pragma link C++ class Test+;
#endif

#endif /* Test_hh */
8 changes: 8 additions & 0 deletions roottest/root/io/newstl/ComplexTest_win32.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

Processing runComplexTest.C...
Warning in <TStreamerInfo::Build>: _Complex_base<double,_C_double_complex>: base class _C_double_complex has no streamer or dictionary it will not be saved
Warning in <TStreamerInfo::Build>: complex<double>: base class _Complex_base<double,_C_double_complex> has no streamer or dictionary it will not be saved
The complex object was set properly:
3 6
The complex object was read properly:
3 6
8 changes: 8 additions & 0 deletions roottest/root/io/newstl/ComplexTest_win64.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

Processing runComplexTest.C...
Warning in <TStreamerInfo::Build>: _Complex_base<double,_C_double_complex>: base class _C_double_complex has no streamer or dictionary it will not be saved
Warning in <TStreamerInfo::Build>: complex<double>: base class _Complex_base<double,_C_double_complex> has no streamer or dictionary it will not be saved
The complex object was set properly:
3 6
The complex object was read properly:
3 6
Loading
Loading