-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature enhancement#118 times unit test #192
Conversation
…_Enhancement#118_TimesUnitTests
…ement#115_SW_SoilWater_UnitTests
…nt#115_SW_SoilWater_UnitTests
…ub.com/DrylandEcology/SOILWAT2 into feature_Enhancement#118_TimesUnitTests
test/test_Times.cc
Outdated
interpolate -> cloudcov[11] = 12; | ||
interpolate_monthlyValues(interpolate -> cloudcov, interpolate -> cloudcov_daily); | ||
EXPECT_DOUBLE_EQ(interpolate -> cloudcov_daily[365], 16.129032258064516); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an expectation for MAX_DAYS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, I forgot about the leap year!
How should I address #206 here? Checkout |
|
I didn't make any efforts to update it on my branch, the only way I see that it could have been updated is when I merged in |
How can that be done without doing a new commit? I have been able to find that is possible but no reliable source saying how to do it, the best I've found is "there is a button"; I don't see a button. |
…nt#115_SW_SoilWater_UnitTests
Codecov Report
@@ Coverage Diff @@
## master #192 +/- ##
==========================================
+ Coverage 60.68% 60.71% +0.02%
==========================================
Files 19 19
Lines 3584 3584
==========================================
+ Hits 2175 2176 +1
+ Misses 1409 1408 -1
Continue to review full report at Codecov.
|
@CaitlinA This branch is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Nathan,
I am only address the changes to the Times.c files here. I imagine there are differences in test_SW_Soilwater.cc on your other branch.
I only have comments about comments, not any of the test themselves.
The googletest folder changes, is this because the master updated the googletest submodule and you pulled down these changes to your branch?
test/test_Times.cc
Outdated
SW_SKY SW_Sky; | ||
SW_SKY *interpolate = &SW_Sky; | ||
unsigned int i; | ||
// set all monthlyValues all 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// set all monthly values to 10?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, since the test relies on the values here, I need to know exactly what the values are in order to test properly. Setting them all to 10 ensures this. I will add this to the comment to be more clear.
test/test_Times.cc
Outdated
for (i = 0; i < length(interpolate -> cloudcov); i++){ | ||
interpolate -> cloudcov[i] = 10; | ||
} | ||
interpolate -> cloudcov_daily[0] = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you have to specifically so cloudcov_daily[0] to 0 here? Should this be part of the functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that to illustrate that cloudcov_daily[0] does not change by setting it before the function call than testing that is still that value afterwords. The function does not modify this value so it is whatever it is before the call.
test/test_Times.cc
Outdated
Reset_SOILWAT2_after_UnitTest(); | ||
|
||
// change first value to 20 and test the changes | ||
interpolate -> cloudcov[0] = 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you actually test these changes? Could you clarify your message to something like change first value to a value to test if .....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, changing cloudcov[0] translates to changing the cloud cover in January, which changes the interpolation of all the days. I test these changes underneath this initialization.
test/test_Times.cc
Outdated
EXPECT_DOUBLE_EQ(interpolate -> cloudcov_daily[365], 15.161290322580644); | ||
// test last day on leap year | ||
EXPECT_DOUBLE_EQ(interpolate -> cloudcov_daily[MAX_DAYS], 15.483870967741936); | ||
// change december monthly value to ensure meaningful final interpolation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add more enter / space around new test conditions to clarify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean have a space for every EXPECT? Ie.
EXPECT_EQ
EXPECT_EQ
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No - I mean when ever you change the the input conditions, add more breaks. So enter after line 61.
Yes, the |
closes #118 |
What needs to be done now before we can merge the pull request and delete this branch? |
Closes #118 |
Merge into master unit test for Times.c function interpolate_monthlyValues.