-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Added basic weakpoint unittest #51375
Conversation
This is my first time making a unit test for this project, and I'm not sure how to best handle checking this. Damage average makes since to me, but it looks like it can vary outside of the current epsilon, so bad random failures. I suppose I could make the func accept percent hit of weakpoints instead of average damage and then count the number of weakpoint hits and go from there? I do want to try and check the armor changes for weakpoints are being used though. Instead of having the programmer do the math, perhaps the test could directly parse the weakpoints json for the monster and calculate what it should be? |
It is always nice to see more unit tests. This looks good so far. One thing I would suggest is to make your
This is mainly a style issue, but I've found tests to be generally more readable when their expectations are structured in this way. This would also allow you a finer-grained control over the epsilon for each case. I see you already know the importance of |
At a glance, the latest changes look good to me. I like the idea of summarizing the results in a report structure; it helps with readability in the main test. The continuous integration test that’s failing (basic build and test / GCC) is a field test I’ve seen false alarms from before, so you shouldn’t have to worry about that, in case you were wondering. |
* Added basic weakpoint unittest * Using weakpoint hit access to get more specific and reliable
Summary
None
Purpose of change
Add a unit test for helping with #51305
Describe the solution
Added a unit test that works of statistical damage rates
Describe alternatives you've considered
Splitting into projectile testing and melee testing. Including project code had it go through the crit/good-hit/glance code which made doing damage aver checks hard.
Testing
Additional context