diff --git a/test/test_serialization.py b/test/test_serialization.py index d1bfc66..d6a9bb3 100644 --- a/test/test_serialization.py +++ b/test/test_serialization.py @@ -57,8 +57,11 @@ def test_roundtrip_file_multiple(all_types): msg.write(f) f.seek(0) + i = 0 for msg in all_types.TestAllTypes.read_multiple(f): test_regression.check_all_types(msg) + i += 1 + assert i == 3 def test_roundtrip_bytes_multiple(all_types): msg = all_types.TestAllTypes.new_message() @@ -68,8 +71,11 @@ def test_roundtrip_bytes_multiple(all_types): msgs += msg.to_bytes() msgs += msg.to_bytes() + i = 0 for msg in all_types.TestAllTypes.read_multiple_bytes(msgs): test_regression.check_all_types(msg) + i += 1 + assert i == 3 def test_roundtrip_file_multiple_packed(all_types): f = tempfile.TemporaryFile() @@ -80,8 +86,11 @@ def test_roundtrip_file_multiple_packed(all_types): msg.write_packed(f) f.seek(0) + i = 0 for msg in all_types.TestAllTypes.read_multiple_packed(f): test_regression.check_all_types(msg) + i += 1 + assert i == 3 def test_roundtrip_bytes_multiple_packed(all_types): msg = all_types.TestAllTypes.new_message() @@ -91,8 +100,11 @@ def test_roundtrip_bytes_multiple_packed(all_types): msgs += msg.to_bytes_packed() msgs += msg.to_bytes_packed() + i = 0 for msg in all_types.TestAllTypes.read_multiple_bytes_packed(msgs): test_regression.check_all_types(msg) + i += 1 + assert i == 3 def test_roundtrip_dict(all_types): msg = all_types.TestAllTypes.new_message()