Some tests for identity string handling. Doesn't really have anything to do with connectivity, this is just a conveinent place for this to live
| 625 | // Some tests for identity string handling. Doesn't really have anything to do with |
| 626 | // connectivity, this is just a conveinent place for this to live |
| 627 | void Test_identity() |
| 628 | { |
| 629 | SteamNetworkingIdentity id1, id2; |
| 630 | char tempBuf[ SteamNetworkingIdentity::k_cchMaxString ]; |
| 631 | |
| 632 | { |
| 633 | CSteamID steamID( 1234, k_EUniversePublic, k_EAccountTypeIndividual ); |
| 634 | id1.SetSteamID( steamID ); |
| 635 | id1.ToString( tempBuf, sizeof(tempBuf ) ); |
| 636 | assert( id2.ParseString( tempBuf ) ); |
| 637 | assert( id2.GetSteamID() == steamID ); |
| 638 | } |
| 639 | |
| 640 | { |
| 641 | const char *pszTempXBoxID = "8fg37rfsdf"; |
| 642 | assert( id1.SetXboxPairwiseID( pszTempXBoxID ) ); |
| 643 | id1.ToString( tempBuf, sizeof(tempBuf ) ); |
| 644 | assert( id2.ParseString( tempBuf ) ); |
| 645 | assert( strcmp( id2.GetXboxPairwiseID(), pszTempXBoxID ) == 0 ); |
| 646 | } |
| 647 | |
| 648 | { |
| 649 | const char *pszTempIPAddr = "ip:192.168.0.0:27015"; |
| 650 | assert( id1.ParseString( pszTempIPAddr ) ); |
| 651 | id1.ToString( tempBuf, sizeof(tempBuf ) ); |
| 652 | assert( strcmp( tempBuf, pszTempIPAddr ) == 0 ); |
| 653 | |
| 654 | id1.SetLocalHost(); |
| 655 | id1.ToString( tempBuf, sizeof(tempBuf ) ); |
| 656 | assert( strcmp( tempBuf, "ip:::1" ) == 0 ); |
| 657 | } |
| 658 | |
| 659 | { |
| 660 | const char *pszTempGenStr = "Locke Lamora"; |
| 661 | assert( id1.SetGenericString( pszTempGenStr ) ); |
| 662 | id1.ToString( tempBuf, sizeof(tempBuf ) ); |
| 663 | assert( strcmp( tempBuf, "str:Locke Lamora" ) == 0 ); |
| 664 | assert( id2.ParseString( tempBuf ) ); |
| 665 | assert( strcmp( id2.GetGenericString(), pszTempGenStr ) == 0 ); |
| 666 | } |
| 667 | } |
| 668 | |
| 669 | void Test_lane_quick_queueanddrain() |
| 670 | { |
nothing calls this directly
no test coverage detected