From 793cfcdce26e694765ba86bbaf70e96ba5b106eb Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Tue, 19 Jan 2021 01:54:26 +0800 Subject: [PATCH] Add expm1 test case to cover the k==1024 case -7.095e+02 won't trigger the k==1024 case, so we didn't add it into the test list JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com --- tests/unit-math/test-math.inc.h | 1 + tools/unit-tests/gen-test-math.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/unit-math/test-math.inc.h b/tests/unit-math/test-math.inc.h index 213367ad01..5580f733d6 100644 --- a/tests/unit-math/test-math.inc.h +++ b/tests/unit-math/test-math.inc.h @@ -294,6 +294,7 @@ check_double ("expm1 (INFINITY)", expm1 (INFINITY), INF); check_double ("expm1 (-INFINITY)", expm1 (-INFINITY), -1.00000000000000000000E+00); check_double ("expm1 (NAN)", expm1 (NAN), NAN); check_double ("expm1 (7.08e+02)", expm1 (7.08e+02), 3.02338314427605515848E+307); +check_double ("expm1 (7.095e+02)", expm1 (7.095e+02), 1.35498631931463283283E+308); check_double ("expm1 (7.10e+02)", expm1 (7.10e+02), INF); check_double ("expm1 (-7.40e+02)", expm1 (-7.40e+02), -1.00000000000000000000E+00); check_double ("expm1 (-7.50e+02)", expm1 (-7.50e+02), -1.00000000000000000000E+00); diff --git a/tools/unit-tests/gen-test-math.c b/tools/unit-tests/gen-test-math.c index 165b1a3a6f..913b655ee0 100644 --- a/tools/unit-tests/gen-test-math.c +++ b/tools/unit-tests/gen-test-math.c @@ -405,6 +405,7 @@ main (int argc, char **args) GEN_DBL_TEST (expm1 (-INFINITY)); GEN_DBL_TEST (expm1 (NAN)); GEN_DBL_TEST (expm1 (7.08e+02)); + GEN_DBL_TEST (expm1 (7.095e+02)); GEN_DBL_TEST (expm1 (7.10e+02)); GEN_DBL_TEST (expm1 (-7.40e+02)); GEN_DBL_TEST (expm1 (-7.50e+02));