File: test_large_32bit.patch

package info (click to toggle)
python-gsd 4.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,020 kB
  • sloc: python: 3,252; ansic: 1,965; cpp: 129; makefile: 14
file content (31 lines) | stat: -rw-r--r-- 1,037 bytes parent folder | download | duplicates (2)
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
28
29
30
31
Index: python-gsd/gsd/test/test_largefile.py
===================================================================
--- python-gsd.orig/gsd/test/test_largefile.py	2024-07-05 14:21:21.766459697 +0200
+++ python-gsd/gsd/test/test_largefile.py	2024-07-05 14:22:13.023370044 +0200
@@ -4,6 +4,7 @@
 """Test the gsd.fl API with large files."""
 
 import gc
+import platform
 
 import numpy
 import pytest
@@ -17,7 +18,17 @@
     """Test data chunks and files larger than 2 GB."""
     gc.collect()
 
-    data = numpy.linspace(0, N, num=N, endpoint=False, dtype=numpy.uint32)
+    try:
+        data = numpy.linspace(0, N, num=N, endpoint=False, dtype=numpy.uint32)
+    except ValueError as ve:
+        if platform.architecture()[0] == '64bit':
+            raise
+        else:
+            if N <= 2**27:
+                raise
+            else:
+                # ignore ValueError for largest values of N on 32-bit systems
+                return True
     with gsd.fl.open(
         name=tmp_path / 'test_large_N.gsd',
         mode='x',