diff --git a/data_only_viz/tests/test_smplx_osc_sender_serialize.py b/data_only_viz/tests/test_smplx_osc_sender_serialize.py index 2b75493..9bf2e99 100644 --- a/data_only_viz/tests/test_smplx_osc_sender_serialize.py +++ b/data_only_viz/tests/test_smplx_osc_sender_serialize.py @@ -25,7 +25,6 @@ def _make_person(pid: int = 7) -> SMPLXPerson: def test_serialize_person_layout(): - sender = SMPLXTCPSender.__new__(SMPLXTCPSender) p = _make_person() # _serialize_persons returns bytes starting with MAGIC + n_persons header payload = SMPLXTCPSender._serialize_persons([p]) @@ -56,14 +55,17 @@ def test_serialize_person_layout(): def test_serialize_person_round_trip_handles_non_contiguous_input(): """Vertex arrays that come from slicing / transpose must still serialize cleanly.""" - sender = SMPLXTCPSender.__new__(SMPLXTCPSender) p = _make_person() - # Force a non-contiguous view: - p.vertices_3d = p.vertices_3d[::1, :].T.T + # Force a Fortran-order copy, which is NOT C-contiguous: + p.vertices_3d = np.asfortranarray(p.vertices_3d) + assert not p.vertices_3d.flags["C_CONTIGUOUS"], "test setup invariant" + payload = SMPLXTCPSender._serialize_persons([p]) - assert len(payload) == _HEADER + _PER_PERSON - base = _HEADER + # Same byte layout as the contiguous case: + base = 8 # MAGIC + n_persons + per_person_offset = base + 4 + 4 + 12 + 40 + 40 # pid + conf + trans + betas + expr verts = np.frombuffer( - payload, dtype="