Beispiel #1
0
def test_shift_nw():
    mask = 0x0000001000000000
    assert bb.shift(mask, 'nw') == 0x0000200000000000
    assert bb.shift(mask, 'nw', times=2) == 0x0040000000000000
Beispiel #2
0
def test_shift_oob():
    assert bb.shift(0x80000000c0000000, 'w', times=20) == 0
    assert bb.shift(0x0000000000a00001, 'e', times=20) == 0
    assert bb.shift(0x1000000000000000, 'n', times=20) == 0
    assert bb.shift(0x0000000030000001, 's', times=20) == 0
Beispiel #3
0
def test_shift_se():
    mask = 0x0000001000000000
    assert bb.shift(mask, 'se') == 0x0000000008000000
    assert bb.shift(mask, 'se', times=2) == 0x0000000000040000
Beispiel #4
0
def test_shift_s():
    mask = 0x0000001000000000
    assert bb.shift(mask, 's') == 0x0000000010000000
    assert bb.shift(mask, 's', times=2) == 0x0000000000100000
Beispiel #5
0
def test_shift_n():
    mask = 0x0000800000000000
    assert bb.shift(mask, 'n') == 0x0080000000000000
    assert bb.shift(mask, 'n', times=2) == 0x8000000000000000
Beispiel #6
0
def test_shift_oob():
    assert bb.shift(0x80000000C0000000, "w", times=20) == 0
    assert bb.shift(0x0000000000A00001, "e", times=20) == 0
    assert bb.shift(0x1000000000000000, "n", times=20) == 0
    assert bb.shift(0x0000000030000001, "s", times=20) == 0
Beispiel #7
0
def test_shift_nw():
    mask = 0x0000001000000000
    assert bb.shift(mask, "nw") == 0x0000200000000000
    assert bb.shift(mask, "nw", times=2) == 0x0040000000000000
Beispiel #8
0
def test_shift_s():
    mask = 0x0000001000000000
    assert bb.shift(mask, "s") == 0x0000000010000000
    assert bb.shift(mask, "s", times=2) == 0x0000000000100000
Beispiel #9
0
def test_shift_se():
    mask = 0x0000001000000000
    assert bb.shift(mask, "se") == 0x0000000008000000
    assert bb.shift(mask, "se", times=2) == 0x0000000000040000