MCPcopy Create free account
hub / github.com/ValveSoftware/GameNetworkingSockets / Test_quick

Function Test_quick

tests/test_connection.cpp:577–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575const int k_nStartingServerPort = 27200;
576
577static void Test_quick()
578{
579 uint16 nServerPort = k_nStartingServerPort;
580 SteamNetworkingIPAddr bindAddr, connectAddr;
581
582 //
583 // First, do some 'cursory' connection tests between various combiantions of IPv4, IPc6, and dual-stack.
584 // This is really just to make sure we can connect and exchange packets.
585 //
586
587 // IPv4-only server, IPv4 client
588 bindAddr.SetIPv4( 0, nServerPort );
589 connectAddr.SetIPv4( 0x7f000001, nServerPort );
590 Test_Connection( ETestConnectionMode::Cursory, bindAddr, connectAddr );
591 ++nServerPort;
592
593 // IPv6-only server, IPv6 client
594 bindAddr.SetIPv6LocalHost( nServerPort );
595 connectAddr.SetIPv6LocalHost( nServerPort );
596 Test_Connection( ETestConnectionMode::Cursory, bindAddr, connectAddr );
597 ++nServerPort;
598
599 // Dual-stack server, IPv6 client
600 bindAddr.Clear(); bindAddr.m_port = nServerPort;
601 connectAddr.SetIPv6LocalHost( nServerPort );
602 Test_Connection( ETestConnectionMode::Cursory, bindAddr, connectAddr );
603 ++nServerPort;
604
605 //
606 // Now do a 'normal' test
607 //
608 // Dual-stack server, IPv4 client (IPv4-mapped path)
609 bindAddr.Clear(); bindAddr.m_port = nServerPort;
610 connectAddr.SetIPv4( 0x7f000001, nServerPort );
611 Test_Connection( ETestConnectionMode::Normal, bindAddr, connectAddr );
612}
613
614static void Test_soak()
615{

Callers

nothing calls this directly

Calls 4

Test_ConnectionFunction · 0.85
SetIPv6LocalHostMethod · 0.80
SetIPv4Method · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected