@@ -24,8 +24,9 @@ TEST(RNTupleProcessor, EmptyNTuple)
24
24
25
25
class RNTupleProcessorTest : public testing ::Test {
26
26
protected:
27
- const std::array<std::string, 2 > fFileNames {" test_ntuple_processor1.root" , " test_ntuple_processor2.root" };
28
- const std::array<std::string, 2 > fNTupleNames {" ntuple" , " ntuple_aux" };
27
+ const std::array<std::string, 3 > fFileNames {" test_ntuple_processor1.root" , " test_ntuple_processor2.root" ,
28
+ " test_ntuple_processor3.root" };
29
+ const std::array<std::string, 3 > fNTupleNames {" ntuple" , " ntuple_aux" , " ntuple_aux" };
29
30
30
31
void SetUp () override
31
32
{
@@ -55,6 +56,19 @@ class RNTupleProcessorTest : public testing::Test {
55
56
ntuple->Fill ();
56
57
}
57
58
}
59
+ // Same as above, but entries in reverse order
60
+ {
61
+ auto model = RNTupleModel::Create ();
62
+ auto fldI = model->MakeField <int >(" i" );
63
+ auto fldZ = model->MakeField <float >(" z" );
64
+ auto ntuple = RNTupleWriter::Recreate (std::move (model), fNTupleNames [2 ], fFileNames [2 ]);
65
+
66
+ for (int i = 4 ; i >= 0 ; --i) {
67
+ *fldI = i;
68
+ *fldZ = i * 2 .f ;
69
+ ntuple->Fill ();
70
+ }
71
+ }
58
72
}
59
73
};
60
74
@@ -165,12 +179,14 @@ TEST_F(RNTupleProcessorTest, ChainedChain)
165
179
166
180
TEST_F (RNTupleProcessorTest, ChainedJoin)
167
181
{
168
- std::vector<RNTupleOpenSpec> ntuples{{fNTupleNames [0 ], fFileNames [0 ]}, {fNTupleNames [1 ], fFileNames [1 ]}};
169
-
170
182
std::vector<std::unique_ptr<RNTupleProcessor>> innerProcs;
171
- innerProcs.push_back (RNTupleProcessor::CreateJoin (ntuples, {}));
172
- innerProcs.push_back (RNTupleProcessor::CreateJoin (ntuples, {" i" }));
173
-
183
+ // The ntuples are aligned
184
+ innerProcs.push_back (
185
+ RNTupleProcessor::CreateJoin ({{fNTupleNames [0 ], fFileNames [0 ]}, {fNTupleNames [1 ], fFileNames [1 ]}}, {}));
186
+ // The ntuples are unaligned, so we join on "i"
187
+ innerProcs.push_back (
188
+ RNTupleProcessor::CreateJoin ({{fNTupleNames [0 ], fFileNames [0 ]}, {fNTupleNames [2 ], fFileNames [2 ]}}, {" i" }));
189
+ // The chain processor shouldn't care about the fact that the first join is aligned, but the second one isn't
174
190
auto proc = RNTupleProcessor::CreateChain (std::move (innerProcs));
175
191
176
192
int nEntries = 0 ;
0 commit comments