| 619 | "intent(hide) should have failed on undefined dimensions") |
| 620 | |
| 621 | def test_optional_none(self): |
| 622 | shape = (2, ) |
| 623 | a = self.array(shape, intent.optional, None) |
| 624 | assert a.arr.shape == shape |
| 625 | assert a.arr_equal(a.arr, np.zeros(shape, dtype=self.type.dtype)) |
| 626 | |
| 627 | shape = (2, 3) |
| 628 | a = self.array(shape, intent.optional, None) |
| 629 | assert a.arr.shape == shape |
| 630 | assert a.arr_equal(a.arr, np.zeros(shape, dtype=self.type.dtype)) |
| 631 | assert a.arr.flags["FORTRAN"] and not a.arr.flags["CONTIGUOUS"] |
| 632 | |
| 633 | shape = (2, 3) |
| 634 | a = self.array(shape, intent.c.optional, None) |
| 635 | assert a.arr.shape == shape |
| 636 | assert a.arr_equal(a.arr, np.zeros(shape, dtype=self.type.dtype)) |
| 637 | assert not a.arr.flags["FORTRAN"] and a.arr.flags["CONTIGUOUS"] |
| 638 | |
| 639 | def test_optional_from_2seq(self): |
| 640 | obj = self.num2seq |