Skip to content

Commit 2da80d3

Browse files
committed
[ntuple] Add partial test for templated alias
In this case, we do not get the fully qualified type from TDataMember.
1 parent 7c5fbe6 commit 2da80d3

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

tree/ntuple/v7/test/CustomStruct.hxx

+9
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,20 @@ public:
9393
T fMember;
9494
};
9595

96+
template <typename T>
97+
struct EdmHashTrait {
98+
using value_type = T;
99+
};
100+
96101
template <int I>
97102
class EdmHash {
98103
public:
99104
typedef std::string value_type;
100105
value_type fHash;
106+
107+
template <typename T>
108+
using value_typeT = typename EdmHashTrait<T>::value_type;
109+
value_typeT<value_type> fHash2;
101110
};
102111

103112
template <typename FirstT, typename SecondT = double>

tree/ntuple/v7/test/ntuple_type_name.cxx

+7-1
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,16 @@ TEST(RNTuple, TypeNameTemplatesNestedAlias)
208208
EXPECT_EQ("", hash->GetTypeAlias());
209209

210210
const auto hashSubFields = hash->GetSubFields();
211-
ASSERT_EQ(1, hashSubFields.size());
211+
ASSERT_EQ(2, hashSubFields.size());
212212
EXPECT_EQ("fHash", hashSubFields[0]->GetFieldName());
213213
EXPECT_EQ("std::string", hashSubFields[0]->GetTypeName());
214214
EXPECT_EQ("EdmHash<1>::value_type", hashSubFields[0]->GetTypeAlias());
215+
216+
EXPECT_EQ("fHash2", hashSubFields[1]->GetFieldName());
217+
EXPECT_EQ("std::string", hashSubFields[1]->GetTypeName());
218+
// FIXME: This should really be EdmHash<1>::value_typeT<EdmHash<1>::value_type>, but this is the value we get from
219+
// TDataMember::GetFullTypeName right now...
220+
EXPECT_EQ("value_typeT<EdmHash<1>::value_type>", hashSubFields[1]->GetTypeAlias());
215221
}
216222

217223
TEST(RNTuple, ContextDependentTypeNames)

0 commit comments

Comments
 (0)