Skip to content

[meta] test consistency of resolvetypedef / truetypename #19615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions roottest/root/meta/naming/execResolveTypedef.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <stdio.h>
#include <TClassEdit.h>
#include <TClass.h>
#include <cstdint>

// See also roottest/meta/naming/execCheckNaming.C

Expand All @@ -12,6 +14,20 @@

namespace A1 { namespace B2 { namespace C3 { typedef int what; } } }
namespace NS { typedef int IntNS_t; }
namespace SG { typedef std::uint32_t sgkey_t; }
namespace RT {
namespace EX {
struct ClusterSize {
using ValueType = std::uint64_t;
ValueType fValue;
};
using ClusterSize_t = ClusterSize;
}
}

struct PackedParameters {
SG::sgkey_t m_sgkey;
};

class Object
{
Expand Down Expand Up @@ -207,5 +223,9 @@ int execResolveTypedef()
testing("::int",TClassEdit::ResolveTypedef("::Int_t"));
// Add an example like pair<...::type_t,int>

testing("unsigned int", TClassEdit::ResolveTypedef("SG::sgkey_t"));
testing("unsigned int", TClass::GetClass("PackedParameters")->GetDataMember("m_sgkey")->GetTrueTypeName());
testing("SG::sgkey_t", TClass::GetClass("PackedParameters")->GetDataMember("m_sgkey")->GetFullTypeName());
testing("RT::EX::ClusterSize", TClassEdit::ResolveTypedef("RT::EX::ClusterSize_t"));
return 0;
}
4 changes: 4 additions & 0 deletions roottest/root/meta/naming/execResolveTypedef.ref
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@ Test 80 The result is correct: ::int
Test 81 The result is correct: ::Unknown
Test 82 The result is correct: ::SomeTypedefName_tSF
Test 83 The result is correct: ::int
Test 84 The result is correct: unsigned int
Test 85 The result is correct: unsigned int
Test 86 The result is correct: SG::sgkey_t
Test 87 The result is correct: RT::EX::ClusterSize
(int) 0
Loading