Skip to content

Commit 849ad1b

Browse files
committed
integrating clang-mirror generated ids.
1 parent 68c8826 commit 849ad1b

5 files changed

Lines changed: 14 additions & 18 deletions

File tree

CxxTestUtils/inc/TestUtilsBook.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ namespace test_utils
1616
{
1717
struct library
1818
{
19-
static constexpr std::string_view class_ = "Library";
20-
static constexpr std::string_view str_addBook = "addBook";
21-
static constexpr std::string_view str_getBookByTitle = "getBookByTitle";
22-
2319
static const bool assert_zero_instance_count();
2420
};
2521

RTLTestRunApp/src/CxxMirrorTests/CxxMirrorThreadingTest.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ namespace rtl_tests
4545
{
4646
auto _ = rtl::CxxMirror({
4747

48-
rtl::type().record<Library>(library::class_).build(),
48+
rtl::type().record<Library>(cxx::type::Library::id).build(),
4949

50-
rtl::type().member<Library>().methodStatic(library::str_addBook).build(&Library::addBook),
50+
rtl::type().member<Library>().methodStatic(cxx::type::Library::fn::addBook::id).build(&Library::addBook),
5151

52-
rtl::type().member<Library>().methodStatic(library::str_getBookByTitle).build(&Library::getBookByTitle)
52+
rtl::type().member<Library>().methodStatic(cxx::type::Library::fn::getBookByTitle::id).build(&Library::getBookByTitle)
5353
});
5454

5555
std::cout << "\n [t5]\trtl_tests::InitMirror::reflectingLibrary() ==> Done.\n";
@@ -265,18 +265,18 @@ namespace rtl_tests
265265

266266
rtl::type().member<Animal>().methodConst(cxx::type::Animal::fn::getFamilyName::id).build(&Animal::getFamilyName),
267267

268-
rtl::type().member<Animal>().method<const std::string&>(cxx::type::Animal::fn::setFamilyName::id).build(&Animal::setAnimalName),
268+
rtl::type().member<Animal>().method<const std::string&>(cxx::type::Animal::fn::setAnimalName::id).build(&Animal::setAnimalName),
269269

270270
rtl::type().member<Animal>().methodStatic<const std::string&>(cxx::type::Animal::fn::updateZooKeeper::id).build(&Animal::updateZooKeeper),
271271

272272
/* GCC fails to automatically identify the correct overloaded functor to pick. (non-const-lvalue-ref & rvalue as argument)
273273
we need to explicitly cast the functor like, static_cast<void(Animal::*)(std::string&)>(&Animal::setAnimalName).
274274
*/ rtl::type().member<Animal>()
275-
.method<std::string&>(cxx::type::Animal::fn::setFamilyName::id)
275+
.method<std::string&>(cxx::type::Animal::fn::setAnimalName::id)
276276
.build(static_cast<void(Animal::*)(std::string&)>(&Animal::setAnimalName)), //overloaded method, taking non-const lvalue reference as argument.
277277

278278
rtl::type().member<Animal>()
279-
.method<std::string&&>(cxx::type::Animal::fn::setFamilyName::id)
279+
.method<std::string&&>(cxx::type::Animal::fn::setAnimalName::id)
280280
.build(static_cast<void(Animal::*)(std::string&&)>(&Animal::setAnimalName)), //overloaded method, taking rvalue reference as argument.
281281

282282
rtl::type().member<Animal>()

RTLTestRunApp/src/FunctionalityTests/ConstMethodOverloadTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ namespace rtl_tests
262262
ASSERT_FALSE(animal.isEmpty());
263263

264264
// Retrieve the "setAnimalName" method.
265-
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setFamilyName::id);
265+
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setAnimalName::id);
266266
ASSERT_TRUE(oSetAnimalName);
267267
// Verify that the method has the correct signature for a const L-value reference.
268268
EXPECT_TRUE((oSetAnimalName->hasSignature<const std::string&>()));

RTLTestRunApp/src/FunctionalityTests/PerfectForwardingTests.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace rtl_tests
5050
ASSERT_FALSE(animal.isEmpty());
5151

5252
// Retrieve the "setAnimalName" method.
53-
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setFamilyName::id);
53+
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setAnimalName::id);
5454
ASSERT_TRUE(oSetAnimalName);
5555
// Verify that the method has the correct signature for an R-value reference.
5656
EXPECT_TRUE((oSetAnimalName->hasSignature<std::string&&>()));
@@ -92,7 +92,7 @@ namespace rtl_tests
9292
ASSERT_FALSE(animal.isEmpty());
9393

9494
// Retrieve the "setAnimalName" method.
95-
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setFamilyName::id);
95+
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setAnimalName::id);
9696
ASSERT_TRUE(oSetAnimalName);
9797
// Verify that the method has the correct signature for a non-const L-value reference.
9898
EXPECT_TRUE((oSetAnimalName->hasSignature<std::string&>()));
@@ -135,7 +135,7 @@ namespace rtl_tests
135135
ASSERT_FALSE(animal.isEmpty());
136136

137137
// Retrieve the "setAnimalName" method.
138-
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setFamilyName::id);
138+
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setAnimalName::id);
139139
ASSERT_TRUE(oSetAnimalName);
140140
// Verify that the method has the correct signature for a const L-value reference.
141141
EXPECT_TRUE((oSetAnimalName->hasSignature<const std::string&>()));
@@ -179,7 +179,7 @@ namespace rtl_tests
179179
ASSERT_FALSE(animal.isEmpty());
180180

181181
// Retrieve the "setAnimalName" method.
182-
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setFamilyName::id);
182+
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setAnimalName::id);
183183
ASSERT_TRUE(oSetAnimalName);
184184
// Verify that the method has the correct signature for an R-value reference.
185185
EXPECT_TRUE((oSetAnimalName->hasSignature<std::string&&>()));
@@ -221,7 +221,7 @@ namespace rtl_tests
221221
ASSERT_FALSE(animal.isEmpty());
222222

223223
// Retrieve the "setAnimalName" method.
224-
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setFamilyName::id);
224+
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setAnimalName::id);
225225
ASSERT_TRUE(oSetAnimalName);
226226
// Verify that the method has the correct signature for a non-const L-value reference.
227227
EXPECT_TRUE((oSetAnimalName->hasSignature<std::string&>()));
@@ -263,7 +263,7 @@ namespace rtl_tests
263263
ASSERT_FALSE(animal.isEmpty());
264264

265265
// Retrieve the "setAnimalName" method.
266-
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setFamilyName::id);
266+
optional<Method> oSetAnimalName = classAnimal->getMethod(cxx::type::Animal::fn::setAnimalName::id);
267267
ASSERT_TRUE(oSetAnimalName);
268268
// Verify that the method has the correct signature for a const L-value reference.
269269
EXPECT_TRUE((oSetAnimalName->hasSignature<const std::string&>()));

RTLTestRunApp/src/FunctionalityTests/ReflectionOpErrorCodeTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ namespace rtl_tests
234234
{
235235
{
236236
// Fetch the reflected Record for class 'Library'.
237-
optional<Record> classLibrary = cxx::mirror().getRecord(library::class_);
237+
optional<Record> classLibrary = cxx::mirror().getRecord(cxx::type::Library::id);
238238
ASSERT_TRUE(classLibrary);
239239
{
240240
// Attempt to create a reflected instance allocated on the heap.

0 commit comments

Comments
 (0)