diff options
author | Dan Albert <danalbert@google.com> | 2014-09-02 16:00:10 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2014-09-02 16:00:10 -0700 |
commit | 6676a7d4eea4cb042eed87fad06369765f074cec (patch) | |
tree | 61d1c3b467e02b24ac3184a18acf4337408320b4 | |
parent | 847e52b9b7bca9dee20e33d1006dfc23885e7494 (diff) | |
download | android_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
-rw-r--r-- | tests/math_cos_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_cosf_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_exp_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_expf_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_log_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_logf_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_pow_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_powf_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_sin_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_sincos_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_sincosf_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_sinf_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_tan_test.cpp | 3 | ||||
-rw-r--r-- | tests/math_tanf_test.cpp | 3 |
14 files changed, 42 insertions, 0 deletions
diff --git a/tests/math_cos_test.cpp b/tests/math_cos_test.cpp index c0a2d82c7..4917e87fa 100644 --- a/tests/math_cos_test.cpp +++ b/tests/math_cos_test.cpp @@ -16,6 +16,8 @@ #include <math.h> +#include <fenv.h> + #include <gtest/gtest.h> #if defined(__BIONIC__) @@ -5634,6 +5636,7 @@ static cos_intel_data_t g_cos_intel_data[] = { TEST(math_cos, cos_intel) { #if defined(__BIONIC__) + fesetenv(FE_DFL_ENV); for (size_t i = 0; i < sizeof(g_cos_intel_data)/sizeof(cos_intel_data_t); i++) { EXPECT_DOUBLE_EQ(g_cos_intel_data[i].expected, cos(g_cos_intel_data[i].call_data)) << "Failed on element " << i; } diff --git a/tests/math_cosf_test.cpp b/tests/math_cosf_test.cpp index ea95ff317..8520c1dcc 100644 --- a/tests/math_cosf_test.cpp +++ b/tests/math_cosf_test.cpp @@ -16,6 +16,8 @@ #include <math.h> +#include <fenv.h> + #include <gtest/gtest.h> #if defined(__BIONIC__) @@ -4346,6 +4348,7 @@ static cosf_intel_data_t g_cosf_intel_data[] = { TEST(math_cosf, cosf_intel) { #if defined(__BIONIC__) + fesetenv(FE_DFL_ENV); for (size_t i = 0; i < sizeof(g_cosf_intel_data)/sizeof(cosf_intel_data_t); i++) { EXPECT_FLOAT_EQ(g_cosf_intel_data[i].expected, cosf(g_cosf_intel_data[i].call_data)) << "Failed on element " << i; } diff --git a/tests/math_exp_test.cpp b/tests/math_exp_test.cpp index beb258497..c9c6ad594 100644 --- a/tests/math_exp_test.cpp +++ b/tests/math_exp_test.cpp @@ -16,6 +16,8 @@ #include <math.h> +#include <fenv.h> + #include <gtest/gtest.h> #if defined(__BIONIC__) @@ -1966,6 +1968,7 @@ static exp_intel_data_t g_exp_intel_data[] = { TEST(math_exp, exp_intel) { #if defined(__BIONIC__) + fesetenv(FE_DFL_ENV); for (size_t i = 0; i < sizeof(g_exp_intel_data)/sizeof(exp_intel_data_t); i++) { EXPECT_DOUBLE_EQ(g_exp_intel_data[i].expected, exp(g_exp_intel_data[i].call_data)) << "Failed on element " << i; } diff --git a/tests/math_expf_test.cpp b/tests/math_expf_test.cpp index 257aa26bb..30bc94690 100644 --- a/tests/math_expf_test.cpp +++ b/tests/math_expf_test.cpp @@ -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; } diff --git a/tests/math_log_test.cpp b/tests/math_log_test.cpp index da2a848e4..4f136a774 100644 --- a/tests/math_log_test.cpp +++ b/tests/math_log_test.cpp @@ -16,6 +16,8 @@ #include <math.h> +#include <fenv.h> + #include <gtest/gtest.h> #if defined(__BIONIC__) @@ -1666,6 +1668,7 @@ static log_intel_data_t g_log_intel_data[] = { TEST(math_log, log_intel) { #if defined(__BIONIC__) + fesetenv(FE_DFL_ENV); for (size_t i = 0; i < sizeof(g_log_intel_data)/sizeof(log_intel_data_t); i++) { EXPECT_DOUBLE_EQ(g_log_intel_data[i].expected, log(g_log_intel_data[i].call_data)) << "Failed on element " << i; } diff --git a/tests/math_logf_test.cpp b/tests/math_logf_test.cpp index e5d0921d8..ca02095c1 100644 --- a/tests/math_logf_test.cpp +++ b/tests/math_logf_test.cpp @@ -16,6 +16,8 @@ #include <math.h> +#include <fenv.h> + #include <gtest/gtest.h> #if defined(__BIONIC__) @@ -1318,6 +1320,7 @@ static logf_intel_data_t g_logf_intel_data[] = { TEST(math_logf, logf_intel) { #if defined(__BIONIC__) + fesetenv(FE_DFL_ENV); for (size_t i = 0; i < sizeof(g_logf_intel_data)/sizeof(logf_intel_data_t); i++) { EXPECT_FLOAT_EQ(g_logf_intel_data[i].expected, logf(g_logf_intel_data[i].call_data)) << "Failed on element " << i; } 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; } diff --git a/tests/math_powf_test.cpp b/tests/math_powf_test.cpp index f77b23a4b..72726447f 100644 --- a/tests/math_powf_test.cpp +++ b/tests/math_powf_test.cpp @@ -16,6 +16,8 @@ #include <math.h> +#include <fenv.h> + #include <gtest/gtest.h> #if defined(__BIONIC__) @@ -2779,6 +2781,7 @@ static powf_intel_data_t g_powf_intel_data[] = { TEST(math_powf, powf_intel) { #if defined(__BIONIC__) + fesetenv(FE_DFL_ENV); for (size_t i = 0; i < sizeof(g_powf_intel_data)/sizeof(powf_intel_data_t); i++) { EXPECT_FLOAT_EQ(g_powf_intel_data[i].expected, powf(g_powf_intel_data[i].x_call_data, g_powf_intel_data[i].y_call_data)) << "Failed on element " << i; } diff --git a/tests/math_sin_test.cpp b/tests/math_sin_test.cpp index ffa43409d..509642ca8 100644 --- a/tests/math_sin_test.cpp +++ b/tests/math_sin_test.cpp @@ -16,6 +16,8 @@ #include <math.h> +#include <fenv.h> + #include <gtest/gtest.h> #if defined(__BIONIC__) @@ -5786,6 +5788,7 @@ static sin_intel_data_t g_sin_intel_data[] = { TEST(math_sin, sin_intel) { #if defined(__BIONIC__) + fesetenv(FE_DFL_ENV); for (size_t i = 0; i < sizeof(g_sin_intel_data)/sizeof(sin_intel_data_t); i++) { EXPECT_DOUBLE_EQ(g_sin_intel_data[i].expected, sin(g_sin_intel_data[i].call_data)) << "Failed on element " << i; } diff --git a/tests/math_sincos_test.cpp b/tests/math_sincos_test.cpp index f2e30dea9..4093fb9df 100644 --- a/tests/math_sincos_test.cpp +++ b/tests/math_sincos_test.cpp @@ -18,6 +18,8 @@ #include <math.h> +#include <fenv.h> + #include <gtest/gtest.h> #if defined(__BIONIC__) @@ -4778,6 +4780,7 @@ static sincos_intel_data_t g_sincos_intel_data[] = { TEST(math_sincos, sincos_intel) { #if defined(__BIONIC__) + fesetenv(FE_DFL_ENV); for (size_t i = 0; i < sizeof(g_sincos_intel_data)/sizeof(sincos_intel_data_t); i++) { double dsin, dcos; sincos(g_sincos_intel_data[i].call_data, &dsin, &dcos); diff --git a/tests/math_sincosf_test.cpp b/tests/math_sincosf_test.cpp index c1a32c9e0..d30f72e90 100644 --- a/tests/math_sincosf_test.cpp +++ b/tests/math_sincosf_test.cpp @@ -16,6 +16,8 @@ #include <math.h> +#include <fenv.h> + #include <gtest/gtest.h> #if defined(__BIONIC__) @@ -4646,6 +4648,7 @@ static sincosf_intel_data_t g_sincosf_intel_data[] = { TEST(math_sincosf, sincosf_intel) { #if defined(__BIONIC__) + fesetenv(FE_DFL_ENV); for (size_t i = 0; i < sizeof(g_sincosf_intel_data)/sizeof(sincosf_intel_data_t); i++) { float fsin, fcos; sincosf(g_sincosf_intel_data[i].call_data, &fsin, &fcos); diff --git a/tests/math_sinf_test.cpp b/tests/math_sinf_test.cpp index bb1e2c953..0c2e6f172 100644 --- a/tests/math_sinf_test.cpp +++ b/tests/math_sinf_test.cpp @@ -16,6 +16,8 @@ #include <math.h> +#include <fenv.h> + #include <gtest/gtest.h> #if defined(__BIONIC__) @@ -4386,6 +4388,7 @@ static sinf_intel_data_t g_sinf_intel_data[] = { TEST(math_sinf, sinf_intel) { #if defined(__BIONIC__) + fesetenv(FE_DFL_ENV); for (size_t i = 0; i < sizeof(g_sinf_intel_data)/sizeof(sinf_intel_data_t); i++) { EXPECT_FLOAT_EQ(g_sinf_intel_data[i].expected, sinf(g_sinf_intel_data[i].call_data)) << "Failed on element " << i; } diff --git a/tests/math_tan_test.cpp b/tests/math_tan_test.cpp index 68620194a..e555ef3c9 100644 --- a/tests/math_tan_test.cpp +++ b/tests/math_tan_test.cpp @@ -16,6 +16,8 @@ #include <math.h> +#include <fenv.h> + #include <gtest/gtest.h> #if defined(__BIONIC__) @@ -5194,6 +5196,7 @@ static tan_intel_data_t g_tan_intel_data[] = { TEST(math_tan, tan_intel) { #if defined(__BIONIC__) + fesetenv(FE_DFL_ENV); for (size_t i = 0; i < sizeof(g_tan_intel_data)/sizeof(tan_intel_data_t); i++) { EXPECT_DOUBLE_EQ(g_tan_intel_data[i].expected, tan(g_tan_intel_data[i].call_data)) << "Failed on element " << i; } diff --git a/tests/math_tanf_test.cpp b/tests/math_tanf_test.cpp index 9319046cb..db04116b5 100644 --- a/tests/math_tanf_test.cpp +++ b/tests/math_tanf_test.cpp @@ -16,6 +16,8 @@ #include <math.h> +#include <fenv.h> + #include <gtest/gtest.h> #if defined(__BIONIC__) @@ -4450,6 +4452,7 @@ static tanf_intel_data_t g_tanf_intel_data[] = { TEST(math_tanf, tanf_intel) { #if defined(__BIONIC__) + fesetenv(FE_DFL_ENV); for (size_t i = 0; i < sizeof(g_tanf_intel_data)/sizeof(tanf_intel_data_t); i++) { EXPECT_FLOAT_EQ(g_tanf_intel_data[i].expected, tanf(g_tanf_intel_data[i].call_data)) << "Failed on element " << i; } |