testBitSet: demo bug in BitSet::or_and
Incorrect handling of wordsInUse truncates if RHS (b1 & b2) is shorter than LHS (b3).
This commit is contained in:
@@ -146,6 +146,15 @@ static void testOperators()
|
||||
b1.or_and(b2, b3);
|
||||
str = toString(b1);
|
||||
testOk1(str == "{2, 128}");
|
||||
|
||||
b1.clear(); b1.set(1);
|
||||
b2.clear();
|
||||
b3.clear(); b3.set(1);
|
||||
std::cout<<"# "<<toString(b3)<<" |= "<<toString(b1)<<" & "<<toString(b2)<<"\n";
|
||||
b3.or_and(b1, b2);
|
||||
testTodoBegin("Bug in or_and");
|
||||
testOk(toString(b3) == "{1}", "%s == {1}", toString(b3).c_str());
|
||||
testTodoEnd();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user