From 9ce1f2b63c27286c65cf8a433843c24bdaa5718d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 16 Jul 2024 12:40:06 -0400 Subject: [PATCH] feat: for scikit-hep/uproot5#1229 (#154) * feat: for scikit-hep/uproot5#1229 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- dev/make-root/uproot_issue_1229.C | 40 ++++++++++++++++++ .../data/uproot-issue-1229.root | Bin 0 -> 6628 bytes 2 files changed, 40 insertions(+) create mode 100644 dev/make-root/uproot_issue_1229.C create mode 100644 src/skhep_testdata/data/uproot-issue-1229.root diff --git a/dev/make-root/uproot_issue_1229.C b/dev/make-root/uproot_issue_1229.C new file mode 100644 index 0000000..b0f0315 --- /dev/null +++ b/dev/make-root/uproot_issue_1229.C @@ -0,0 +1,40 @@ +#include +#include +#include + +class TFooMember : public TObject { +public: + TFooMember(int _value) + : value(_value) + {}; + + int value; + +ClassDef(TFooMember, 1); +}; + +class TFoo : public TObject { +public: + TFoo(int value_for_member, int value_for_const_member) + : pointer{new TFooMember(value_for_member)} + , const_pointer{new TFooMember(value_for_const_member)} + {}; + + TFooMember *pointer; + const TFooMember *const_pointer; + +ClassDef(TFoo, 1); +}; + +// Streaming interpreted classes is not supported, so this has to be ran with ACLiC: +// +// root -lbq uproot_issue_1229.C+ +// +void uproot_issue_1229() { + TFile f("uproot-issue-1229.root", "RECREATE"); + TTree tree; + TFoo foo(123, 321); + tree.Branch("branch", &foo); + tree.Fill(); + tree.Write("tree"); +} diff --git a/src/skhep_testdata/data/uproot-issue-1229.root b/src/skhep_testdata/data/uproot-issue-1229.root new file mode 100644 index 0000000000000000000000000000000000000000..7719eb5f3e852e54f779740bc88a1ffe330670fb GIT binary patch literal 6628 zcma)BRZv{PwjCS>2sXI81WRxa?rwv-!{9E#HNoB8-QAKv@BqOjI1`-U{z$&w&%5uQ zs@=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