File: 0005-Fix-floating-point-comparisons-in-unit-tests.patch

package info (click to toggle)
faiss 1.11.0-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 8,360 kB
  • sloc: cpp: 83,959; python: 27,238; sh: 905; ansic: 418; makefile: 38
file content (19 lines) | stat: -rw-r--r-- 611 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
Date: Wed, 9 Feb 2022 01:38:34 +0100
Subject: Fix floating point comparisons in unit tests

---
 tests/test_lowlevel_ivf.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tests/test_lowlevel_ivf.cpp
+++ b/tests/test_lowlevel_ivf.cpp
@@ -357,7 +357,7 @@
                     float computed_D = scanner->distance_to_code(
                             xb.data() + vno * il->code_size);
 
-                    EXPECT_EQ(computed_D, D[jj]);
+                    EXPECT_FLOAT_EQ(computed_D, D[jj]);
                 }
             }
         }