Skip to content

Commit 405ec40

Browse files
committed
[ntuple] Split long-running test
1 parent 800af77 commit 405ec40

9 files changed

+445
-401
lines changed

Diff for: tree/ntuple/v7/test/CMakeLists.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,16 @@ ROOT_ADD_GTEST(rfield_vector rfield_vector.cxx LIBRARIES ROOTNTuple CustomStruct
8080
ROOT_ADD_GTEST(ntuple_minifile ntuple_minifile.cxx LIBRARIES ROOTNTuple Physics Tree CustomStruct)
8181
ROOT_ADD_GTEST(ntuple_show ntuple_show.cxx LIBRARIES ROOTNTuple CustomStruct)
8282
ROOT_ADD_GTEST(ntuple_storage ntuple_storage.cxx LIBRARIES ROOTNTuple MathCore CustomStruct)
83-
ROOT_ADD_GTEST(ntuple_extended ntuple_extended.cxx LIBRARIES ROOTNTuple MathCore CustomStruct)
83+
84+
ROOT_ADD_GTEST(ntuple_double32imt ntuple_double32imt.cxx LIBRARIES ROOTNTuple MathCore CustomStruct)
85+
if(NOT MSVC OR win_broken_tests)
86+
ROOT_ADD_GTEST(ntuple_largefile1 ntuple_largefile1.cxx LIBRARIES ROOTNTuple MathCore CustomStruct)
87+
ROOT_ADD_GTEST(ntuple_largefile2 ntuple_largefile2.cxx LIBRARIES ROOTNTuple MathCore CustomStruct)
88+
endif()
89+
ROOT_ADD_GTEST(ntuple_largepages ntuple_largepages.cxx LIBRARIES ROOTNTuple MathCore CustomStruct)
90+
ROOT_ADD_GTEST(ntuple_multicolumnexpansion ntuple_multicolumnexpansion.cxx LIBRARIES ROOTNTuple MathCore CustomStruct)
91+
ROOT_ADD_GTEST(ntuple_randomaccess ntuple_randomaccess.cxx LIBRARIES ROOTNTuple MathCore CustomStruct)
92+
ROOT_ADD_GTEST(ntuple_realworld1 ntuple_realworld1.cxx LIBRARIES ROOTNTuple MathCore CustomStruct)
8493

8594
ROOT_ADD_GTEST(ntuple_parallel_writer ntuple_parallel_writer.cxx LIBRARIES ROOTNTuple)
8695

Diff for: tree/ntuple/v7/test/ntuple_double32imt.cxx

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#include <ROOT/RConfig.hxx>
2+
3+
#include "ntuple_test.hxx"
4+
5+
#include <algorithm>
6+
7+
TEST(RNTuple, Double32IMT)
8+
{
9+
// Tests if parallel decompression correctly compresses the on-disk float to an in-memory double
10+
#ifdef R__USE_IMT
11+
IMTRAII _;
12+
#endif
13+
FileRaii fileGuard("test_ntuple_double32_imt.root");
14+
15+
constexpr int kNEvents = 10;
16+
17+
{
18+
auto model = RNTupleModel::Create();
19+
model->AddField(RFieldBase::Create("pt", "Double32_t").Unwrap());
20+
auto writer = RNTupleWriter::Recreate(std::move(model), "ntpl", fileGuard.GetPath());
21+
22+
auto ptrPt = writer->GetModel().GetDefaultEntry().GetPtr<double>("pt");
23+
24+
for (int i = 0; i < kNEvents; ++i) {
25+
*ptrPt = i;
26+
writer->Fill();
27+
}
28+
}
29+
30+
auto reader = RNTupleReader::Open("ntpl", fileGuard.GetPath());
31+
auto viewPt = reader->GetView<double>("pt");
32+
for (int i = 0; i < kNEvents; ++i) {
33+
EXPECT_DOUBLE_EQ(i, viewPt(i));
34+
}
35+
}

0 commit comments

Comments
 (0)