MCPcopy Create free account
hub / github.com/djhworld/simple-computer / TestBusIsUpdatedOnRegisterEnable

Function TestBusIsUpdatedOnRegisterEnable

components/register_test.go:79–96  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

77}
78
79func TestBusIsUpdatedOnRegisterEnable(t *testing.T) {
80 b := NewBus(arch.BUS_WIDTH)
81 r := NewRegister("r", b, b)
82 setBus(b, 0x32F1)
83
84 r.Disable()
85 r.Set()
86
87 r.Update()
88 r.Unset()
89 setBus(b, 0x9028)
90 r.Enable()
91 r.Update()
92
93 if !checkBus(b, 0x32F1) {
94 t.Fail()
95 }
96}
97
98func TestOutputBusIsUsedWhenDifferentFromInputBus(t *testing.T) {
99 inputBus := NewBus(arch.BUS_WIDTH)

Callers

nothing calls this directly

Calls 9

DisableMethod · 0.95
SetMethod · 0.95
UpdateMethod · 0.95
UnsetMethod · 0.95
EnableMethod · 0.95
NewBusFunction · 0.85
NewRegisterFunction · 0.85
setBusFunction · 0.85
checkBusFunction · 0.70

Tested by

no test coverage detected