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 0000000..7719eb5 Binary files /dev/null and b/src/skhep_testdata/data/uproot-issue-1229.root differ