def test_byteswap(): for val in (1, 0x100, 0x10000): a = np.array(val, dtype=np.uint32) b = a.byteswap() c = m5u.byteswap_u4(a) yield assert_equal, b.item(), c d = m5u.byteswap_u4(c) yield assert_equal, a.item(), d