Skip to content

Commit e5ead75

Browse files
committed
bitvec test should be & ^ | not some arbitary bool expression
1 parent e43877d commit e5ead75

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/0026.container/0014.bitvec/bitvec.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ inline void test_bitvec_bitops()
539539
::fast_io::bitvec c = a & b;
540540
for (::std::size_t i{}; i != 256u; ++i)
541541
{
542-
bool expected = ((i & 1u) != 0u) && ((i & 3u) == 2u);
542+
bool expected = a.test(i) && b.test(i);
543543
if (c.test(i) != expected)
544544
{
545545
::fast_io::io::panicln("ERROR: operator& mismatch at index ", i);
@@ -550,7 +550,7 @@ inline void test_bitvec_bitops()
550550
::fast_io::bitvec d = a | b;
551551
for (::std::size_t i{}; i != 256u; ++i)
552552
{
553-
bool expected = a.test(i) && b.test(i);
553+
bool expected = a.test(i) || b.test(i);
554554
if (d.test(i) != expected)
555555
{
556556
::fast_io::io::panicln("ERROR: operator| mismatch at index ", i);
@@ -561,7 +561,7 @@ inline void test_bitvec_bitops()
561561
::fast_io::bitvec e = a ^ b;
562562
for (::std::size_t i{}; i != 256u; ++i)
563563
{
564-
bool expected = ((i & 1u) != 0u) ^ ((i & 3u) == 2u);
564+
bool expected = a.test(i) ^ b.test(i);
565565
if (e.test(i) != expected)
566566
{
567567
::fast_io::io::panicln("ERROR: operator^ mismatch at index ", i);

0 commit comments

Comments
 (0)