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
23 changes: 23 additions & 0 deletions roottest/root/dataframe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,26 @@ ROOTTEST_ADD_TEST(test_snapshot_copyaddresses
MACRO test_snapshot_copyaddresses.C+)

ROOT_ADD_GTEST(test_norootextension test_norootextension.cxx LIBRARIES ROOT::ROOTDataFrame)

# In 6.38 on Windows the following test would not be able to compile because it can't find the ROOT/TestSupport.hxx
# header even though the dependency is specified in ROOTTEST_GENERATE_EXECUTABLE. Given this test properly compiles in
# later versions of ROOT on Windows, we disable it for the 6.38 release.
if(NOT MSVC)
ROOTTEST_GENERATE_DICTIONARY(
ClassWithSequenceContainersDict
${CMAKE_CURRENT_SOURCE_DIR}/ClassWithSequenceContainers.hxx
LINKDEF ${CMAKE_CURRENT_SOURCE_DIR}/ClassWithSequenceContainersLinkDef.hxx
FIXTURES_SETUP ClassWithSequenceContainersDict_setup
)
ROOTTEST_GENERATE_EXECUTABLE(
dataframe_sequence_containers
dataframe_sequence_containers.cxx ClassWithSequenceContainersDict.cxx
LIBRARIES Core RIO Tree ROOTDataFrame GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main ROOT::TestSupport
FIXTURES_REQUIRED ClassWithSequenceContainersDict_setup
FIXTURES_SETUP dataframe_sequence_containers_setup
)
ROOTTEST_ADD_TEST(dataframe_sequence_containers
EXEC ${CMAKE_CURRENT_BINARY_DIR}/dataframe_sequence_containers
FIXTURES_REQUIRED dataframe_sequence_containers_setup
)
endif()
39 changes: 39 additions & 0 deletions roottest/root/dataframe/ClassWithSequenceContainers.hxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#ifndef ROOT_DATAFRAME_TEST_ARRRAYCOMBINATIONS
#define ROOT_DATAFRAME_TEST_ARRRAYCOMBINATIONS

#include <array>
#include <vector>

#include <Rtypes.h>

struct ClassWithSequenceContainers {
unsigned int fObjIndex{};
std::array<float, 3> fArrFl{};
std::array<std::array<float, 3>, 3> fArrArrFl{};
std::array<std::vector<float>, 3> fArrVecFl{};

std::vector<float> fVecFl{};
std::vector<std::array<float, 3>> fVecArrFl{}; //! Not supported for TTree: could not find the real data member
//! '_M_elems[3]' when constructing the branch 'fVecArrFl'
std::vector<std::vector<float>> fVecVecFl{};

// For ROOT I/O
ClassWithSequenceContainers() = default;

ClassWithSequenceContainers(unsigned int objIndex, std::array<float, 3> a1, std::array<std::array<float, 3>, 3> a2,
std::array<std::vector<float>, 3> a3, std::vector<float> a4,
std::vector<std::array<float, 3>> a5, std::vector<std::vector<float>> a6)
: fObjIndex(objIndex),
fArrFl(std::move(a1)),
fArrArrFl(std::move(a2)),
fArrVecFl(std::move(a3)),
fVecFl(std::move(a4)),
fVecArrFl(std::move(a5)),
fVecVecFl(std::move(a6))
{
}

ClassDefNV(ClassWithSequenceContainers, 1)
};

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifdef __CLING__

#pragma link C++ class ClassWithSequenceContainers+;
#pragma link C++ class std::vector<ClassWithSequenceContainers>+;

#endif
Loading
Loading