(input int, shiftIn bool, expectedOutput int, expectedShiftOut bool, t *testing.T)
| 101 | } |
| 102 | |
| 103 | func testLeftShifter(input int, shiftIn bool, expectedOutput int, expectedShiftOut bool, t *testing.T) { |
| 104 | l := NewLeftShifter() |
| 105 | setWireOnComponent16(l, input) |
| 106 | l.Update(shiftIn) |
| 107 | if output := getValueOfOutput(l, arch.BUS_WIDTH); output != expectedOutput { |
| 108 | t.Logf("expected 0x%X got 0x%X", expectedOutput, output) |
| 109 | t.FailNow() |
| 110 | } |
| 111 | if l.shiftOut.Get() != expectedShiftOut { |
| 112 | t.FailNow() |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | func TestRightShifter(t *testing.T) { |
| 117 | //right shifter always applies the same output |
no test coverage detected