File: 0004-Skip-comparison-check-on-32-bit-systems.patch

package info (click to toggle)
php-malkusch-lock 2.2.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 412 kB
  • sloc: php: 2,193; makefile: 19
file content (27 lines) | stat: -rw-r--r-- 1,214 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
25
26
27
From: James Valleroy <jvalleroy@mailbox.org>
Date: Thu, 30 Dec 2021 12:05:11 -0500
Subject: Skip comparison check on 32-bit systems

---
 tests/mutex/PgAdvisoryLockMutexTest.php | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/mutex/PgAdvisoryLockMutexTest.php b/tests/mutex/PgAdvisoryLockMutexTest.php
index 0f1d4a8..76a1292 100644
--- a/tests/mutex/PgAdvisoryLockMutexTest.php
+++ b/tests/mutex/PgAdvisoryLockMutexTest.php
@@ -79,8 +79,12 @@ class PgAdvisoryLockMutexTest extends TestCase
                         $integers = $arguments[0];
 
                         foreach ($integers as $each) {
-                            $this->assertLessThan(1 << 32, $each);
-                            $this->assertGreaterThan(-(1 << 32), $each);
+                            /* Comparison to 2^32 does not work on
+                             * 32-bit systems. */
+                            if (PHP_INT_SIZE > 4) {
+                                $this->assertLessThan(1 << 32, $each);
+                                $this->assertGreaterThan(-(1 << 32), $each);
+                            }
                             $this->assertIsInt($each);
                         }