diff options
author | Elliott Hughes <enh@google.com> | 2013-11-13 13:29:23 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2013-11-13 13:29:23 -0800 |
commit | 6a8f00d49c30107903f2449ae563cfee51b48468 (patch) | |
tree | 2d3ad149e0357491a6cc228ad0e639285aff7794 /tests/math_test.cpp | |
parent | 44cbe94bba2e7e4b1369c86b11d66d6b60f0e333 (diff) | |
download | android_bionic-6a8f00d49c30107903f2449ae563cfee51b48468.tar.gz android_bionic-6a8f00d49c30107903f2449ae563cfee51b48468.tar.bz2 android_bionic-6a8f00d49c30107903f2449ae563cfee51b48468.zip |
Add unit tests for pow's behavior with NaNs.
Bug: 11669804
Change-Id: Idfa6527640c8d0c2cf3e5343bf7afe013e237545
Diffstat (limited to 'tests/math_test.cpp')
-rw-r--r-- | tests/math_test.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/math_test.cpp b/tests/math_test.cpp index 458a1468d..4c21a996a 100644 --- a/tests/math_test.cpp +++ b/tests/math_test.cpp @@ -485,14 +485,20 @@ TEST(math, expm1l) { } TEST(math, pow) { + ASSERT_TRUE(isnan(pow(nan(""), 3.0))); + ASSERT_TRUE(isnan(pow(2.0, nan("")))); ASSERT_FLOAT_EQ(8.0, pow(2.0, 3.0)); } TEST(math, powf) { + ASSERT_TRUE(isnanf(powf(nanf(""), 3.0f))); + ASSERT_TRUE(isnanf(powf(2.0f, nanf("")))); ASSERT_FLOAT_EQ(8.0f, powf(2.0f, 3.0f)); } TEST(math, powl) { + ASSERT_TRUE(__isnanl(powl(nanl(""), 3.0))); + ASSERT_TRUE(__isnanl(powl(2.0, nanl("")))); ASSERT_FLOAT_EQ(8.0, powl(2.0, 3.0)); } |