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

[CR][WIP] Add effect tests #40064

Closed
wants to merge 20 commits into from
Closed

Conversation

wapcaplet
Copy link
Contributor

@wapcaplet wapcaplet commented May 1, 2020

Summary

SUMMARY: Infrastructure "Add tests for effects on creature and player"

Purpose of change

To have some tests on effects, how they work, and how they are applied to creatures / characters / monsters / players.

Describe the solution

Adds new tests (many still in progress or planned):

  • effect class and its functions: tests/effect_test.cpp
    • get/set/mod/mult duration, max duration, start time
    • get/set body part
    • intensity, max intensity, get/set/mod intensity
    • permanence/pause/unpause
    • effect modifiers (base_mods and scaling_mods, in progress)
  • creature effect functions: tests/creature_effect_test.cpp
    • adding, getting, modifying, removing effects
    • duration, body part, intensity of effects
    • immunity and resistance to effects
  • player effect functions (hardcoded effects): tests/player_effect_tests.cpp
    • bite antibiotic effects (working well, covers something that could be JSONized one day)
    • bite recovery (slow to execute, inaccurate, flaky)
    • mending, disabled (lengthy and don't have much to say)
    • lying down but cannot sleep

Describe alternatives you've considered

Tests without effects

Testing

tests/cata_test [effect]

Additional context

Work in progress. This is becoming much more in-depth and sizable than I originally planned, so I may break off the player hardcoded effect tests (the least complete, and least reliable of the bunch) into a separate PR.

Comments and suggestions are welcome; I am learning the effects system and documenting it as I go, and would prefer to avoid adding false or misleading information.

@ifreund ifreund added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Code: Tests Measurement, self-control, statistics, balancing. labels May 2, 2020
@wapcaplet wapcaplet changed the title [WIP] Add effect tests [CR][WIP] Add effect tests May 5, 2020
@wapcaplet
Copy link
Contributor Author

wapcaplet commented May 6, 2020

This is too large for one PR to contain now. Closing.

New PRs:
Part 1: #40222
Part 2: #40234
Part 3: #40270

@wapcaplet wapcaplet closed this May 6, 2020
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: Infrastructure / Style / Static Analysis Code internal infrastructure and style Code: Tests Measurement, self-control, statistics, balancing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants