コード例 #1
0
ファイル: test_machine.py プロジェクト: moreati/revelation
def test_flags_differ():
    expected = StateChecker(AZ=0, rfLR=0)
    got = new_state(AZ=1, rfLR=0)
    with pytest.raises(ValueError):
        expected.check(got)
    with pytest.raises(ValueError):
        expected.fp_check(got)
コード例 #2
0
ファイル: test_machine.py プロジェクト: moreati/revelation
def test_registers_differ():
    expected = StateChecker(rf0=0, rf1=float2bits(5.2), rfLR=0, rfDEBUGSTATUS=1)
    got = new_state(rf0=1)
    with pytest.raises(ValueError):
        expected.check(got)
    got = new_state(rf1=float2bits(5.200000001), rfDEBUGSTATUS=1)
    expected.fp_check(got)
    got = new_state(rf1=float2bits(5.3), rfLR=0, rfDEBUGSTATUS=1)
    with pytest.raises(ValueError):
        expected.fp_check(got)