Skip to content

Commit c153824

Browse files
Improve output of batch_bool test
1 parent 058bf3b commit c153824

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

test/test_batch_bool.cpp

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,7 @@ struct batch_bool_test
318318
}
319319
// operator==
320320
{
321-
bool res = xsimd::all(bool_g.half == !bool_g.ihalf);
322-
CHECK_UNARY(res);
321+
CHECK_BATCH_EQ(bool_g.half, !bool_g.ihalf);
323322
}
324323
// operator &&
325324
{
@@ -360,39 +359,29 @@ struct batch_bool_test
360359
auto bool_g = xsimd::get_bool<batch_bool_type> {};
361360
// operator version
362361
{
363-
bool res = xsimd::all(bool_g.half == ~bool_g.ihalf);
364362
INFO("operator~");
365-
CHECK_UNARY(res);
363+
CHECK_BATCH_EQ(bool_g.half, ~bool_g.ihalf);
366364
}
367365
{
368-
bool res = xsimd::all((bool_g.half | bool_g.ihalf) == bool_g.all_true);
369-
// FIXME: this volatile statement is useless on its own, but it
370-
// workaround a bug in MSVC 2022 on avx2 that shows up in CI.
371-
volatile auto _ = ((bool_g.half | bool_g.ihalf) == bool_g.all_true);
372-
(void)_;
373366
INFO("operator|");
374-
CHECK_UNARY(res);
367+
CHECK_BATCH_EQ(bool_g.half | bool_g.ihalf, bool_g.all_true);
375368
}
376369
{
377-
bool res = xsimd::all((bool_g.half & bool_g.ihalf) == bool_g.all_false);
378370
INFO("operator&");
379-
CHECK_UNARY(res);
371+
CHECK_BATCH_EQ(bool_g.half & bool_g.ihalf, bool_g.all_false);
380372
}
381373
// free function version
382374
{
383-
bool res = xsimd::all(bool_g.half == xsimd::bitwise_not(bool_g.ihalf));
384375
INFO("bitwise_not");
385-
CHECK_UNARY(res);
376+
CHECK_BATCH_EQ(bool_g.half, xsimd::bitwise_not(bool_g.ihalf));
386377
}
387378
{
388-
bool res = xsimd::all(xsimd::bitwise_or(bool_g.half, bool_g.ihalf) == bool_g.all_true);
389379
INFO("bitwise_or");
390-
CHECK_UNARY(res);
380+
CHECK_BATCH_EQ(xsimd::bitwise_or(bool_g.half, bool_g.ihalf), bool_g.all_true);
391381
}
392382
{
393-
bool res = xsimd::all(xsimd::bitwise_and(bool_g.half, bool_g.ihalf) == bool_g.all_false);
394383
INFO("bitwise_and");
395-
CHECK_UNARY(res);
384+
CHECK_BATCH_EQ(xsimd::bitwise_and(bool_g.half, bool_g.ihalf), bool_g.all_false);
396385
}
397386
}
398387

@@ -409,9 +398,8 @@ struct batch_bool_test
409398
{
410399
auto tmp = bool_g.half;
411400
tmp &= bool_g.half;
412-
bool res = xsimd::all(tmp == bool_g.half);
413401
INFO("operator&=");
414-
CHECK_UNARY(res);
402+
CHECK_BATCH_EQ(tmp, bool_g.half);
415403
}
416404
{
417405
auto tmp = bool_g.half;
@@ -447,13 +435,12 @@ struct batch_bool_test
447435
auto bool_g = xsimd::get_bool<batch_bool_type> {};
448436
// eq
449437
{
450-
bool res = xsimd::all(xsimd::eq(bool_g.half, !bool_g.ihalf));
451-
CHECK_UNARY(res);
438+
CHECK_BATCH_EQ(bool_g.half, !bool_g.ihalf);
439+
CHECK_BATCH_EQ(xsimd::eq(bool_g.half, !bool_g.ihalf), bool_g.all_true);
452440
}
453441
// neq
454442
{
455-
bool res = xsimd::all(xsimd::neq(bool_g.half, bool_g.ihalf));
456-
CHECK_UNARY(res);
443+
CHECK_BATCH_EQ(xsimd::neq(bool_g.half, bool_g.ihalf), bool_g.all_true);
457444
}
458445
}
459446

0 commit comments

Comments
 (0)