Skip to content

Commit 28791f4

Browse files
authored
Merge pull request #47394 from smuzaffar/fix-testPhysicsToolsMVAComputer
Do not fail unit test due to undefined behavior
2 parents f2b1220 + 139e64b commit 28791f4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

PhysicsTools/MVAComputer/test/testBitSet.cppunit.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ void testBitSet::bitManipulationTest() {
5252
// so if neg != bit it is from the undefined
5353
// behavior
5454
CPPUNIT_ASSERT(bit(31) == 0x80000000);
55-
CPPUNIT_ASSERT(neg(31) == 0x80000000);
55+
//Print a warnings instead of failure due to undefined behavior
56+
//CPPUNIT_ASSERT(neg(31) == 0x80000000);
57+
if (neg(31) != 0x80000000) {
58+
std::cout << "Warning: Due to undefined behavior neg(31) != 0x80000000." << std::endl;
59+
}
5660
}
5761

5862
void testBitSet::multiWordTest() {

0 commit comments

Comments
 (0)