(ex, m, items, fmt)
| 2721 | ) |
| 2722 | |
| 2723 | def iter_roundtrip(ex, m, items, fmt): |
| 2724 | srcsize = struct.calcsize(fmt) |
| 2725 | for bytefmt, to_bytelist in bytespec: |
| 2726 | |
| 2727 | m2 = m.cast(bytefmt) |
| 2728 | lst = to_bytelist(ex) |
| 2729 | self.verify(m2, obj=ex, |
| 2730 | itemsize=1, fmt=bytefmt, readonly=False, |
| 2731 | ndim=1, shape=[31*srcsize], strides=(1,), |
| 2732 | lst=lst, cast=True) |
| 2733 | |
| 2734 | m3 = m2.cast(fmt) |
| 2735 | self.assertEqual(m3, ex) |
| 2736 | lst = ex.tolist() |
| 2737 | self.verify(m3, obj=ex, |
| 2738 | itemsize=srcsize, fmt=fmt, readonly=False, |
| 2739 | ndim=1, shape=[31], strides=(srcsize,), |
| 2740 | lst=lst, cast=True) |
| 2741 | |
| 2742 | # cast from ndim = 0 to ndim = 1 |
| 2743 | srcsize = struct.calcsize('I') |
nothing calls this directly
no test coverage detected