Skip to content

Commit e62bd2c

Browse files
committed
tests: resolve unused variable using Apple
1 parent 6c3f64c commit e62bd2c

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

tests/test_helpers.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,12 @@ TEST(TestHelpers, robotSeriesString)
150150

151151
TEST(TestHelpers, setThreadAffinity_basic)
152152
{
153-
pthread_t thread = pthread_self();
154153
#ifdef _WIN32
154+
pthread_t thread = pthread_self();
155155
DWORD_PTR mask = (1ULL << 0);
156156
EXPECT_TRUE(setThreadAffinity(thread, mask));
157157
#elif __linux__
158+
pthread_t thread = pthread_self();
158159
cpu_set_t cpuset;
159160
CPU_ZERO(&cpuset);
160161
CPU_SET(0, &cpuset);
@@ -164,11 +165,12 @@ TEST(TestHelpers, setThreadAffinity_basic)
164165

165166
TEST(TestHelpers, setThreadAffinity_mult)
166167
{
167-
pthread_t thread = pthread_self();
168168
#ifdef _WIN32
169+
pthread_t thread = pthread_self();
169170
DWORD_PTR mask = (1ULL << 0) | (1ULL << 1);
170171
EXPECT_TRUE(setThreadAffinity(thread, mask));
171172
#elif __linux__
173+
pthread_t thread = pthread_self();
172174
cpu_set_t cpuset;
173175
CPU_ZERO(&cpuset);
174176
CPU_SET(0, &cpuset);
@@ -179,11 +181,12 @@ TEST(TestHelpers, setThreadAffinity_mult)
179181

180182
TEST(TestHelpers, setThreadAffinity_invalid)
181183
{
182-
pthread_t thread = pthread_self();
183184
#ifdef _WIN32
185+
pthread_t thread = pthread_self();
184186
uint64_t invalid_mask = 1ULL << 63;
185187
EXPECT_FALSE(setThreadAffinity(thread, invalid_mask));
186188
#elif __linux__
189+
pthread_t thread = pthread_self();
187190
cpu_set_t cpuset;
188191
CPU_ZERO(&cpuset);
189192
CPU_SET(63, &cpuset);
@@ -207,10 +210,11 @@ TEST(TestHelpers, setThreadAffinity_invalidHandle)
207210

208211
TEST(TestHelpers, setThreadAffinity_empty)
209212
{
210-
pthread_t thread = pthread_self();
211213
#ifdef _WIN32
214+
pthread_t thread = pthread_self();
212215
EXPECT_FALSE(setThreadAffinity(thread, 0));
213216
#elif __linux__
217+
pthread_t thread = pthread_self();
214218
cpu_set_t cpuset;
215219
CPU_ZERO(&cpuset);
216220
EXPECT_FALSE(setThreadAffinity(thread, cpuset));

0 commit comments

Comments
 (0)