File: 0008-Allow-more-deviations-when-calculating-volume-to-fix.patch

package info (click to toggle)
opm-common 2025.04%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 98,816 kB
  • sloc: cpp: 277,946; python: 3,553; sh: 198; xml: 174; pascal: 136; makefile: 12
file content (24 lines) | stat: -rw-r--r-- 1,103 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From: Markus Blatt <markus@dr-blatt.de>
Date: Tue, 25 May 2021 11:40:38 +0200
Subject: Allow more deviations when calculating volume to fix tests on i386.

Apparently round off errors are different and the values we test for
are the values we get when computing on amd64.
---
 tests/test_calculateCellVol.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/test_calculateCellVol.cpp b/tests/test_calculateCellVol.cpp
index 2632211..b2cf1f9 100644
--- a/tests/test_calculateCellVol.cpp
+++ b/tests/test_calculateCellVol.cpp
@@ -55,7 +55,8 @@ BOOST_AUTO_TEST_CASE (calc_cellvol)
     
     BOOST_REQUIRE_CLOSE (calculateCellVol(x1,y1,z1), 40368.7852157, 1e-9);
     BOOST_REQUIRE_CLOSE (calculateCellVol(x2,y2,z2), 15766.9187847524, 1e-9);
-    BOOST_REQUIRE_CLOSE (calculateCellVol(x3,y3,z3), 3268.8819007839, 1e-9);
+    // using 1e-8 here as otherwise the test fails on i386 because of different rounding errors
+    BOOST_REQUIRE_CLOSE (calculateCellVol(x3,y3,z3), 3268.8819007839, 1e-8);
     BOOST_REQUIRE_CLOSE (calculateCellVol(x4,y4,z4), 23391.4917234564, 1e-9);
 }