Skip to content

Commit d980cfd

Browse files
hageboeckdpiparo
authored andcommitted
[RFile] Prepare an RFile test for both states of object auto registration.
1 parent 94ff78a commit d980cfd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

io/io/test/rfile.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,10 @@ TEST(RFile, CheckNoAutoRegistrationWrite)
132132
EXPECT_EQ(gDirectory, gROOT);
133133
auto hist = std::make_unique<TH1D>("hist", "", 100, -10, 10);
134134
file->Put("hist", *hist);
135-
EXPECT_EQ(hist->GetDirectory(), gROOT);
135+
TDirectory const *expectedDir = ROOT::Experimental::ObjectAutoRegistrationEnabled() ? gROOT : nullptr;
136+
EXPECT_EQ(hist->GetDirectory(), expectedDir);
136137
file->Close();
137-
EXPECT_EQ(hist->GetDirectory(), gROOT);
138+
EXPECT_EQ(hist->GetDirectory(), expectedDir);
138139
hist.reset();
139140
// no double free should happen when ROOT exits
140141
}

0 commit comments

Comments
 (0)