From c3489d9c510542d21f5762e3d9c7aecf7d327165 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Fri, 17 May 2024 21:05:10 +0100 Subject: [PATCH] Attempt fix --- unittests/CppInterOp/ScopeReflectionTest.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/unittests/CppInterOp/ScopeReflectionTest.cpp b/unittests/CppInterOp/ScopeReflectionTest.cpp index 28cc10bd5..207ce6f3b 100644 --- a/unittests/CppInterOp/ScopeReflectionTest.cpp +++ b/unittests/CppInterOp/ScopeReflectionTest.cpp @@ -660,24 +660,17 @@ TEST(ScopeReflectionTest, IsSubclass) { TEST(ScopeReflectionTest, GetBaseClassOffset) { std::vector Decls; -#define UNUSED(x) (void)(x) -#define Stringify(s) Stringifyx(s) -#define Stringifyx(...) #__VA_ARGS__ -#define CODE \ - class A { int m_a; void foo(const int m_a) {UNUSED(m_a);}}; \ + std::string code = R"( + class A { int m_a; }; \ class B { int m_b; }; \ class C : virtual A, virtual B { int m_c; }; \ class D : virtual A, virtual B, public C { int m_d; }; \ class E : public A, public B { int m_e; }; \ class F : public A { int m_f; }; \ class G : public F { int m_g; }; + )"; - CODE; - - GetAllTopLevelDecls(Stringify(CODE), Decls); -#undef Stringifyx -#undef Stringify -#undef CODE + GetAllTopLevelDecls(CODE, Decls); auto *c = new C(); EXPECT_EQ(Cpp::GetBaseClassOffset(Decls[2], Decls[0]), (char *)(A*)c - (char *)c);