Skip to content

Commit

Permalink
Add test case for batch bool update operators
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-sans-paille committed May 26, 2023
1 parent c23d503 commit c1470a2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/test_batch_bool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,32 @@ struct batch_bool_test
}
}

void test_update_operations() const
{
auto bool_g = xsimd::get_bool<batch_bool_type> {};
{
auto tmp = bool_g.half;
tmp |= bool_g.ihalf;
bool res = xsimd::all(tmp);
INFO("operator|=");
CHECK_UNARY(res);
}
{
auto tmp = bool_g.half;
tmp &= bool_g.half;
bool res = xsimd::all(tmp == bool_g.half);
INFO("operator&=");
CHECK_UNARY(res);
}
{
auto tmp = bool_g.half;
tmp ^= bool_g.ihalf;
bool res = xsimd::all(tmp);
INFO("operator^=");
CHECK_UNARY(res);
}
}

void test_mask() const
{
auto bool_g = xsimd::get_bool<batch_bool_type> {};
Expand Down Expand Up @@ -440,6 +466,8 @@ TEST_CASE_TEMPLATE("[xsimd batch bool]", B, BATCH_TYPES)

SUBCASE("bitwise operations") { Test.test_bitwise_operations(); }

SUBCASE("update operations") { Test.test_update_operations(); }

SUBCASE("mask") { Test.test_mask(); }
}
#endif

0 comments on commit c1470a2

Please sign in to comment.