aboutsummaryrefslogtreecommitdiff
path: root/test/bioprinttest.c
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2020-05-31 07:51:23 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2020-06-01 18:20:28 +0200
commit41dccd68b9b9b7622b26d264c5fa190aa5bd4201 (patch)
tree9e408ca3dbfaaf20350f6020a5b6e2f4adbf6123 /test/bioprinttest.c
parentc7f837cfcc5b2e5cd8eeeff82e0245323f206d02 (diff)
downloadopenssl-41dccd68b9b9b7622b26d264c5fa190aa5bd4201.zip
openssl-41dccd68b9b9b7622b26d264c5fa190aa5bd4201.tar.gz
openssl-41dccd68b9b9b7622b26d264c5fa190aa5bd4201.tar.bz2
Revert the check for NaN in %f format
Unfortunately -Ofast seems to break that check. Fixes #11994 Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12003)
Diffstat (limited to 'test/bioprinttest.c')
-rw-r--r--test/bioprinttest.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/test/bioprinttest.c b/test/bioprinttest.c
index 3dd5b3e..e6e32a6 100644
--- a/test/bioprinttest.c
+++ b/test/bioprinttest.c
@@ -241,48 +241,15 @@ static int test_fp(int i)
return r;
}
-extern double zero_value;
-double zero_value = 0.0;
-
static int test_big(void)
{
char buf[80];
- double d, z, inf, nan;
/* Test excessively big number. Should fail */
if (!TEST_int_eq(BIO_snprintf(buf, sizeof(buf),
"%f\n", 2 * (double)ULONG_MAX), -1))
return 0;
- d = 1.0;
- z = zero_value;
- inf = d / z;
- nan = z / z;
-
- /*
- * Test +/-inf, nan. Should fail.
- * Test +/-1.0, +/-0.0. Should work.
- */
- if (!TEST_int_eq(BIO_snprintf(buf, sizeof(buf),
- "%f", inf), -1)
- || !TEST_int_eq(BIO_snprintf(buf, sizeof(buf),
- "%f", -inf), -1)
- || !TEST_int_eq(BIO_snprintf(buf, sizeof(buf),
- "%f", nan), -1)
- || !TEST_int_eq(BIO_snprintf(buf, sizeof(buf),
- "%f", d), 8)
- || !TEST_str_eq(buf, "1.000000")
- || !TEST_int_eq(BIO_snprintf(buf, sizeof(buf),
- "%f", z), 8)
- || !TEST_str_eq(buf, "0.000000")
- || !TEST_int_eq(BIO_snprintf(buf, sizeof(buf),
- "%f", -d), 9)
- || !TEST_str_eq(buf, "-1.000000")
- || !TEST_int_eq(BIO_snprintf(buf, sizeof(buf),
- "%f", -z), 8)
- || !TEST_str_eq(buf, "0.000000"))
- return 0;
-
return 1;
}