Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52224 Signed-off-by: Bernhard Übelacker bernhardu@mailbox.org --- dlls/inetmib1/tests/main.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/dlls/inetmib1/tests/main.c b/dlls/inetmib1/tests/main.c index 32785fcc3fe..a4a1dbe7cdb 100644 --- a/dlls/inetmib1/tests/main.c +++ b/dlls/inetmib1/tests/main.c @@ -95,6 +95,8 @@ static void testQuery(void) UINT mib2UdpTable[] = { 1,3,6,1,2,1,7,5,1,1 }; SnmpVarBind vars[3], vars2[3], vars3[3]; UINT entry; + ULONGLONG start_time; + int timeout_reached;
if (!pSnmpExtensionQuery) { @@ -189,6 +191,7 @@ if (0) /* crashes on native */ moreData = TRUE; noChange = FALSE; entry = 0; + start_time = GetTickCount64(); do { SetLastError(0xdeadbeef); error = 0xdeadbeef; @@ -259,7 +262,9 @@ if (0) /* crashes on native */ } else if (noChange) skip("no change in OID, no MIB2 IF table implementation\n"); - } while (moreData && !noChange); + timeout_reached = GetTickCount64() > start_time + 5000; + } while (moreData && !noChange && !timeout_reached); + ok(!timeout_reached, "loop finished not in time.\n"); SnmpUtilVarBindFree(&vars2[0]); SnmpUtilVarBindFree(&vars2[1]); SnmpUtilVarBindFree(&vars2[2]); @@ -296,6 +301,7 @@ if (0) /* crashes on native */ list.len = 1; list.list = vars2; moreData = TRUE; + start_time = GetTickCount64(); do { ret = pSnmpExtensionQuery(SNMP_PDU_GETNEXT, &list, &error, &index); ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index); @@ -350,7 +356,9 @@ if (0) /* crashes on native */ } else if (noChange) skip("no change in OID, no MIB2 IP address table implementation\n"); - } while (moreData && !noChange); + timeout_reached = GetTickCount64() > start_time + 5000; + } while (moreData && !noChange && !timeout_reached); + ok(!timeout_reached, "loop finished not in time.\n"); SnmpUtilVarBindFree(&vars2[0]);
/* Check the type and OIDs of the IP route table */ @@ -362,6 +370,7 @@ if (0) /* crashes on native */ list.list = vars2; moreData = TRUE; noChange = FALSE; + start_time = GetTickCount64(); do { ret = pSnmpExtensionQuery(SNMP_PDU_GETNEXT, &list, &error, &index); ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index); @@ -416,7 +425,9 @@ if (0) /* crashes on native */ } else if (noChange) skip("no change in OID, no MIB2 IP route table implementation\n"); - } while (moreData && !noChange); + timeout_reached = GetTickCount64() > start_time + 5000; + } while (moreData && !noChange && !timeout_reached); + ok(!timeout_reached, "loop finished not in time.\n"); SnmpUtilVarBindFree(&vars2[0]);
/* Check the type and OIDs of the UDP table */ @@ -428,6 +439,7 @@ if (0) /* crashes on native */ list.list = vars2; moreData = TRUE; noChange = FALSE; + start_time = GetTickCount64(); do { ret = pSnmpExtensionQuery(SNMP_PDU_GETNEXT, &list, &error, &index); ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index); @@ -488,7 +500,9 @@ if (0) /* crashes on native */ } else if (noChange) skip("no change in OID, no MIB2 UDP table implementation\n"); - } while (moreData && !noChange); + timeout_reached = GetTickCount64() > start_time + 5000; + } while (moreData && !noChange && !timeout_reached); + ok(!timeout_reached, "loop finished not in time.\n"); SnmpUtilVarBindFree(&vars2[0]); }
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52224 Signed-off-by: Bernhard Übelacker bernhardu@mailbox.org --- dlls/inetmib1/tests/main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/inetmib1/tests/main.c b/dlls/inetmib1/tests/main.c index a4a1dbe7cdb..5a48276074c 100644 --- a/dlls/inetmib1/tests/main.c +++ b/dlls/inetmib1/tests/main.c @@ -78,6 +78,18 @@ if (0) } }
+#define dump_oid(desc, oid) dump_oid_(__LINE__, desc, oid) +static void dump_oid_(int line, const char* desc, AsnObjectIdentifier *oid) +{ + char buf[100] = {}; + int i; + + for (i = 0; i < oid->idLength; i++) + sprintf(buf + strlen(buf), "%d.", oid->ids[i]); + + trace_(__FILE__, line)("%s: len=%u, %s\n", desc, oid->idLength, buf); +} + static void testQuery(void) { BOOL ret, moreData, noChange; @@ -439,6 +451,8 @@ if (0) /* crashes on native */ list.list = vars2; moreData = TRUE; noChange = FALSE; + dump_oid("vars[0].name", &vars[0].name); + dump_oid("vars2[0].name", &vars2[0].name); start_time = GetTickCount64(); do { ret = pSnmpExtensionQuery(SNMP_PDU_GETNEXT, &list, &error, &index); @@ -454,6 +468,9 @@ if (0) /* crashes on native */ "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); ok(index == 0, "expected index 0, got %d\n", index); } + trace("index=%d\n", index); + dump_oid("vars[0].name", &vars[0].name); + dump_oid("vars2[0].name", &vars2[0].name); if (!ret) moreData = FALSE; else if (error)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=104148
Your paranoid android.
=== debian11 (32 bit report) ===
inetmib1: main.c:522: Test failed: loop finished not in time.
=== debian11 (32 bit Arabic:Morocco report) ===
inetmib1: main.c:522: Test failed: loop finished not in time.
=== debian11 (32 bit German report) ===
inetmib1: main.c:522: Test failed: loop finished not in time.
=== debian11 (32 bit French report) ===
inetmib1: main.c:522: Test failed: loop finished not in time.
=== debian11 (32 bit Hebrew:Israel report) ===
inetmib1: main.c:522: Test failed: loop finished not in time.
=== debian11 (32 bit Hindi:India report) ===
inetmib1: main.c:522: Test failed: loop finished not in time.
=== debian11 (32 bit Japanese:Japan report) ===
inetmib1: main.c:522: Test failed: loop finished not in time.
=== debian11 (32 bit Chinese:China report) ===
inetmib1: main.c:522: Test failed: loop finished not in time.
=== debian11 (32 bit WoW report) ===
inetmib1: main.c:522: Test failed: loop finished not in time.
=== debian11 (64 bit WoW report) ===
inetmib1: main.c:522: Test failed: loop finished not in time.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52224 Signed-off-by: Bernhard Übelacker bernhardu@mailbox.org --- dlls/inetmib1/tests/main.c | 45 +++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-)
diff --git a/dlls/inetmib1/tests/main.c b/dlls/inetmib1/tests/main.c index 5a48276074c..48bc910c93b 100644 --- a/dlls/inetmib1/tests/main.c +++ b/dlls/inetmib1/tests/main.c @@ -20,23 +20,30 @@ #include <windef.h> #include <winbase.h> #include <snmp.h> +#include <iphlpapi.h> +#include <winsock2.h>
#include "wine/test.h"
static BOOL (WINAPI *pSnmpExtensionInit)(DWORD, HANDLE*, AsnObjectIdentifier*); static BOOL (WINAPI *pSnmpExtensionQuery)(BYTE, SnmpVarBindList*, AsnInteger32*, AsnInteger32*);
+static DWORD (WINAPI *pGetUdpTable)(PMIB_UDPTABLE, PDWORD, BOOL); + static HMODULE init_test_functions(void) { HMODULE mod = LoadLibraryA("inetmib1"); + HMODULE mod_iphlpapi = LoadLibraryA("iphlpapi");
ok(mod != NULL, "failed to load inetmib1.dll\n"); - if (!mod) return NULL;
pSnmpExtensionInit = (void *)GetProcAddress(mod, "SnmpExtensionInit"); pSnmpExtensionQuery = (void *)GetProcAddress(mod, "SnmpExtensionQuery");
+ if (mod_iphlpapi) + pGetUdpTable = (void *)GetProcAddress(mod_iphlpapi, "GetUdpTable"); + return mod; }
@@ -523,6 +530,41 @@ if (0) /* crashes on native */ SnmpUtilVarBindFree(&vars2[0]); }
+static void trace_GetUdpTable(void) +{ + DWORD size = 0; + DWORD ret; + + if (!pGetUdpTable) + { + skip("no GetUdpTable\n"); + return; + } + + ret = pGetUdpTable(NULL, &size, TRUE); + + if (ret == ERROR_INSUFFICIENT_BUFFER) + { + MIB_UDPTABLE *table = HeapAlloc(GetProcessHeap(), 0, size); + if (table) + { + if (pGetUdpTable(table, &size, TRUE) == NO_ERROR) + { + for (int i = 0; i < table->dwNumEntries; i++) + { + trace("udp: %d.%d.%d.%d:%d\n", + (table->table[i].dwLocalAddr >> 0) & 0xff, + (table->table[i].dwLocalAddr >> 8) & 0xff, + (table->table[i].dwLocalAddr >> 16) & 0xff, + (table->table[i].dwLocalAddr >> 24) & 0xff, + ntohs(table->table[i].dwLocalPort)); + } + } + HeapFree(GetProcessHeap(), 0, table); + } + } +} + START_TEST(main) { HMODULE mod; @@ -530,6 +572,7 @@ START_TEST(main) if (!(mod = init_test_functions())) return;
+ trace_GetUdpTable(); testInit(); testQuery();
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=104149
Your paranoid android.
=== debian11 (32 bit report) ===
inetmib1: main.c:529: Test failed: loop finished not in time.
=== debian11 (32 bit Arabic:Morocco report) ===
inetmib1: main.c:529: Test failed: loop finished not in time.
=== debian11 (32 bit German report) ===
inetmib1: main.c:529: Test failed: loop finished not in time.
=== debian11 (32 bit French report) ===
inetmib1: main.c:529: Test failed: loop finished not in time.
=== debian11 (32 bit Hebrew:Israel report) ===
inetmib1: main.c:529: Test failed: loop finished not in time.
=== debian11 (32 bit Hindi:India report) ===
inetmib1: main.c:529: Test failed: loop finished not in time.
=== debian11 (32 bit Japanese:Japan report) ===
inetmib1: main.c:529: Test failed: loop finished not in time.
=== debian11 (32 bit Chinese:China report) ===
inetmib1: main.c:529: Test failed: loop finished not in time.
=== debian11 (32 bit WoW report) ===
inetmib1: main.c:529: Test failed: loop finished not in time.
=== debian11 (64 bit WoW report) ===
inetmib1: main.c:529: Test failed: loop finished not in time.
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=104147
Your paranoid android.
=== debian11 (32 bit report) ===
inetmib1: main.c:505: Test failed: loop finished not in time.
=== debian11 (32 bit Arabic:Morocco report) ===
inetmib1: main.c:505: Test failed: loop finished not in time.
=== debian11 (32 bit German report) ===
inetmib1: main.c:505: Test failed: loop finished not in time.
=== debian11 (32 bit French report) ===
inetmib1: main.c:505: Test failed: loop finished not in time.
=== debian11 (32 bit Hebrew:Israel report) ===
inetmib1: main.c:505: Test failed: loop finished not in time.
=== debian11 (32 bit Hindi:India report) ===
inetmib1: main.c:505: Test failed: loop finished not in time.
=== debian11 (32 bit Japanese:Japan report) ===
inetmib1: main.c:505: Test failed: loop finished not in time.
=== debian11 (32 bit Chinese:China report) ===
inetmib1: main.c:505: Test failed: loop finished not in time.
=== debian11 (32 bit WoW report) ===
inetmib1: main.c:505: Test failed: loop finished not in time.
=== debian11 (64 bit WoW report) ===
inetmib1: main.c:505: Test failed: loop finished not in time.