[PATCH v2 1/5] iphlpapi/tests: Add tests for GetBestInterface.
Jinoh Kang
wine at gitlab.winehq.org
Tue Jun 21 15:45:27 CDT 2022
From: Jinoh Kang <jinoh.kang.kr at gmail.com>
Signed-off-by: Jinoh Kang <jinoh.kang.kr at 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;
}
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/266
More information about the wine-devel
mailing list