-
Notifications
You must be signed in to change notification settings - Fork 33
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
Get gtest 1.10.0 and parametrize tests #75
Conversation
Codecov Report
@@ Coverage Diff @@
## master #75 +/- ##
=======================================
Coverage 62.80% 62.80%
=======================================
Files 5 5
Lines 121 121
=======================================
Hits 76 76
Misses 45 45 Continue to review full report at Codecov.
|
int input = std::get<0>(GetParam()); | ||
int expected = std::get<1>(GetParam()); |
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.
std::get<0>(GetParam()):
is the C++ equivalent of python's a[0]
lol
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.
Thanks @antalszava, looks great!
I'm still not convinced of the benefits of this approach versus the "good old for loop", since for me there is also a cost to this approach of more complexity and less understandable code.
But maybe where this approach shines is in more advanced test cases. I'm good to go with this approach for now.
} | ||
TEST_P(Exp2TestFixture, CheckExp2Results) { | ||
int input = std::get<0>(GetParam()); | ||
int expected = std::get<1>(GetParam()); |
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 get any warnings when using an int
type? For me, it was giving a warning of comparing int
and size_t
.
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.
Yep, same here, warnings are emitted there.
@trbromley agreed that a |
Changes
v1.10.0
), see release notes