File: 0009-Prevent-32bit-overflow-when-testing-OpmLog.patch

package info (click to toggle)
opm-common 2025.04%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 98,788 kB
  • sloc: cpp: 277,948; python: 3,553; sh: 198; xml: 174; pascal: 136; makefile: 12
file content (21 lines) | stat: -rw-r--r-- 748 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
From: Markus Blatt <markus@dr-blatt.de>
Date: Tue, 25 May 2021 11:42:06 +0200
Subject: Prevent 32bit overflow when testing OpmLog.

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

diff --git a/tests/test_OpmLog.cpp b/tests/test_OpmLog.cpp
index dd5b3bd..f5c936a 100644
--- a/tests/test_OpmLog.cpp
+++ b/tests/test_OpmLog.cpp
@@ -249,7 +249,7 @@ BOOST_AUTO_TEST_CASE(TestHelperFunctions)
     BOOST_CHECK(!isPower2(0));
     BOOST_CHECK(isPower2(1));
     BOOST_CHECK(isPower2(1 << 3));
-    BOOST_CHECK(isPower2(1ul << 62));
+    BOOST_CHECK(isPower2(1ul << 31));
 
     // fileMessage
     BOOST_CHECK_EQUAL(fileMessage(KeywordLocation("Keyword", "foo/bar", 1), "message"), "message\nIn file foo/bar, line 1\n");