address a few TODOs
diff --git a/csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs b/csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs
index 5ed6091..fb83ff4 100644
--- a/csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs
+++ b/csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs
@@ -121,7 +121,14 @@
message.WriteTo(singleSpan);
Assert.AreEqual(bytes, singleSpan.ToArray());
- // TODO: also test different chunk sizes for IBufferWriter
+ // test for different IBufferWriter.GetSpan() segment sizes
+ for (int blockSize = 1; blockSize < 256; blockSize *= 2)
+ {
+ var segmentedBufferWriter = new ArrayBufferWriter<byte>();
+ segmentedBufferWriter.MaxGrowBy = blockSize;
+ message.WriteTo(segmentedBufferWriter);
+ Assert.AreEqual(bytes, bufferWriter.WrittenSpan.ToArray());
+ }
}
}
}
\ No newline at end of file
diff --git a/csharp/src/Google.Protobuf/MessageExtensions.cs b/csharp/src/Google.Protobuf/MessageExtensions.cs
index 98d0f64..36a9df7 100644
--- a/csharp/src/Google.Protobuf/MessageExtensions.cs
+++ b/csharp/src/Google.Protobuf/MessageExtensions.cs
@@ -160,8 +160,6 @@
WriteContext.Initialize(output, out WriteContext ctx);
WritingPrimitivesMessages.WriteRawMessage(ref ctx, message);
ctx.Flush();
-
- // TODO: handling errors when IBufferWriter is used?
}
/// <summary>