Beispiel #1
0
def test_positive():
    assert BinaryUtils.to_2cb(0) == '0' * 32
    assert BinaryUtils.to_2cb(1) == ('0' * 31 + '1')
    assert BinaryUtils.to_2cb(max_32_bits_signed) == ('0' + '1' * 31)
Beispiel #2
0
def test_negative():
    assert BinaryUtils.to_2cb(-1) == ('1' * 32)
    assert BinaryUtils.to_2cb(min_32_bits_signed) == ('1' + '0' * 31)