File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -263,3 +263,31 @@ TEST(TTreeFormulaRegressions, WrongName)
263
263
EXPECT_EQ (t.Draw (" s.Eta()" , " " ), -1 );
264
264
}
265
265
}
266
+
267
+ // https://github.com/root-project/root/issues/19814
268
+ TEST (TTreeReaderRegressions, UninitializedChain)
269
+ {
270
+ auto filename = " eve19814.root" ;
271
+ auto treename = " events" ;
272
+ auto brname = " x" ;
273
+ const int refval = 19814 ;
274
+ {
275
+ TFile f (filename, " RECREATE" );
276
+ TTree t (treename, " " );
277
+ int x = refval;
278
+ t.Branch (brname, &x);
279
+ t.Fill ();
280
+ f.Write ();
281
+ }
282
+ {
283
+ TChain ch (treename);
284
+ ch.Add (filename);
285
+ TTreeReader reader (&ch);
286
+ reader.SetEntriesRange (0 , ch.GetEntries ());
287
+ EXPECT_EQ (reader.GetEntries (), 1 );
288
+ TTreeReaderValue<int > x (reader, brname);
289
+ EXPECT_TRUE (reader.Next ());
290
+ EXPECT_EQ (*x, refval);
291
+ }
292
+ gSystem ->Unlink (filename);
293
+ }
You can’t perform that action at this time.
0 commit comments