From c3b7bde91499c2fa6105ff336286dbedbfd42790 Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Mon, 29 Aug 2022 10:25:24 +0300 Subject: [PATCH] fix false valgrind error on new hash test (#11200) New test fails on valgrind because strtold("+inf") with valgrind returns a non-inf result same thing is done in incr.tcl. --- tests/unit/type/hash.tcl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/unit/type/hash.tcl b/tests/unit/type/hash.tcl index 613134af3..e7b9f3d85 100644 --- a/tests/unit/type/hash.tcl +++ b/tests/unit/type/hash.tcl @@ -819,8 +819,11 @@ start_server {tags {"hash"}} { set _ $k } {ZIP_INT_8B 127 ZIP_INT_16B 32767 ZIP_INT_32B 2147483647 ZIP_INT_64B 9223372036854775808 ZIP_INT_IMM_MIN 0 ZIP_INT_IMM_MAX 12} - test {HINCRBYFLOAT does not allow NaN or Infinity} { - assert_error "*value is NaN or Infinity*" {r hincrbyfloat hfoo field +inf} - assert_equal 0 [r exists hfoo] + # On some platforms strtold("+inf") with valgrind returns a non-inf result + if {!$::valgrind} { + test {HINCRBYFLOAT does not allow NaN or Infinity} { + assert_error "*value is NaN or Infinity*" {r hincrbyfloat hfoo field +inf} + assert_equal 0 [r exists hfoo] + } } }