aboutsummaryrefslogtreecommitdiffstats
path: root/tests/math_pow_test.cpp
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-09-02 16:00:10 -0700
committerDan Albert <danalbert@google.com>2014-09-02 16:00:10 -0700
commit6676a7d4eea4cb042eed87fad06369765f074cec (patch)
tree61d1c3b467e02b24ac3184a18acf4337408320b4 /tests/math_pow_test.cpp
parent847e52b9b7bca9dee20e33d1006dfc23885e7494 (diff)
downloadandroid_bionic-6676a7d4eea4cb042eed87fad06369765f074cec.tar.gz
android_bionic-6676a7d4eea4cb042eed87fad06369765f074cec.tar.bz2
android_bionic-6676a7d4eea4cb042eed87fad06369765f074cec.zip
Start math tests with a clean fenv.
We always want the default floating point environment when running these tests. Bug: 17358010 Change-Id: I6ca2552e9f2d3e07d7b9dcaf0aec66905401c466
Diffstat (limited to 'tests/math_pow_test.cpp')
-rw-r--r--tests/math_pow_test.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/math_pow_test.cpp b/tests/math_pow_test.cpp
index c185424c7..a4caa36cc 100644
--- a/tests/math_pow_test.cpp
+++ b/tests/math_pow_test.cpp
@@ -16,6 +16,8 @@
#include <math.h>
+#include <fenv.h>
+
#include <gtest/gtest.h>
#if defined(__BIONIC__)
@@ -3291,6 +3293,7 @@ static pow_intel_data_t g_pow_intel_data[] = {
TEST(math_pow, pow_intel) {
#if defined(__BIONIC__)
+ fesetenv(FE_DFL_ENV);
for (size_t i = 0; i < sizeof(g_pow_intel_data)/sizeof(pow_intel_data_t); i++) {
EXPECT_DOUBLE_EQ(g_pow_intel_data[i].expected, pow(g_pow_intel_data[i].x_call_data, g_pow_intel_data[i].y_call_data)) << "Failed on element " << i;
}