Skip to content

Commit de2f762

Browse files
committed
[test] Mix new and old IO through inheritance
adding coverage for issue #10240, fixed since 6.28 Fixes #10240
1 parent 4f64950 commit de2f762

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

roottest/root/io/newClassDef/new/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ ROOTTEST_ADD_TEST(run
3939
root-io-newClassDef-new-namespace-fixture
4040
root-io-newClassDef-new-template-fixture
4141
root-io-newClassDef-new-nstemplate-fixture)
42+
43+
# Issue 10240
44+
ROOTTEST_ADD_TEST(oldNewIOMix
45+
MACRO oldNewIOMix.C+)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <vector>
2+
#include "TTree.h"
3+
4+
#ifdef __ROOTCLING__
5+
#pragma link C++ class A;
6+
#pragma link C++ class B+;
7+
#pragma link C++ class std::vector<B>+;
8+
#endif
9+
10+
struct A {
11+
int x;
12+
ClassDef(A, 1);
13+
};
14+
15+
struct B : A {
16+
int y;
17+
ClassDef(B, 1);
18+
};
19+
20+
void oldNewIOMix() {
21+
TTree* tree = new TTree("T", "T");
22+
std::vector<B> bvec;
23+
tree->Branch("B", &bvec);
24+
}

0 commit comments

Comments
 (0)