Test CauseSplashDamage with circular shape.
A bit of code duplication but meh.
That one would have caught rP19969.
Details
-
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- /ps/trunk
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 2772 Build 4742: Vulcan Build (Windows) Jenkins Build 4741: Vulcan Build Jenkins Build 4740: arc lint + arc unit
Event Timeline
Test is good, it indeed catches the bug fixed by rP19969.
binaries/data/mods/public/simulation/components/tests/test_Damage.js | ||
---|---|---|
224 | Could be function TestCircularSplashDamage(), // Test Circular Splash Damage or stay as is. | |
230 | attacker and attackerOwner are used only once and the other playerIDs below don't get consts, so would be consistent to inline this as well. | |
243 | Nicer to read if data is inlined at cmpDamage.CauseSplashDamage(data), so that the reader doesn't have to lookup where it's used and what it should contain. | |
247 | unneeded parens | |
257 | Quotes for properties |
Readability: Very well.
Correctness: Tests pass.
Completeness: (Unit tests themselves inherently can't be complete, because one can always construct uncovered cases, for example a case with "killed": true.)
But the proposed test is complete with regards to it's intention, because the tests succeed with rP19969 and fail before.
Don't really see anything that the test could miss.
binaries/data/mods/public/simulation/components/tests/test_Damage.js | ||
---|---|---|
308 | no semicolon here (L308) |
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
http://jw:8080/job/phabricator/1842/ for more details.
Executing section Default... Executing section Source... Executing section JS... Executing section XML GUI... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/383/ for more details.
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
http://jw:8080/job/phabricator/1843/ for more details.
Executing section Default... Executing section Source... Executing section JS... Executing section XML GUI... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/384/ for more details.
Build has FAILED
Link to build: http://jw:8080/job/phabricator/1844/
See console output for more information: http://jw:8080/job/phabricator/1844/console
Executing section Default... Executing section Source... Executing section JS... Executing section XML GUI... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/385/ for more details.