()
| 509 | |
| 510 | |
| 511 | def test_internal_overlap_fuzz(): |
| 512 | # Fuzz check; the brute-force check is fairly slow |
| 513 | |
| 514 | x = np.arange(1).astype(np.int8) |
| 515 | |
| 516 | overlap = 0 |
| 517 | no_overlap = 0 |
| 518 | min_count = 100 |
| 519 | |
| 520 | rng = np.random.RandomState(1234) |
| 521 | |
| 522 | while min(overlap, no_overlap) < min_count: |
| 523 | ndim = rng.randint(1, 4, dtype=np.intp) |
| 524 | |
| 525 | strides = tuple(rng.randint(-1000, 1000, dtype=np.intp) |
| 526 | for j in range(ndim)) |
| 527 | shape = tuple(rng.randint(1, 30, dtype=np.intp) |
| 528 | for j in range(ndim)) |
| 529 | |
| 530 | a = as_strided(x, strides=strides, shape=shape) |
| 531 | result = check_internal_overlap(a) |
| 532 | |
| 533 | if result: |
| 534 | overlap += 1 |
| 535 | else: |
| 536 | no_overlap += 1 |
| 537 | |
| 538 | |
| 539 | def test_non_ndarray_inputs(): |
nothing calls this directly
no test coverage detected