Skip to content

Commit b6480e7

Browse files
committed
Fix how tests are checking the returned message number
1 parent 676e0c9 commit b6480e7

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

tests/test_connection.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ void Test_lane_quick_priority_and_background()
958958
// but otherwise leave the rest of the body unitialized
959959
*(SteamNetworkingMicroseconds *)pMsg->m_pData = usecNow;
960960

961-
int64 nMsgNum;
961+
int64 nMsgNum = 0;
962962
SteamNetworkingSockets()->SendMessages( 1, &pMsg, &nMsgNum, true );
963963
++nMsgSent[k_LaneBackground];
964964
assert( nMsgNum == nMsgSent[k_LaneBackground] );
@@ -976,7 +976,7 @@ void Test_lane_quick_priority_and_background()
976976
// but otherwise leave the rest of the body unitialized
977977
*(SteamNetworkingMicroseconds *)pMsg->m_pData = usecNow;
978978

979-
int64 nMsgNum;
979+
int64 nMsgNum = 0;
980980
SteamNetworkingSockets()->SendMessages( 1, &pMsg, &nMsgNum, true );
981981
++nMsgSent[k_LaneUrgent];
982982
assert( nMsgNum == nMsgSent[k_LaneUrgent] );
@@ -1002,7 +1002,7 @@ void Test_lane_quick_priority_and_background()
10021002
// but otherwise leave the rest of the body unitialized
10031003
*(SteamNetworkingMicroseconds *)pMsg->m_pData = usecNow;
10041004

1005-
int64 nMsgNum;
1005+
int64 nMsgNum = 0;
10061006
SteamNetworkingSockets()->SendMessages( 1, &pMsg, &nMsgNum, true );
10071007
++nMsgSent[k_LaneGameplay];
10081008
assert( nMsgNum == nMsgSent[k_LaneGameplay] );
@@ -1017,9 +1017,9 @@ void Test_lane_quick_priority_and_background()
10171017
// Occasionally send reliable
10181018
pMsg->m_nFlags = std::uniform_int_distribution<>( 0, 100 )( g_rand ) < 30 ? k_nSteamNetworkingSend_ReliableNoNagle : k_nSteamNetworkingSend_UnreliableNoNagle;
10191019

1020-
int64 nMsgNum;
1020+
int64 nMsgNum = 0;
10211021
SteamNetworkingSockets()->SendMessages( 1, &pMsg, &nMsgNum, true );
1022-
assert( nMsgNum >= 0 );
1022+
assert( nMsgNum > 0 );
10231023
}
10241024

10251025
// Schedule the next send at 30hz
@@ -1133,7 +1133,7 @@ void Test_pipe()
11331133
pSendMsg->m_nFlags = k_nSteamNetworkingSend_Reliable;
11341134
void *pSendData = pSendMsg->m_pData;
11351135

1136-
int64 nMsgNum;
1136+
int64 nMsgNum = 0;
11371137
SteamNetworkingSockets()->SendMessages( 1, &pSendMsg, &nMsgNum, true );
11381138
assert( nMsgNum > 0 );
11391139

@@ -1152,7 +1152,7 @@ void Test_pipe()
11521152
pSendMsg->m_conn = hAlice;
11531153
pSendMsg->m_nFlags = k_nSteamNetworkingSend_Reliable;
11541154

1155-
int64 nMsgNum;
1155+
int64 nMsgNum = 0;
11561156
SteamNetworkingSockets()->SendMessages( 1, &pSendMsg, &nMsgNum, true );
11571157
assert( nMsgNum > 0 );
11581158

@@ -1264,7 +1264,7 @@ void Test_netloopback_throughput()
12641264
pSendMsg->m_nFlags = k_nSteamNetworkingSend_Reliable;
12651265
// Don't bother initializing the body
12661266

1267-
int64 nMsgNumberOrResult;
1267+
int64 nMsgNumberOrResult = 0;
12681268
SteamNetworkingSockets()->SendMessages( 1, &pSendMsg, &nMsgNumberOrResult, true );
12691269
if ( nMsgNumberOrResult == -k_EResultLimitExceeded )
12701270
{

0 commit comments

Comments
 (0)