@@ -108,19 +108,56 @@ TEST(RDFSnapshotRNTuple, WriteOpts)
108
108
109
109
auto df = ROOT::RDataFrame (25ull ).Define (" x" , [] { return 10 ; });
110
110
111
- ROOT::RNTupleWriteOptions writeOpts;
112
- writeOpts.SetEnablePageChecksums (false );
111
+ {
112
+ ROOT::RNTupleWriteOptions writeOpts;
113
+ writeOpts.SetEnablePageChecksums (false );
113
114
114
- RSnapshotOptions opts;
115
- opts.fOutputFormat = ROOT::RDF::ESnapshotOutputFormat::kRNTuple ;
116
- opts.fNTupleWriteOpts = writeOpts;
115
+ RSnapshotOptions opts;
116
+ opts.fOutputFormat = ROOT::RDF::ESnapshotOutputFormat::kRNTuple ;
117
+ opts.fNTupleWriteOpts = writeOpts;
117
118
118
- auto sdf = df.Snapshot (" ntuple" , fileGuard.GetPath (), " x" , opts);
119
+ auto sdf = df.Snapshot (" ntuple" , fileGuard.GetPath (), " x" , opts);
119
120
120
- EXPECT_EQ (columns, sdf->GetColumnNames ());
121
+ EXPECT_EQ (columns, sdf->GetColumnNames ());
121
122
122
- auto reader = RNTupleReader::Open (" ntuple" , fileGuard.GetPath ());
123
- EXPECT_FALSE (reader->GetDescriptor ().GetClusterDescriptor (0 ).GetPageRange (0 ).GetPageInfos ()[0 ].HasChecksum ());
123
+ auto reader = RNTupleReader::Open (" ntuple" , fileGuard.GetPath ());
124
+ EXPECT_FALSE (reader->GetDescriptor ().GetClusterDescriptor (0 ).GetPageRange (0 ).GetPageInfos ()[0 ].HasChecksum ());
125
+ }
126
+
127
+ // Setting TTree-specific options while the output format is set to RNTuple should result in a warning
128
+ {
129
+ RSnapshotOptions opts;
130
+ opts.fOutputFormat = ROOT::RDF::ESnapshotOutputFormat::kRNTuple ;
131
+ opts.fAutoFlush = 1 ;
132
+
133
+ ROOT_EXPECT_WARNING (df.Snapshot (" ntuple" , fileGuard.GetPath (), " x" , opts), " Snapshot" ,
134
+ " The TTree-specific fAutoFlush option in RSnapshotOptions has been set, but the output "
135
+ " format is set to RNTuple, so this option won't have any effect. Use the fNTupleWriteOptions "
136
+ " option available in RSnapshotOptions to configure the output RNTuple. Alternatively, change "
137
+ " fOutputFormat to snapshot to TTree instead." );
138
+ }
139
+ {
140
+ RSnapshotOptions opts;
141
+ opts.fOutputFormat = ROOT::RDF::ESnapshotOutputFormat::kRNTuple ;
142
+ opts.fSplitLevel = 1 ;
143
+
144
+ ROOT_EXPECT_WARNING (df.Snapshot (" ntuple" , fileGuard.GetPath (), " x" , opts), " Snapshot" ,
145
+ " The TTree-specific fSplitLevel option in RSnapshotOptions has been set, but the output "
146
+ " format is set to RNTuple, so this option won't have any effect. Use the fNTupleWriteOptions "
147
+ " option available in RSnapshotOptions to configure the output RNTuple. Alternatively, change "
148
+ " fOutputFormat to snapshot to TTree instead." );
149
+ }
150
+ {
151
+ RSnapshotOptions opts;
152
+ opts.fOutputFormat = ROOT::RDF::ESnapshotOutputFormat::kRNTuple ;
153
+ opts.fBasketSize = 64000 ;
154
+
155
+ ROOT_EXPECT_WARNING (df.Snapshot (" ntuple" , fileGuard.GetPath (), " x" , opts), " Snapshot" ,
156
+ " The TTree-specific fBasketSize option in RSnapshotOptions has been set, but the output "
157
+ " format is set to RNTuple, so this option won't have any effect. Use the fNTupleWriteOptions "
158
+ " option available in RSnapshotOptions to configure the output RNTuple. Alternatively, change "
159
+ " fOutputFormat to snapshot to TTree instead." );
160
+ }
124
161
}
125
162
126
163
TEST (RDFSnapshotRNTuple, Compression)
0 commit comments