| 108 | } |
| 109 | |
| 110 | void TEST_Init( const SteamNetworkingIdentity *pIdentity ) |
| 111 | { |
| 112 | TEST_InitLog( "log.txt" ); |
| 113 | |
| 114 | // Test machines are not always realtime systems and may experience thread starvation. |
| 115 | // Set very high lock performance warnings so they don't cause test failures. |
| 116 | #if __THREAD_SANITIZER__ |
| 117 | SteamNetworkingSockets_SetLockWaitWarningThreshold( 2000*1000); |
| 118 | #else |
| 119 | SteamNetworkingSockets_SetLockWaitWarningThreshold( 300*1000 ); |
| 120 | #endif |
| 121 | |
| 122 | #ifdef STEAMNETWORKINGSOCKETS_OPENSOURCE |
| 123 | SteamDatagramErrMsg errMsg; |
| 124 | if ( !GameNetworkingSockets_Init( pIdentity, errMsg ) ) |
| 125 | { |
| 126 | fprintf( stderr, "GameNetworkingSockets_Init failed. %s", errMsg ); |
| 127 | exit(1); |
| 128 | } |
| 129 | #else |
| 130 | //SteamAPI_Init(); |
| 131 | |
| 132 | SteamDatagram_SetUniverse(); |
| 133 | SteamDatagram_SetAppID( 570 ); // Just set something, doesn't matter what |
| 134 | |
| 135 | SteamDatagramErrMsg errMsg; |
| 136 | if ( !SteamDatagramClient_Init( errMsg ) ) |
| 137 | { |
| 138 | fprintf( stderr, "SteamDatagramClient_Init failed. %s", errMsg ); |
| 139 | exit(1); |
| 140 | } |
| 141 | |
| 142 | if ( pIdentity ) |
| 143 | SteamNetworkingSockets()->ResetIdentity( pIdentity ); |
| 144 | |
| 145 | // Disable auth |
| 146 | SteamNetworkingUtils()->SetGlobalConfigValueInt32( k_ESteamNetworkingConfig_IP_AllowWithoutAuth, 2 ); |
| 147 | |
| 148 | #endif |
| 149 | } |
| 150 | |
| 151 | void TEST_Kill() |
| 152 | { |
no test coverage detected