(ex, m, items, fmt)
| 2709 | ) |
| 2710 | |
| 2711 | def iter_roundtrip(ex, m, items, fmt): |
| 2712 | srcsize = struct.calcsize(fmt) |
| 2713 | for bytefmt, to_bytelist in bytespec: |
| 2714 | |
| 2715 | m2 = m.cast(bytefmt) |
| 2716 | lst = to_bytelist(ex) |
| 2717 | self.verify(m2, obj=ex, |
| 2718 | itemsize=1, fmt=bytefmt, readonly=False, |
| 2719 | ndim=1, shape=[31*srcsize], strides=(1,), |
| 2720 | lst=lst, cast=True) |
| 2721 | |
| 2722 | m3 = m2.cast(fmt) |
| 2723 | self.assertEqual(m3, ex) |
| 2724 | lst = ex.tolist() |
| 2725 | self.verify(m3, obj=ex, |
| 2726 | itemsize=srcsize, fmt=fmt, readonly=False, |
| 2727 | ndim=1, shape=[31], strides=(srcsize,), |
| 2728 | lst=lst, cast=True) |
| 2729 | |
| 2730 | # cast from ndim = 0 to ndim = 1 |
| 2731 | srcsize = struct.calcsize('I') |
nothing calls this directly
no test coverage detected