j129: add entry-point check for the virtual-bullet overlay draw proc
This commit is contained in:
@@ -143,6 +143,20 @@ proc testEmit() =
|
||||
check "SVG carries the aim circles and the legend",
|
||||
svg.count("<circle") == 4 and "<text" in svg
|
||||
|
||||
proc testEntryPoint() =
|
||||
## The exact proc `ModularBot.run` calls when TR_VBULLET_DEBUG is on.
|
||||
clearGraphics()
|
||||
var t = makeTracker()
|
||||
let resolved = @[VbResolved(gunId: 1, aimX: AimX, aimY: AimY,
|
||||
actualX: AimX + 25.0, actualY: AimY, hit: false)]
|
||||
let n = drawVirtualBullets(t, resolved, 1, VbFilterSelected, 100,
|
||||
["HeadOn", "Linear", "Pattern"])
|
||||
let svg = svgOutput()
|
||||
check "entry point: 4 active bullets (8 prims) + 1 resolved (2 prims): " & $n,
|
||||
n == 10
|
||||
check "entry point emits 4 path lines + 1 miss line and a legend",
|
||||
svg.count("<line") == 5 and svg.count("<circle") == 5 and "<text" in svg
|
||||
|
||||
proc testColours() =
|
||||
check "gun 5 (Pattern) turret is green", gunTurretColor(5) == "#00CC44"
|
||||
check "gun 0 (HeadOn) turret is white", gunTurretColor(0) == "#FFFFFF"
|
||||
@@ -164,6 +178,7 @@ testFilter()
|
||||
testCap()
|
||||
testResolved()
|
||||
testEmit()
|
||||
testEntryPoint()
|
||||
testColours()
|
||||
|
||||
if failures > 0:
|
||||
|
||||
Reference in New Issue
Block a user