Merge "Start math tests with a clean fenv."

This commit is contained in:
Dan Albert 2014-09-02 23:11:42 +00:00 committed by Gerrit Code Review
commit c7de919129
14 changed files with 42 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}