Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for health effect on healing rate #39742

Merged
merged 1 commit into from
Apr 21, 2020

Conversation

wapcaplet
Copy link
Contributor

@wapcaplet wapcaplet commented Apr 20, 2020

Summary

SUMMARY: Infrastructure "Add test for health effect on healing rate"

Purpose of change

To expand the unit tests of Character::healing_rate to include the effect of the "hidden" health stat.

Describe the solution

Adds a new test case with examples covering:

  • Normal health (0) gives normal healing rate when asleep
  • Bad health degrades healing when asleep (down to NO healing at -200 health)
  • Good health improves healing when asleep (up to 2x healing at +200 health)
  • Health has no effect on healing while awake

Also uses a couple new consts for the quality of rest factor (0 awake, 1 asleep) to make the tests a little more self-documenting.

Describe alternatives you've considered

An enigma wrapped in a burrito and smothered in "que? so?"

Testing

tests/cata_test [heal][health]

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Mechanics: Character / Player Character / Player mechanics labels Apr 20, 2020
@wapcaplet
Copy link
Contributor Author

Travis CI Android build says it's failing, but I don't see any errors, only this warning:

/home/travis/build/CleverRaven/Cataclysm-DDA/android/app/jni/src/lightmap.cpp:1247:32: warning: unknown warning group '-Wimplicit-int-float-conversion', ignored [-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wimplicit-int-float-conversion"
                               ^
1 warning generated.

The XCode build is failing on unrelated effective DPS tests.

@wapcaplet wapcaplet force-pushed the health-and-healing branch from e22ffb7 to f6399cf Compare April 21, 2020 02:22
@kevingranade kevingranade merged commit a27c935 into CleverRaven:master Apr 21, 2020
@wapcaplet wapcaplet deleted the health-and-healing branch April 25, 2020 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Mechanics: Character / Player Character / Player mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants