Fix write tests, add notes

This commit is contained in:
Matt Nadareski
2024-04-28 16:55:16 -04:00
parent 6ea8aab7c7
commit cd08925411
6 changed files with 6 additions and 3 deletions

View File

@@ -465,7 +465,7 @@ namespace SabreTools.IO.Test.Extensions
[Fact]
public void WriteTypeSequentialTest()
{
var stream = new MemoryStream(new byte[16], 0, 16, true, true);
var stream = new MemoryStream(new byte[24], 0, count: 24, true, true);
var bw = new BinaryWriter(stream);
var obj = new TestStructSequential
{

View File

@@ -448,7 +448,7 @@ namespace SabreTools.IO.Test.Extensions
[Fact]
public void WriteTypeSequentialTest()
{
byte[] buffer = new byte[16];
byte[] buffer = new byte[24];
int offset = 0;
var obj = new TestStructSequential
{

View File

@@ -412,7 +412,7 @@ namespace SabreTools.IO.Test.Extensions
[Fact]
public void WriteTypeSequentialTest()
{
var stream = new MemoryStream(new byte[16], 0, 16, true, true);
var stream = new MemoryStream(new byte[24], 0, 24, true, true);
var obj = new TestStructSequential
{
FirstValue = 0x03020100,

View File

@@ -413,6 +413,7 @@ namespace SabreTools.IO.Extensions
/// <summary>
/// Write a <typeparamref name="T"/> to the underlying stream
/// </summary>
/// TODO: Fix writing as reading was fixed
public static bool WriteType<T>(this BinaryWriter writer, T? value)
{
// Handle the null case

View File

@@ -564,6 +564,7 @@ namespace SabreTools.IO.Extensions
/// <summary>
/// Write a <typeparamref name="T"/> to the byte array
/// </summary>
/// TODO: Fix writing as reading was fixed
public static bool WriteType<T>(this byte[] content, ref int offset, T? value)
{
// Handle the null case

View File

@@ -565,6 +565,7 @@ namespace SabreTools.IO.Extensions
/// <summary>
/// Write a <typeparamref name="T"/> to the stream
/// </summary>
/// TODO: Fix writing as reading was fixed
public static bool WriteType<T>(this Stream stream, T? value)
{
// Handle the null case