|
@ -100,12 +100,12 @@ func makeSwitchPair(t testing.TB, initSwitch func(int, *Switch) *Switch) (*Switc |
|
|
func initSwitchFunc(i int, sw *Switch) *Switch { |
|
|
func initSwitchFunc(i int, sw *Switch) *Switch { |
|
|
// Make two reactors of two channels each
|
|
|
// Make two reactors of two channels each
|
|
|
sw.AddReactor("foo", NewTestReactor([]*ChannelDescriptor{ |
|
|
sw.AddReactor("foo", NewTestReactor([]*ChannelDescriptor{ |
|
|
&ChannelDescriptor{ID: byte(0x00), Priority: 10}, |
|
|
|
|
|
&ChannelDescriptor{ID: byte(0x01), Priority: 10}, |
|
|
|
|
|
|
|
|
{ID: byte(0x00), Priority: 10}, |
|
|
|
|
|
{ID: byte(0x01), Priority: 10}, |
|
|
}, true)) |
|
|
}, true)) |
|
|
sw.AddReactor("bar", NewTestReactor([]*ChannelDescriptor{ |
|
|
sw.AddReactor("bar", NewTestReactor([]*ChannelDescriptor{ |
|
|
&ChannelDescriptor{ID: byte(0x02), Priority: 10}, |
|
|
|
|
|
&ChannelDescriptor{ID: byte(0x03), Priority: 10}, |
|
|
|
|
|
|
|
|
{ID: byte(0x02), Priority: 10}, |
|
|
|
|
|
{ID: byte(0x03), Priority: 10}, |
|
|
}, true)) |
|
|
}, true)) |
|
|
return sw |
|
|
return sw |
|
|
} |
|
|
} |
|
@ -295,12 +295,12 @@ func BenchmarkSwitches(b *testing.B) { |
|
|
s1, s2 := makeSwitchPair(b, func(i int, sw *Switch) *Switch { |
|
|
s1, s2 := makeSwitchPair(b, func(i int, sw *Switch) *Switch { |
|
|
// Make bar reactors of bar channels each
|
|
|
// Make bar reactors of bar channels each
|
|
|
sw.AddReactor("foo", NewTestReactor([]*ChannelDescriptor{ |
|
|
sw.AddReactor("foo", NewTestReactor([]*ChannelDescriptor{ |
|
|
&ChannelDescriptor{ID: byte(0x00), Priority: 10}, |
|
|
|
|
|
&ChannelDescriptor{ID: byte(0x01), Priority: 10}, |
|
|
|
|
|
|
|
|
{ID: byte(0x00), Priority: 10}, |
|
|
|
|
|
{ID: byte(0x01), Priority: 10}, |
|
|
}, false)) |
|
|
}, false)) |
|
|
sw.AddReactor("bar", NewTestReactor([]*ChannelDescriptor{ |
|
|
sw.AddReactor("bar", NewTestReactor([]*ChannelDescriptor{ |
|
|
&ChannelDescriptor{ID: byte(0x02), Priority: 10}, |
|
|
|
|
|
&ChannelDescriptor{ID: byte(0x03), Priority: 10}, |
|
|
|
|
|
|
|
|
{ID: byte(0x02), Priority: 10}, |
|
|
|
|
|
{ID: byte(0x03), Priority: 10}, |
|
|
}, false)) |
|
|
}, false)) |
|
|
return sw |
|
|
return sw |
|
|
}) |
|
|
}) |
|
|