|
|
|
@ -149,37 +149,31 @@ 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).CheckForValue(match_c, "no update to match after starting 2")
|
|
|
|
|
(*graph_tester)(t).CheckForNone(match_c, "update to match after starting 3")
|
|
|
|
|
(*graph_tester)(t).WaitForValue(match_c, "event_start", 1*time.Second, "no event_start")
|
|
|
|
|
(*graph_tester)(t).CheckForNone(match_c, "update to match after starting")
|
|
|
|
|
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")
|
|
|
|
|
(*graph_tester)(t).WaitForValue(match_c, "autonomous_queued", 1*time.Second, "no autonomous_queued")
|
|
|
|
|
(*graph_tester)(t).CheckForNone(match_c, "update to match after queueing autonomous")
|
|
|
|
|
auton_signal := NewSignal(nil, "start_autonomous")
|
|
|
|
|
auton_signal.time = time.Now()
|
|
|
|
|
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")
|
|
|
|
|
(*graph_tester)(t).WaitForValue(match_c, "autonomous_running", 1*time.Second, "no autonomous_running")
|
|
|
|
|
(*graph_tester)(t).CheckForNone(match_c, "update to match after starting autonomous")
|
|
|
|
|
time.Sleep(TEMP_AUTON_TIME)
|
|
|
|
|
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")
|
|
|
|
|
(*graph_tester)(t).WaitForValue(match_c, "autonomous_done", 6*time.Second, "no autonomous_done")
|
|
|
|
|
(*graph_tester)(t).CheckForNone(match_c, "update to match after ending autonomous")
|
|
|
|
|
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")
|
|
|
|
|
(*graph_tester)(t).WaitForValue(match_c, "driver_queued", 1*time.Second, "no driver_queued")
|
|
|
|
|
(*graph_tester)(t).CheckForNone(match_c, "update to match after queueing driver")
|
|
|
|
|
driver_signal := NewSignal(nil, "start_driver")
|
|
|
|
|
driver_signal.time = time.Now()
|
|
|
|
|
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")
|
|
|
|
|
(*graph_tester)(t).WaitForValue(match_c, "driver_running", 1*time.Second, "no driver_running")
|
|
|
|
|
(*graph_tester)(t).CheckForNone(match_c, "update to match after starting driver")
|
|
|
|
|
time.Sleep(TEMP_DRIVE_TIME)
|
|
|
|
|
time.Sleep(time.Millisecond * 100)
|
|
|
|
|
(*graph_tester)(t).CheckForValue(match_c, "no update to match after game done 1")
|
|
|
|
|
(*graph_tester)(t).CheckForValue(match_c, "no update to match after game done 2")
|
|
|
|
|
(*graph_tester)(t).WaitForValue(match_c, "driver_done", 1*time.Second, "no driver_done")
|
|
|
|
|
(*graph_tester)(t).CheckForNone(match_c, "update to match after game done 3")
|
|
|
|
|
}(match_c)
|
|
|
|
|
|
|
|
|
|