Skip to content

Prepare roottest for ROOT 7's ownership model#21225

Open
hageboeck wants to merge 6 commits intoroot-project:masterfrom
hageboeck:root7-ownership-9
Open

Prepare roottest for ROOT 7's ownership model#21225
hageboeck wants to merge 6 commits intoroot-project:masterfrom
hageboeck:root7-ownership-9

Conversation

@hageboeck
Copy link
Member

In essence, add histo.SetDirectory(xxx) to all places where a histogram should show up in a TDirectory independent of whether it has been registered automatically.

@github-actions
Copy link

github-actions bot commented Feb 10, 2026

Test Results

    22 files      22 suites   3d 9h 36m 34s ⏱️
 3 791 tests  3 791 ✅ 0 💤 0 ❌
75 369 runs  75 369 ✅ 0 💤 0 ❌

Results for commit 5fe91b4.

♻️ This comment has been updated with latest results.

@hageboeck hageboeck requested a review from pcanal February 11, 2026 13:00
Copy link
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should enhanced this PR by adding a new test that checks the current memory ownership explicitly (Otherwise we no longer test the current/main-stream usages)

@hageboeck
Copy link
Member Author

hageboeck commented Feb 12, 2026

We should enhanced this PR by adding a new test that checks the current memory ownership explicitly (Otherwise we no longer test the current/main-stream usages)

That's a very good idea, and it's now implemented in the "master" PR for this feature. I'll cherry-pick the commit that will work already in ROOT 6 mode into this PR next.

Edit: Done


TEST(TH1, RegistrationToTDirectory_ImplicitOwnershipOn)
{
TH1D histo1("histo1", "Test Histogram", 10, 0, 10);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe (or maybe not) for the PR, we should also have similar for the other self Registering classes ....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duly noted. For TH1-derived classes, we do it in this PR. For other cases, I added a TODO to #18083

The test was relying on implicit ownership to transfer a histogram from
python to C++, so now the histogram is appended explicitly.
The tutorial was running code that didn't directly reference the
histogram, so it fails when implicit ownership is off.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants