package seeddefs import "testing" func TestTracksFitInRoom(t *testing.T) { const ( roomLen = 4.5 roomWid = 3.2 ) for _, tr := range DefaultTracks() { if tr.Bounds.LengthM > roomLen { t.Errorf("track %s: length %.3f m exceeds 4.5 m", tr.ID, tr.Bounds.LengthM) } if tr.Bounds.WidthM > roomWid { t.Errorf("track %s: width %.3f m exceeds 3.2 m", tr.ID, tr.Bounds.WidthM) } if len(tr.Centerline) < 8 { t.Errorf("track %s: too few waypoints (%d)", tr.ID, len(tr.Centerline)) } t.Logf("%-30s %5.2fm x %5.2fm %2d waypoints", tr.ID, tr.Bounds.LengthM, tr.Bounds.WidthM, len(tr.Centerline)) } } func TestCarsValid(t *testing.T) { for _, c := range DefaultCars() { if c.LengthMm < 200 || c.LengthMm > 260 { t.Errorf("car %s: length %.0f mm out of F1 1/24 range (200..260)", c.ID, c.LengthMm) } if c.WidthMm < 70 || c.WidthMm > 100 { t.Errorf("car %s: width %.0f mm out of F1 1/24 range", c.ID, c.WidthMm) } if c.Motor.PowerW < 500000 { t.Errorf("car %s: power %.0f W too low for F1 PU", c.ID, c.Motor.PowerW) } t.Logf("%-35s %dx%dx%d mm, %d W, %d m/s", c.ID, int(c.LengthMm), int(c.WidthMm), int(c.HeightMm), int(c.Motor.PowerW), int(c.TopSpeedMs)) } }