Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace MLAPI.EditorTests
{
public class BitStreamTests
public class NetworkBufferTests
{
[Test]
public void TestEmptyStream()
Expand Down Expand Up @@ -794,5 +794,21 @@ public void TestStringPackedDiff()
Assert.That(readBuilder.ToString(), Is.EqualTo(testString));
Assert.That(stringCompare.ToString(), Is.EqualTo(testString));
}

[Test]
public void TestSerializationPipelineBool()
{
var buffer = new NetworkBuffer();
var writer = new NetworkWriter(buffer);
var reader = new NetworkReader(buffer);

writer.WriteObjectPacked(true);
writer.WriteObjectPacked(false);
Comment on lines +805 to +806

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might add other flavors of types here such as int[], INetworkSerializable, Vector3 etc to test a few other things too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this PR is just for the regression of the bool bug though. But I will test all the packed ones.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about bool[] then? :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, also Yamato fails because fix #541 went into release/0.1.0 and it's not on develop branch yet. so the test fails, which is very good! (except 2021.1 on Win passed? oh no...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And yes, I put int he PR description: "Expect this to fail until the fix for this has been backported to develop."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea as for yamato. The tests failed on all machine. But pack and validate succeeded. Which is a good sign!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattwalsh-unity was talking about merging release/0.1.0 back into develop some time soon. maybe we should that first and merge this in right afterwards?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure


buffer.BitPosition = 0;

Assert.That(reader.ReadObjectPacked(typeof(bool)), Is.EqualTo(true));
Assert.That(reader.ReadObjectPacked(typeof(bool)), Is.EqualTo(false));
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.