diff --git a/roottest/root/io/cpp11Containers/CMakeLists.txt b/roottest/root/io/cpp11Containers/CMakeLists.txt index 086779fa44b5a..d3bf41d3c0713 100644 --- a/roottest/root/io/cpp11Containers/CMakeLists.txt +++ b/roottest/root/io/cpp11Containers/CMakeLists.txt @@ -10,6 +10,19 @@ ROOTTEST_ADD_TEST(unorderedMap FIXTURES_SETUP root-io-cpp11Containers-unorderedMap-fixture LABELS longtest) +# Copy of the test above, written as a compiled C++ program based on gtest. Useful for more fine-grained view on +# potential test failures +ROOTTEST_GENERATE_EXECUTABLE( + unorderedMapUnitTests + unorderedMapUnitTests.cxx + LIBRARIES Core RIO Tree TreePlayer Hist GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main ROOT::TestSupport + FIXTURES_REQUIRED root-io-cpp11Containers-unorderedMapDict-fixture + FIXTURES_SETUP root-io-cpp11Containers-unorderedMapUnitTests-fixture) + +ROOTTEST_ADD_TEST(unorderedMapUnitTests + EXEC ${CMAKE_CURRENT_BINARY_DIR}/unorderedMapUnitTests + FIXTURES_REQUIRED root-io-cpp11Containers-unorderedMapUnitTests-fixture) + if(NOT 32BIT AND NOT MSVC) ROOTTEST_GENERATE_REFLEX_DICTIONARY(forwardList forwardList.h diff --git a/roottest/root/io/cpp11Containers/unorderedMapUnitTests.cxx b/roottest/root/io/cpp11Containers/unorderedMapUnitTests.cxx new file mode 100644 index 0000000000000..e7e74fc1fac2a --- /dev/null +++ b/roottest/root/io/cpp11Containers/unorderedMapUnitTests.cxx @@ -0,0 +1,360 @@ +// Test the usage of different instantiations of std::map, std::multimap, std::unordered_map, std::unordered_multimap +// Each container has a dictionary generated via an XML selection file +// We test storage of each container as: +// * An object in a file (a.k.a. row-wise) +// * An unsplit branch in a TTree +// * A split branch in a TTree + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +// Test fixture based on different container types and key types + +// Wrapper type used to instantiate pairs of concrete types to use in the +// TYPED_TEST_SUITE macro call +template