()
| 472 | |
| 473 | |
| 474 | def test_internal_overlap_manual(): |
| 475 | # Stride tricks can construct arrays with internal overlap |
| 476 | |
| 477 | # We don't care about memory bounds, the array is not |
| 478 | # read/write accessed |
| 479 | x = np.arange(1).astype(np.int8) |
| 480 | |
| 481 | # Check low-dimensional special cases |
| 482 | |
| 483 | check_internal_overlap(x, False) # 1-dim |
| 484 | check_internal_overlap(x.reshape([]), False) # 0-dim |
| 485 | |
| 486 | a = as_strided(x, strides=(3, 4), shape=(4, 4)) |
| 487 | check_internal_overlap(a, False) |
| 488 | |
| 489 | a = as_strided(x, strides=(3, 4), shape=(5, 4)) |
| 490 | check_internal_overlap(a, True) |
| 491 | |
| 492 | a = as_strided(x, strides=(0,), shape=(0,)) |
| 493 | check_internal_overlap(a, False) |
| 494 | |
| 495 | a = as_strided(x, strides=(0,), shape=(1,)) |
| 496 | check_internal_overlap(a, False) |
| 497 | |
| 498 | a = as_strided(x, strides=(0,), shape=(2,)) |
| 499 | check_internal_overlap(a, True) |
| 500 | |
| 501 | a = as_strided(x, strides=(0, -9993), shape=(87, 22)) |
| 502 | check_internal_overlap(a, True) |
| 503 | |
| 504 | a = as_strided(x, strides=(0, -9993), shape=(1, 22)) |
| 505 | check_internal_overlap(a, False) |
| 506 | |
| 507 | a = as_strided(x, strides=(0, -9993), shape=(0, 22)) |
| 508 | check_internal_overlap(a, False) |
| 509 | |
| 510 | |
| 511 | def test_internal_overlap_fuzz(): |
nothing calls this directly
no test coverage detected