Merge "Add basic tests for the remaining 9 libm <fenv.h> functions."
diff --git a/tests/math_test.cpp b/tests/math_test.cpp
index 466e697..d029311 100644
--- a/tests/math_test.cpp
+++ b/tests/math_test.cpp
@@ -177,10 +177,19 @@
}
// Historical BSD cruft that isn't exposed in <math.h> any more.
+extern "C" int __fpclassify(double);
extern "C" int __fpclassifyd(double);
extern "C" int __fpclassifyf(float);
extern "C" int __fpclassifyl(long double);
+TEST(MATH_TEST, __fpclassify) {
+ ASSERT_EQ(FP_INFINITE, __fpclassify(HUGE_VAL));
+ ASSERT_EQ(FP_NAN, __fpclassify(nan("")));
+ ASSERT_EQ(FP_NORMAL, __fpclassify(1.0));
+ ASSERT_EQ(FP_SUBNORMAL, __fpclassify(double_subnormal()));
+ ASSERT_EQ(FP_ZERO, __fpclassify(0.0));
+}
+
TEST(MATH_TEST, __fpclassifyd) {
#if defined(__GLIBC__)
#define __fpclassifyd __fpclassify
@@ -254,9 +263,15 @@
}
// Historical BSD cruft that isn't exposed in <math.h> any more.
+extern "C" int __isinf(double);
extern "C" int __isinff(float);
extern "C" int __isinfl(long double);
+TEST(MATH_TEST, __isinf) {
+ ASSERT_FALSE(__isinf(123.0));
+ ASSERT_TRUE(__isinf(HUGE_VAL));
+}
+
TEST(MATH_TEST, __isinff) {
ASSERT_FALSE(__isinff(123.0f));
ASSERT_TRUE(__isinff(HUGE_VALF));
@@ -274,9 +289,15 @@
}
// Historical BSD cruft that isn't exposed in <math.h> any more.
+extern "C" int __isnan(double);
extern "C" int __isnanf(float);
extern "C" int __isnanl(long double);
+TEST(MATH_TEST, __isnan) {
+ ASSERT_FALSE(__isnan(123.0));
+ ASSERT_TRUE(__isnan(nan("")));
+}
+
TEST(MATH_TEST, __isnanf) {
ASSERT_FALSE(__isnanf(123.0f));
ASSERT_TRUE(__isnanf(nanf("")));
diff --git a/tools/update_notice.sh b/tools/update_notice.sh
index 9974da2..0b8a106 100755
--- a/tools/update_notice.sh
+++ b/tools/update_notice.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/..
./libc/tools/generate-NOTICE.py libc libdl libm linker libstdc++ > libc/NOTICE
diff --git a/tools/update_seccomp.sh b/tools/update_seccomp.sh
index d108e35..b9e53aa 100755
--- a/tools/update_seccomp.sh
+++ b/tools/update_seccomp.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/..
./libc/tools/genseccomp.py
diff --git a/tools/update_syscalls.sh b/tools/update_syscalls.sh
index 3ad95ed..5e7eb0a 100755
--- a/tools/update_syscalls.sh
+++ b/tools/update_syscalls.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/..
./libc/tools/gensyscalls.py
diff --git a/tools/update_version_scripts.sh b/tools/update_version_scripts.sh
index ccba475..2c3a5b4 100755
--- a/tools/update_version_scripts.sh
+++ b/tools/update_version_scripts.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/..
./libc/tools/genversion-scripts.py