Skip to content

Commit fc8c421

Browse files
hahnjopcanal
andcommitted
Add roottest for issue root-project#18363
Co-authored-by: Philippe Canal <[email protected]>
1 parent 5962c61 commit fc8c421

File tree

6 files changed

+52
-0
lines changed

6 files changed

+52
-0
lines changed

roottest/root/meta/naming/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ ROOTTEST_ADD_AUTOMACROS(DEPENDS namingMatches.cxx
44
ROOTTEST_ADD_TEST(execCheckNaming
55
MACRO execCheckNaming.C
66
OUTREF execCheckNaming${ref_suffix})
7+
8+
ROOTTEST_ADD_TESTDIRS()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ROOTTEST_GENERATE_REFLEX_DICTIONARY(templateDict Objects.h SELECTION selection.xml FIXTURES_SETUP template_lib)
2+
3+
ROOTTEST_ADD_TEST(templateName
4+
MACRO templateNameTest.C
5+
OUTREF templateNameTest.ref
6+
FIXTURES_REQUIRED template_lib)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#ifndef Objects_18363_hxx
2+
#define Objects_18363_hxx
3+
4+
template <unsigned I>
5+
struct PFRecHitSoALayout {
6+
struct View {};
7+
};
8+
9+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<lcgdict>
2+
<class name="PFRecHitSoALayout<128>"/>
3+
<class name="PFRecHitSoALayout<128>::View"/>
4+
</lcgdict>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
TFile pcmfile("templateDict_rdict.pcm");
3+
if (pcmfile.IsZombie()) {
4+
std::cerr << "Error: Failed to open roottest/root pcm file: " << pcmfile.GetName() << '\n';
5+
return 1;
6+
}
7+
TObjArray *protoArray = pcmfile.Get<TObjArray>("__ProtoClasses");
8+
if (!protoArray) {
9+
std::cerr << "Error: Failed to retrieve __ProtoClasses\n";
10+
return 2;
11+
}
12+
protoArray->Print();
13+
14+
const char *classname = "PFRecHitSoALayout<128>::View";
15+
auto cl = TClass::GetClass(classname);
16+
if (!cl) {
17+
std::cerr << "Error: Could not get the TClass for " << classname << "\n";
18+
return 3;
19+
}
20+
if (!cl->IsLoaded()) {
21+
std::cerr << "Error: The TClass is not loaded for " << classname << "\n";
22+
return 4;
23+
}
24+
25+
return 0;
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
Processing templateNameTest.C...
3+
Collection name='TObjArray', class='TObjArray', size=16
4+
OBJ: TProtoClass PFRecHitSoALayout<128>
5+
OBJ: TProtoClass PFRecHitSoALayout<128>::View

0 commit comments

Comments
 (0)