Skip to content

Commit 4531536

Browse files
committed
[bugfix] Fix unit tests
1 parent b3a6b8c commit 4531536

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

internal/app/controller/engine_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package controller
22

33
import (
44
"encoding/json"
5+
"github.com/RoboCup-SSL/ssl-game-controller/internal/app/config"
56
"io/ioutil"
67
"log"
78
"path/filepath"
@@ -39,8 +40,8 @@ func processTransitionFile(t *testing.T, fileName string) {
3940
if err := json.Unmarshal(bytes, &stateTransitions); err != nil {
4041
t.Fatal("Could not unmarshal state transitions:", err)
4142
}
42-
config := DefaultConfig().Game
43-
e := NewEngine(config)
43+
cfg := config.DefaultControllerConfig().Game
44+
e := NewEngine(cfg)
4445
e.TimeProvider = func() time.Time {
4546
ts, err := time.Parse("2006-01-02T15:04:05Z", "2006-01-02T15:04:05Z")
4647
if err != nil {

internal/app/controller/placementPos_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package controller
22

33
import (
4+
"github.com/RoboCup-SSL/ssl-game-controller/internal/app/config"
45
"github.com/RoboCup-SSL/ssl-game-controller/pkg/refproto"
56
"math"
67
"testing"
78
)
89

910
func TestEngine_BallPlacementPos(t *testing.T) {
10-
config := DefaultConfig()
11-
engine := NewEngine(config.Game)
11+
cfg := config.DefaultControllerConfig().Game
12+
engine := NewEngine(cfg)
1213
engine.State.TeamState[TeamYellow].OnPositiveHalf = true
1314
engine.State.TeamState[TeamBlue].OnPositiveHalf = false
1415
engine.Geometry.PlacementOffsetTouchLine = 0.2

0 commit comments

Comments
 (0)