From 574a50513075f8eebc851c8847438ea76d3075bc Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Tue, 9 Sep 2025 13:49:15 +0200 Subject: [PATCH] [RF] Prepare RooFit for ROOT without implicit ownership. Also add an assertion to stop the test when executed in the wrong directory. Previously, the test would crash. --- roofit/roofitcore/test/testRooDataSet.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roofit/roofitcore/test/testRooDataSet.cxx b/roofit/roofitcore/test/testRooDataSet.cxx index 6d1b245ab3617..55d926c4ca274 100644 --- a/roofit/roofitcore/test/testRooDataSet.cxx +++ b/roofit/roofitcore/test/testRooDataSet.cxx @@ -170,6 +170,7 @@ TEST(RooDataSet, ReducingData) for (int i = 0; i < 3; ++i) { // Check with root: TH1F test_hist(("h" + std::to_string(i)).c_str(), "histo", 10, massmin, massmax); + test_hist.SetDirectory(gDirectory); // TTree::Draw needs to find the histogram chi2cutval += 0.5; std::stringstream cutString; @@ -439,6 +440,7 @@ TEST(RooDataSet, SplitDataSetWithWeightErrors) TEST(RooDataSet, ReadDataSetWithErrors626) { std::unique_ptr file{TFile::Open("dataSet_with_errors_6_26_10.root", "READ")}; + ASSERT_NE(file, nullptr); auto data = file->Get("data");