Added call to resource update in arena update
parent
f838f53dda
commit
f6a36f9028
2
event.go
2
event.go
|
|
@ -356,7 +356,7 @@ func NewEventQueue(name string, description string, required_resources []Resourc
|
|||
err := LockResources(event)
|
||||
// start in new goroutine
|
||||
if err != nil {
|
||||
log.Printf("Failed to lock %s: %s", event.Name(), err)
|
||||
//log.Printf("Failed to lock %s: %s", event.Name(), err)
|
||||
} else {
|
||||
info.state = "running"
|
||||
log.Printf("EVENT_START: %s", event.Name())
|
||||
|
|
|
|||
1
vex.go
1
vex.go
|
|
@ -96,6 +96,7 @@ func (arena * Arena) lock(event Event) error {
|
|||
|
||||
func (arena * Arena) update(signal GraphSignal) {
|
||||
log.Printf("ARENA_UPDATE: %s", arena.Name())
|
||||
arena.BaseResource.update(signal)
|
||||
arena.signal <- signal
|
||||
}
|
||||
|
||||
|
|
|
|||
11
vex_test.go
11
vex_test.go
|
|
@ -150,14 +150,15 @@ func TestNewMatch(t *testing.T) {
|
|||
|
||||
go func(match_c chan GraphSignal) {
|
||||
(*graph_tester)(t).CheckForValue(match_c, "no update to match after starting 1")
|
||||
(*graph_tester)(t).CheckForNone(match_c, "update to match after starting 2")
|
||||
SendUpdate(match, NewSignal(nil, "queue_autonomous"))
|
||||
(*graph_tester)(t).CheckForValue(match_c, "no update to match after starting 2")
|
||||
(*graph_tester)(t).CheckForNone(match_c, "update to match after starting 3")
|
||||
SendUpdate(arena, NewSignal(nil, "queue_autonomous"))
|
||||
(*graph_tester)(t).CheckForValue(match_c, "no update to match after queueing autonomous 1")
|
||||
(*graph_tester)(t).CheckForValue(match_c, "no update to match after queueing autonomous 2")
|
||||
(*graph_tester)(t).CheckForNone(match_c, "update to match after queueing autonomous 3")
|
||||
auton_signal := NewSignal(nil, "start_autonomous")
|
||||
auton_signal.time = time.Now()
|
||||
SendUpdate(match, auton_signal)
|
||||
SendUpdate(arena, auton_signal)
|
||||
(*graph_tester)(t).CheckForValue(match_c, "no update to match after starting autonomous 1")
|
||||
(*graph_tester)(t).CheckForValue(match_c, "no update to match after starting autonomous 2")
|
||||
(*graph_tester)(t).CheckForNone(match_c, "update to match after starting autonomous 3")
|
||||
|
|
@ -165,13 +166,13 @@ func TestNewMatch(t *testing.T) {
|
|||
time.Sleep(time.Millisecond * 100)
|
||||
(*graph_tester)(t).CheckForValue(match_c, "no update to match after ending autonomous 1")
|
||||
(*graph_tester)(t).CheckForNone(match_c, "update to match after ending autonomous 2")
|
||||
SendUpdate(match, NewSignal(nil, "queue_driver"))
|
||||
SendUpdate(arena, NewSignal(nil, "queue_driver"))
|
||||
(*graph_tester)(t).CheckForValue(match_c, "no update to match after queueing driver 1")
|
||||
(*graph_tester)(t).CheckForValue(match_c, "no update to match after queueing driver 2")
|
||||
(*graph_tester)(t).CheckForNone(match_c, "update to match after queueing driver 3")
|
||||
driver_signal := NewSignal(nil, "start_driver")
|
||||
driver_signal.time = time.Now()
|
||||
SendUpdate(match, driver_signal)
|
||||
SendUpdate(arena, driver_signal)
|
||||
(*graph_tester)(t).CheckForValue(match_c, "no update to match after starting driver 1")
|
||||
(*graph_tester)(t).CheckForValue(match_c, "no update to match after starting driver 2")
|
||||
(*graph_tester)(t).CheckForNone(match_c, "update to match after starting driver 3")
|
||||
|
|
|
|||
Loading…
Reference in New Issue