summaryrefslogtreecommitdiff
path: root/numpy/core/src/multiarray
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2023-02-15 12:35:30 +0200
committermattip <matti.picus@gmail.com>2023-02-15 12:35:30 +0200
commit6ef6233d5493dc2e18232304e1c3b8b0ae6f27c8 (patch)
tree1d6a34eea21e96cd149fa5b40a04c6fb59d2307b /numpy/core/src/multiarray
parent2a6e24192141264dfcc8f4d0f3f7a921b58a5056 (diff)
downloadnumpy-6ef6233d5493dc2e18232304e1c3b8b0ae6f27c8.tar.gz
TEST: remove very slow test, add it as a comment to the code snippet it tests
Diffstat (limited to 'numpy/core/src/multiarray')
-rw-r--r--numpy/core/src/multiarray/convert.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c
index ef231587d..e99bc3fe4 100644
--- a/numpy/core/src/multiarray/convert.c
+++ b/numpy/core/src/multiarray/convert.c
@@ -157,7 +157,24 @@ PyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format)
NPY_BEGIN_ALLOW_THREADS;
#if defined (_MSC_VER) && defined(_WIN64)
- /* Workaround Win64 fwrite() bug. Ticket #1660 */
+ /* Workaround Win64 fwrite() bug. Issue gh-2556
+ * If you touch this code, please run this test which is so slow
+ * it was removed from the test suite
+ *
+ * fourgbplus = 2**32 + 2**16
+ * testbytes = np.arange(8, dtype=np.int8)
+ * n = len(testbytes)
+ * flike = tempfile.NamedTemporaryFile()
+ * f = flike.file
+ * np.tile(testbytes, fourgbplus // testbytes.nbytes).tofile(f)
+ * flike.seek(0)
+ * a = np.fromfile(f, dtype=np.int8)
+ * flike.close()
+ * assert_(len(a) == fourgbplus)
+ * # check only start and end for speed:
+ * assert_((a[:n] == testbytes).all())
+ * assert_((a[-n:] == testbytes).all())
+ */
{
npy_intp maxsize = 2147483648 / PyArray_DESCR(self)->elsize;
npy_intp chunksize;