From: Jinoh Kang jinoh.kang.kr@gmail.com
Signed-off-by: Jinoh Kang jinoh.kang.kr@gmail.com --- dlls/iphlpapi/tests/iphlpapi.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index 29256eb2774..54aaf533e9d 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -1456,9 +1456,32 @@ static void testGetNetworkParams(void) } }
+static void testGetBestInterface(void) +{ + DWORD apiReturn; + DWORD bestIfIndex; + + apiReturn = GetBestInterface( INADDR_ANY, &bestIfIndex ); + trace( "GetBestInterface([0.0.0.0], {%lu}) = %lu\n", bestIfIndex, apiReturn ); + if (apiReturn == ERROR_NOT_SUPPORTED) + { + skip( "GetBestInterface is not supported\n" ); + return; + } + + apiReturn = GetBestInterface( INADDR_LOOPBACK, NULL ); + ok( apiReturn == ERROR_INVALID_PARAMETER, + "GetBestInterface([127.0.0.1], NULL) returned %lu, expected %d\n", + apiReturn, ERROR_INVALID_PARAMETER ); + + apiReturn = GetBestInterface( INADDR_LOOPBACK, &bestIfIndex ); + ok( apiReturn == NO_ERROR, + "GetBestInterface([127.0.0.1], {%lu}) returned %lu, expected %d\n", + bestIfIndex, apiReturn, NO_ERROR ); +} + /* still-to-be-tested 98-onward functions: -GetBestInterface GetBestRoute IpReleaseAddress IpRenewAddress @@ -1468,6 +1491,7 @@ static DWORD CALLBACK testWin98Functions(void *p) testGetInterfaceInfo(); testGetAdaptersInfo(); testGetNetworkParams(); + testGetBestInterface(); return 0; }