Skip to content

Commit 86122e6

Browse files
committed
[Core] ROOT-9712 increase coverage of missing dict checks to cover new features
looking for dictionaries of template types of unique_ptr, array, tuple recursively and making sure that pointers and const qualifiers are properly treated.
1 parent e0330cd commit 86122e6

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

core/meta/test/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ROOT_ADD_GTEST(testStatusBitsChecker testStatusBitsChecker.cxx LIBRARIES Core)
22
ROOT_ADD_GTEST(testHashRecursiveRemove testHashRecursiveRemove.cxx LIBRARIES Core)
33
ROOT_ADD_GTEST(testTClass testTClass.cxx LIBRARIES Core)
4-
configure_file(stlDictCheck.h . COPYONLY)
4+
configure_file(stlDictCheck.h . COPYONLY)
5+
configure_file(stlDictCheckAux.h . COPYONLY)

core/meta/test/stlDictCheck.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
#ifndef _DICT_CHECK_TEST_
22
#define _DICT_CHECK_TEST_
33

4+
#include "stlDictCheckAux.h"
5+
6+
#include <array>
47
#include <memory>
58

9+
#ifdef __ROOTCLING__
10+
#pragma link C++ class A+;
11+
#pragma link C++ class B+;
12+
#endif
13+
14+
615
struct A {
716
};
17+
18+
struct D {
19+
};
20+
821
struct B {
922
std::unique_ptr<A> fA;
23+
std::tuple<A, int, double*> fT;
24+
std::array<int, 5> fArr;
25+
std::array<const std::unique_ptr<C**const*>, 5> fArrPtr;
26+
std::array<const std::unique_ptr<D**const*>, 5> fArrPtr2;
1027
};
1128

1229
#endif
30+

core/meta/test/stlDictCheckAux.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef _DICT_CHECK_TEST_AUX_
2+
#define _DICT_CHECK_TEST_AUX_
3+
4+
struct C {
5+
};
6+
7+
#endif
8+

core/meta/test/testTClass.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ TEST(TClass, DictCheck)
2020
errMsg += ", ";
2121
}
2222

23-
EXPECT_TRUE(classesWithoutDictionary.IsEmpty()) << errMsg;
24-
}
23+
EXPECT_STREQ(errMsg.c_str(), "Missing dictionary for C, ") << errMsg;
24+
}

0 commit comments

Comments
 (0)