Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Commit

Permalink
fix: disable debug message assertion for release mode tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lodicolo committed Apr 3, 2022
1 parent 322e931 commit 45d399d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Lidgren.Network.Tests/Peer/NetPeer.ShutdownTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public void TestShutdownMessage()
Peer.Shutdown(outgoingMessage);

TestHelper.WaitFor(() => Server.ConnectionsCount == 0);

#if DEBUG
TestHelper.HasMessage(
PeerMessages,
NetIncomingMessageType.DebugMessage,
Expand All @@ -33,6 +35,7 @@ public void TestShutdownMessage()
StringComparison.Ordinal
)
);
#endif

var messageShutdownReason = ServerMessages.Last(
message => NetIncomingMessageType.StatusChanged == message.MessageType
Expand All @@ -58,6 +61,8 @@ public void TestShutdownMessageWithDebugString()
Peer.Shutdown(outgoingMessage, "debugMessage");

TestHelper.WaitFor(() => Server.ConnectionsCount == 0);

#if DEBUG
TestHelper.HasMessage(
PeerMessages,
NetIncomingMessageType.DebugMessage,
Expand All @@ -68,6 +73,7 @@ public void TestShutdownMessageWithDebugString()
StringComparison.Ordinal
)
);
#endif

var messageShutdownReason = ServerMessages.Last(
message => NetIncomingMessageType.StatusChanged == message.MessageType
Expand All @@ -90,6 +96,8 @@ public void TestShutdownString()
Peer.Shutdown("bye");

TestHelper.WaitFor(() => Server.ConnectionsCount == 0);

#if DEBUG
TestHelper.HasMessage(
PeerMessages,
NetIncomingMessageType.DebugMessage,
Expand All @@ -100,6 +108,7 @@ public void TestShutdownString()
StringComparison.Ordinal
)
);
#endif

var messageShutdownReason = ServerMessages.Last(
message => NetIncomingMessageType.StatusChanged == message.MessageType
Expand All @@ -122,6 +131,8 @@ public void TestShutdownStringWithDebugMessage()
Peer.Shutdown("bye", "debugMessage");

TestHelper.WaitFor(() => Server.ConnectionsCount == 0);

#if DEBUG
TestHelper.HasMessage(
PeerMessages,
NetIncomingMessageType.DebugMessage,
Expand All @@ -132,6 +143,7 @@ public void TestShutdownStringWithDebugMessage()
StringComparison.Ordinal
)
);
#endif

var messageShutdownReason = ServerMessages.Last(
message => NetIncomingMessageType.StatusChanged == message.MessageType
Expand Down

0 comments on commit 45d399d

Please sign in to comment.