diff --git a/event.go b/event.go index fb2f350..585c9a5 100644 --- a/event.go +++ b/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()) diff --git a/vex.go b/vex.go index 141d0f6..8aa207c 100644 --- a/vex.go +++ b/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 } diff --git a/vex_test.go b/vex_test.go index 45b8634..b1422b7 100644 --- a/vex_test.go +++ b/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")