From bbc8aa328940187639582e16c6e914dd78c0530a Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Sat, 18 May 2024 12:10:01 +0100 Subject: [PATCH] Update VariableReflectionTest.cpp --- .../CppInterOp/VariableReflectionTest.cpp | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/unittests/CppInterOp/VariableReflectionTest.cpp b/unittests/CppInterOp/VariableReflectionTest.cpp index 0bca0fd5c..6d0cbda37 100644 --- a/unittests/CppInterOp/VariableReflectionTest.cpp +++ b/unittests/CppInterOp/VariableReflectionTest.cpp @@ -93,14 +93,22 @@ TEST(VariableReflectionTest, GetVariableType) { #if __APPLE__ -#define maybeunused [[maybe_unused]] const int +#define CODE \ + int a; \ + [[maybe_unused]] const int N = 5; \ + class C { \ + public: \ + int a; \ + double b; \ + int *c; \ + int d; \ + static int s_a; \ + } c; \ + int C::s_a = 12; #else -typedef const int maybeunused; -#endif - #define CODE \ int a; \ - maybeunused N = 5; \ + const int N = 5; \ class C { \ public: \ int a; \ @@ -110,10 +118,8 @@ typedef const int maybeunused; static int s_a; \ } c; \ int C::s_a = 12; - -#if __APPLE__ -#undef maybeunused #endif + CODE TEST(VariableReflectionTest, GetVariableOffset) {