-
Notifications
You must be signed in to change notification settings - Fork 38
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
test: Add proper f{32,64}_add tests #467
Conversation
d15f8b8
to
8b963e4
Compare
Codecov Report
@@ Coverage Diff @@
## master #467 +/- ##
========================================
Coverage 99.53% 99.53%
========================================
Files 54 54
Lines 15821 15926 +105
========================================
+ Hits 15747 15852 +105
Misses 74 74 |
3524d8e
to
abc3358
Compare
017c219
to
9e55d85
Compare
eb547f4
to
1a740b6
Compare
@@ -121,9 +92,21 @@ template <typename T> | |||
class execute_floating_point_types : public testing::Test | |||
{ | |||
protected: | |||
using L = typename FP<T>::Limits; | |||
|
|||
// The q is any positive floating-point value without zeros, infinities and NaNs. |
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 "q"?
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.
The meta variable q is used to range over (signless) rational magnitudes, excluding nan or ∞.
https://webassembly.github.io/spec/core/exec/numerics.html#numerics
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.
That includes zeroes, but it's not so important
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 would call these two maybe positive_special_values
and ordered_special_values
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.
Done.
EXPECT_THAT(exec(-TypeParam{0.0}, Limits::infinity()), Result(Limits::infinity())); | ||
EXPECT_THAT(exec(-TypeParam{0.0}, -Limits::infinity()), Result(-Limits::infinity())); | ||
|
||
for (const auto q : this->q_values) |
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.
for (const auto q : this->q_values) | |
for (const auto q : q_values) |
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.
Does not work because of whatever is under GTest macros. You need this->
or execute_floating_point_types::
.
class execute_floating_point_types : public testing::Test | ||
{ | ||
protected: | ||
using L = typename FP<T>::Limits; |
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 would prefer this to be Limits
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.
It cannot be because it will conflict of other using Limits
in the tests.
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 can't it use this one in the tests?
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.
Because each TYPED_TEST
inherits a template execute_floating_point_types<TypeParam>
you have to access it as typename execute_floating_point_types<TypeParam>::Limits
. Not very short.
50f007b
to
403e427
Compare
It adds/fixes some testing helpers for floating point instructions.
Then it adds wasm spec-driver tests for
![image](https://user-images.githubusercontent.com/573380/89800909-b1bb2800-db2f-11ea-81c8-1f2c8c143282.png)
fadd
, i.e. it adds checks for these points from the definition: