Module: wine Branch: master Commit: 3282d7abf23a8dc0beed0b28bc03ad5a195627a0 URL: https://source.winehq.org/git/wine.git/?a=commit;h=3282d7abf23a8dc0beed0b28b...
Author: Jinoh Kang jinoh.kang.kr@gmail.com Date: Sun Jan 16 00:30:06 2022 +0900
iphlpapi/tests: Add tests for GetBestInterface.
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 214256c18b4..af5450f3ab7 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -1457,9 +1457,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 @@ -1469,6 +1492,7 @@ static DWORD CALLBACK testWin98Functions(void *p) testGetInterfaceInfo(); testGetAdaptersInfo(); testGetNetworkParams(); + testGetBestInterface(); return 0; }