address a few TODOs

pull/7576/head
Jan Tattermusch 5 years ago
parent 43dcee2fa9
commit e14a5c8fe6
  1. 9
      csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs
  2. 2
      csharp/src/Google.Protobuf/MessageExtensions.cs

@ -121,7 +121,14 @@ namespace Google.Protobuf
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());
}
}
}
}

@ -160,8 +160,6 @@ namespace Google.Protobuf
WriteContext.Initialize(output, out WriteContext ctx);
WritingPrimitivesMessages.WriteRawMessage(ref ctx, message);
ctx.Flush();
// TODO: handling errors when IBufferWriter is used?
}
/// <summary>

Loading…
Cancel
Save