Start math tests with a clean fenv.
We always want the default floating point environment when running these tests. Bug: 17358010 Change-Id: I6ca2552e9f2d3e07d7b9dcaf0aec66905401c466
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#if defined(__BIONIC__)
|
||||
@@ -1430,6 +1432,7 @@ static expf_intel_data_t g_expf_intel_data[] = {
|
||||
|
||||
TEST(math_expf, expf_intel) {
|
||||
#if defined(__BIONIC__)
|
||||
fesetenv(FE_DFL_ENV);
|
||||
for (size_t i = 0; i < sizeof(g_expf_intel_data)/sizeof(expf_intel_data_t); i++) {
|
||||
EXPECT_FLOAT_EQ(g_expf_intel_data[i].expected, expf(g_expf_intel_data[i].call_data)) << "Failed on element " << i;
|
||||
}
|
||||
|
Reference in New Issue
Block a user