Checks the state of all configured buttons against the expected state.
(msg string, t *testing.T, expect [6]btnState)
| 70 | |
| 71 | // Checks the state of all configured buttons against the expected state. |
| 72 | func runBtnChecks(msg string, t *testing.T, expect [6]btnState) { |
| 73 | for i, cfg := range btnSimpleCfg { |
| 74 | exp := expect[i] |
| 75 | btn := Input.Button(cfg.Name) |
| 76 | if exp.down != btn.Down() { |
| 77 | t.Error(msg, " Invalid on: ", cfg.Name, " - Down") |
| 78 | } |
| 79 | if exp.justUp != btn.JustReleased() { |
| 80 | t.Error(msg, " Invalid on: ", cfg.Name, " - Just Up") |
| 81 | } |
| 82 | if exp.justDown != btn.JustPressed() { |
| 83 | t.Error(msg, " Invalid on: ", cfg.Name, " - Just Down") |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | // Test configured axes using a single key on one button. |
| 89 | func TestButtonSimple(t *testing.T) { |
no test coverage detected