| 1 | See https://github.com/angr/angr/commit/d4a3f058e06a78361b60e08544ea4ae8f735e0cf
|
| 2 |
|
| 3 | diff --git a/tests/factory/test_callable.py b/tests/factory/test_callable.py
|
| 4 | index 22602c15e..f6e5e49df 100755
|
| 5 | |
| 6 | |
| 7 | @@ -3,6 +3,8 @@ from __future__ import annotations
|
| 8 |
|
| 9 | __package__ = __package__ or "tests.factory" # pylint:disable=redefined-builtin
|
| 10 |
|
| 11 | +import functools
|
| 12 | +import operator
|
| 13 | import os
|
| 14 | import unittest
|
| 15 |
|
| 16 | @@ -135,7 +137,12 @@ class TestCallable(unittest.TestCase):
|
| 17 | # not almost equal!! totally equal!!! z3 is magic, if kinda slow!!!!!
|
| 18 | for arg_conc in args_conc:
|
| 19 | assert arg_conc > 1.0
|
| 20 | - assert sum(args_conc) == 27.7
|
| 21 | + # Sum sequentially like the program does. Since Python 3.12, builtin
|
| 22 | + # sum() uses Neumaier compensated summation for floats, which is MORE
|
| 23 | + # accurate than the program's naive left-to-right addition and so can
|
| 24 | + # disagree with the (exactly satisfied) symbolic result by an ulp.
|
| 25 | + seq_sum = functools.reduce(operator.add, args_conc)
|
| 26 | + assert seq_sum == 27.7
|
| 27 |
|
| 28 | def test_fauxware_armel(self):
|
| 29 | self.run_fauxware("armel")
|