address a few TODOs

This commit is contained in:
Jan Tattermusch 2020-06-08 16:23:33 +02:00
parent 43dcee2fa9
commit e14a5c8fe6
2 changed files with 8 additions and 3 deletions

View File

@ -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());
}
}
}
}

View File

@ -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>