(t *testing.T)
| 501 | } |
| 502 | |
| 503 | func TestBusOne(t *testing.T) { |
| 504 | inputBus := NewBus(arch.BUS_WIDTH) |
| 505 | outputBus := NewBus(arch.BUS_WIDTH) |
| 506 | b := NewBusOne(inputBus, outputBus) |
| 507 | for i := 0; i < 65536; i++ { |
| 508 | testBusOneReturnsCorrectResult(b, inputBus, outputBus, i, false, i, t) |
| 509 | //should always return 1 regardless of input |
| 510 | testBusOneReturnsCorrectResult(b, inputBus, outputBus, i, true, 1, t) |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | func testBusOneReturnsCorrectResult(b *BusOne, inputBus, outputBus *Bus, input int, enableBus1 bool, expectedOutput int, t *testing.T) { |
| 515 | setWireOnComponent16(inputBus, input) |
nothing calls this directly
no test coverage detected