Skip to content

Commit 2aceb7a

Browse files
Extra validation for comparison operator
Previous implementation was not checking the equality part of greater-or-equal and less-or-equal operators.
1 parent bde4df7 commit 2aceb7a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/test_batch.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,11 @@ struct batch_test
477477
auto res = batch_lhs() < batch_rhs();
478478
INFO("batch < batch");
479479
CHECK_BATCH_EQ(res, expected);
480+
481+
std::fill(expected.begin(), expected.end(), false);
482+
res = batch_lhs() < batch_lhs();
483+
INFO("batch < (self)");
484+
CHECK_BATCH_EQ(res, expected);
480485
}
481486
// batch < scalar
482487
{
@@ -502,6 +507,11 @@ struct batch_test
502507
auto res = batch_lhs() <= batch_rhs();
503508
INFO("batch <= batch");
504509
CHECK_BATCH_EQ(res, expected);
510+
511+
std::fill(expected.begin(), expected.end(), true);
512+
res = batch_lhs() <= batch_lhs();
513+
INFO("batch < (self)");
514+
CHECK_BATCH_EQ(res, expected);
505515
}
506516
// batch <= scalar
507517
{
@@ -527,6 +537,11 @@ struct batch_test
527537
auto res = batch_lhs() > batch_rhs();
528538
INFO("batch > batch");
529539
CHECK_BATCH_EQ(res, expected);
540+
541+
std::fill(expected.begin(), expected.end(), false);
542+
res = batch_lhs() > batch_lhs();
543+
INFO("batch > (self)");
544+
CHECK_BATCH_EQ(res, expected);
530545
}
531546
// batch > scalar
532547
{
@@ -551,6 +566,11 @@ struct batch_test
551566
auto res = batch_lhs() >= batch_rhs();
552567
INFO("batch >= batch");
553568
CHECK_BATCH_EQ(res, expected);
569+
570+
std::fill(expected.begin(), expected.end(), true);
571+
res = batch_lhs() >= batch_lhs();
572+
INFO("batch >= (self)");
573+
CHECK_BATCH_EQ(res, expected);
554574
}
555575
// batch >= scalar
556576
{

0 commit comments

Comments
 (0)